Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I currently have a script in /etc/init.d which calls autossh with port forward to set up reverse ssh on the server. The command is preceded by 'sleep 20' to try to ensure the command is called after networking is active. The questions is, what is a better way to run this script later in the boot cycle (after networking is set up)? Could/should this be moved to /etc/rc.local or is there a better solution?

share|improve this question
Check out… – Dan May 25 '12 at 14:46
up vote 1 down vote accepted

Converting the init script to Upstart will solve this problem. See this previous response (and the accepted answer) on starting a task after the networking is up:

upstart scripts: run a task after networking goes up

share|improve this answer
I noticed this question in my searches, but I'm still confused. I can't put the "start on (..." in my init script, so are the commands displayed the contents of the .conf file? I'm not sure what's happening when the questioner refers to 'it should translate to...'? – grant Jun 29 '11 at 14:33
The commands displayed are the contents of the .conf file in /etc/init/, where Upstart stores its conf files. You won't use an init.d script after creating the Upstart config file. The Upstart config file will replace it in functionality. – Jodie C Jun 29 '11 at 15:27
Got it, thank you. – grant Jun 29 '11 at 21:06

I suspect that /etc/network/if-up.d/ might be more appropriate.

The appropriate man page will help.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.