Question

I have an upstart script that looks like this:

description "my script"

# Start and stop runlevels
start on runlevel [2345]
stop on runlevel [!2345]
# Automatically respawn
respawn
respawn limit 15 5

script
    exec /home/myscript.sh
end script

This script launches a vpn, so in the process it takes some time to come up,when I see the logs on /var/log/upstart/myscript.sh I see that the process is being launched continually so it never finishes launching. What can I do to make upstart wait for the process to finish launching ?

Was it helpful?

Solution

Your upstart script has a respawn stansa but no expect stansa. Perhaps upstart is tracking the wrong process.

The documentation has the following warning "If you are creating a new Job Configuration File, do not specify the respawn stanza until you are fully satisfied you have specified the expect stanza correctly. If you do, you will find the behaviour potentially very confusing." http://upstart.ubuntu.com/cookbook/#respawn

http://upstart.ubuntu.com/cookbook/#how-to-establish-fork-count

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top