I am using Ubuntu 12.04 LTS and this system uses primarily upstart jobs. Unfortunately my system also depends on a manually compiled dbmail server, which only has a init script, but no upstart script.
Using update-rc.d dbmail defaults
I installed dbmail for all runlevels, but unfortunately it is started before MySQL is up, so the daemon dies again. I also tried moving it to S90 or the like, still MySQL is not available when the script is run.
I attempted to add a dependency to the LSB header of the script, as follows:
#!/bin/sh
### BEGIN INIT INFO
# Provides: dbmail
# Required-Start: $local_fs $remote_fs $syslog $network mysql
# Required-Stop: $local_fs $remote_fs $syslog $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start dbmail services
# Description: Run network services provided by dbmail such as
# imap-server, pop3-server, lmtp-server, timsieve-server
### END INIT INFO
Unfortunately the script still seems to be started before MySQL is. I am used to old-fashined init scripts, not to upstart jobs, so I am a little bit confused here. How can I add the dependency or how can I get the mysql
job to start before the dbmail
init script?
How can I check / see the start order taken for jobs + init scripts during boot? Is there a tool for this?
Launching the script manually from a shell after startup works fine, as MySQL is already running then.