I have set up the following upstart script:
# autossh
description "autossh connections"
start on started dbus
stop on (runlevel [06] or stopped dbus)
respawn
respawn limit 5 60 # respawn max 5 times in 60 seconds
script
export AUTOSSH_PIDFILE=/var/run/autossh.pid
export AUTOSSH_POLL=60
export AUTOSSH_FIRST_POLL=30
export AUTOSSH_GATETIME=0
export AUTOSSH_DEBUG=1
exec sudo -H -u pi -s autossh -M 0 -R remoteport:127.0.0.1:localport remoteuser@remote.host
exec sudo -H -u pi -s autossh -M 0 -R remoteport2:127.0.0.1:localport2 remoteuser@remote.host
end script
but every time after the start I get this error message:
ssh exited prematurely with status 0
How can I fix it?
Thanks