1

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?

grant
  • 188
  • 9

2 Answers2

1

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

Jodie C
  • 733
  • 6
  • 9
0

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

The appropriate man page will help.

pjz
  • 10,497
  • 1
  • 31
  • 40