Ubuntu uses Upstart to handle starting, stopping and supervising of services. This page describes how to run Apache ServiceMix as a service on Ubuntu.
For Upstart, every service is defined in its own file in /etc/event.d. To add ServiceMix, just create /etc/event.d/servicemix with the contents shown below:
# Apache ServiceMix # # Starts/stops ServiceMix when the computer starts/stops # Also restart ServiceMix after it has died unexpectedly start on runlevel 2 start on runlevel 3 start on runlevel 4 start on runlevel 5 stop on runlevel 0 stop on runlevel 1 stop on runlevel 6 kill timeout 15 respawn exec /opt/servicemix/bin/servicemix |
In this example:
/opt/servicemix, no modifications are required to the standard scriptThe example above will start/stop ServiceMix automatically with the system, but you can also control the service from a command line:
sudo initctl start servicemix starts ServiceMix manuallysudo initctl status servicemix will show you the current status of the service, as well as the PID when runningsudo initctl stop servicemix stops ServiceMix manually