Dmitry Wolf
Ubuntu Upstart
- http://en.wikipedia.org/wiki/Upstart
- http://en.wikipedia.org/wiki/Cron
- http://en.wikipedia.org/wiki/Init
- http://askubuntu.com/questions/19320/whats-the-recommended-way-to-enable-disable-services
- http://upstart.ubuntu.com/cookbook/
- http://upstart.ubuntu.com/cookbook/#expect
- http://upstart.ubuntu.com/cookbook/#how-to-establish-fork-count
When a daemon cannot be simply run in the foreground, they fork. You can tell upstart to expect this.
- expect fork - When a daemon forks exactly once (normal backgrounding)
- expect daemon - When a daemon forks exactly twice (a daemon that does priv separation?)
- expect stop - When a daemon emits SIGSTOP when it is done doing its thing
http://upstart.ubuntu.com/cookbook/#respawn
/etc/init/
service.conf
description "Network License Manager (NLM)"
start on (net-device-up
and local-filesystems
and runlevel [2345])
stop on runlevel [016]
console output
umask 022
respawn
respawn limit 3 120
expect fork
env WORKDIR=/opt/flexnetserver
exec $WORKDIR/lmgrd -c $WORKDIR/autodesk.lic -l $WORKDIR/boot.log
post-start script
$WORKDIR/lmutil lmdiag -n -c $WORKDIR/autodesk.lic >> $WORKDIR/boot_diagnostics.log
end script