Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.