0

For instance, I use the following commands to start and stop a particular web application:

/usr/local/application/MyServiceController.sh all.start
/usr/local/application/MyServiceController.sh all.stop

These commands perform some setup tasks and start several processes (httpd and java). I want to use upstart to monitor and control the application, but I don't want to diverge from the vendor-supported startup process.

Is this possible, or should I just fall back to a SysV-style init script?

Matthew
  • 156
  • 3

1 Answers1

1

If having Upstart monitor the service isn’t essential, you can do something like the following (Upstart cookbook: Single Job Instance Running without PID):

start on filesystem    # or something more suitable
stop on runlevel [06]  # ditto

pre-start exec /usr/local/application/MyServiceController.sh all.start
post-stop exec /usr/local/application/MyServiceController.sh all.stop

This is pretty much equivalent to a sysvinit script (which won’t have monitoring either).

As for getting Upstart to monitor and respawn the services, I’m afraid nobody has came up with a way to automatically convert an arbitrary script that launches a number of separate services (with mutual dependencies) to a set of equivalent Upstart jobs.

ion
  • 11
  • 1