I had the same question, and I also found a different answer. The author lists 4 options to accomplish this, of which I like the first one best:
initclt emit myservice-started to signal the completion of your dependent service's startup. In the linked answer, it is suggested to add this line to the end of the dependency service's
init.d script, but I prefer a different method.
I like to create a new
inid.d script named
myservice-started that only contains a
start section. Using the appropriate commenting style in the file's header, I declare that it depends on
$myservice to be started. In the
start section, I tell upstart about
myservice being started. You can install it with
I like this solution because it is not intrusive; if an update changes any of the existing
init.d scripts, it won't affect these additional scripts. But remember that changes to your upstart scripts are required.
It might look like this:
### BEGIN INIT INFO
# Provides: myservice-started
# Required-Start: $myservice
# Default-Start: 2 3 4 5
# Short-Description: send upstart signal after starting myservice
# Description: myservice needs to run before some upstart services can run
### END INIT INFO
case "$1" in
log_daemon_msg "Signaling myservice started..." "myservice-started"
initctl emit myservice-started --no-wait
log_action_msg "Usage: /etc/init.d/myservice-started start"
Your upstart script waiting for myservice can listen for the
start on myservice-started