On Tue, Aug 19, 2014 at 09:43:37PM +0100, steve-ALUG@hst.me.uk wrote:
On 19/08/14 19:12, Chris Green wrote:
On Sat, Aug 16, 2014 at 05:07:49PM +0100, Paul Lenton wrote:
Hi Chris,
If the timing isn't important, is there anything to stop you writing the script with sleep 1 in it ~59 times and then running the script every minute in cron?
That did occur to me too, I suspect it may be the most practical method.
That way, even if the script dies, you only have to wait at most a minute before it tries again
Yes.
Would inittab with respawn be a better way to start it. That way it would restart if it failed?
http://www.linuxquestions.org/questions/linux-server-73/how-to-respawn-a-ser...
Now that feels like the 'proper' way to do it, thanks for the idea.
However modern (as in what I use!) Linux systems don't use inittab.
There is of course an equivalent though which is well described in the init(5) man page. There's even a whole system for *user* initialised services which is even better! :-)
It rather makes autossh unnecessary, run your ssh reverse-tunnel creating process(es) as upstart services. (See another thread)