I have an upstart service defined as:
description "Lenik's secret tunnel thru *.ssh.myserver.com" author "谢继雷 (Lenik)" start on (net-device-up IFACE!=lo) stop on runlevel[!2345] script # -T disable pseudo-tty allocation # -f go to background after login but before command exec # -n stdin from /dev/null, must be used when ssh is run in bg. # -N no command # -D "dynamic" app-level port forwarding. sudo -usshproxy ssh -qTfn -ND *:7878 ssh.myserver.com end script
But the ssh tunnel seems to be zombied after some hours, so I want to restart it each hour, how to do it within this .conf file, or should I write another cron.hourly job?