Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 serverfault.com/questions/224432/… –  Dan May 25 '12 at 14:46

2 Answers 2

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

 
discard

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.