I have an upstart script that needs to run on reboot or shutdown, but it needs to access the network to post an http requests and wait for the replies, I tried

start on starting rc


start on starting (rc and net-device-up IFACE=eth0)

but no luck.

  • See also serverfault.com/questions/117584/…. Another option is to use start on net-device-up instead of specifying specific interface. As it is possible that the interface is not really responsible for network connectivity. – zeridon Feb 12 '14 at 16:07

I recommend using the following job contents:

# The deconfiguring-networking bit stops the network from going down until we are done here.
start on runlevel [016] or deconfiguring-networking


exec /path/to/myscript.sh

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy