Ubuntu uses Upstart to handle starting, stopping and supervising of services. This page describes how to run Apache ServiceMix as a service on Ubuntu.

Configuring Upstart to run ServiceMix

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:

Using Upstart to control ServiceMix

The example above will start/stop ServiceMix automatically with the system, but you can also control the service from a command line: