Hi,
problem seen on lanturtle which uses openwrt as base system.
/etc/init.d/autossh can't start multiple instance of openssh.
service_start uses start-stop-daemon w/ -x /path/to/openssh,
since SERVICE_NAME_MATCH and SERVICE_PID_FILE aren't defined,
once the first instance of openssh is started, the next ones
aren't launched bcoz start-stop-daemon already see the first
instance.
it is possible to launch more than one openssh session using
the following changes...
in function start_instance of /etc/init.d/autossh (autossh.init)
before :
export AUTOSSH_GATETIME="${gatetime:-30}"
export AUTOSSH_POLL="${poll:-600}"
service_start /usr/sbin/autossh -M ${monitorport:-20000} -f ${ssh}
after :
export AUTOSSH_GATETIME="${gatetime:-30}"
export AUTOSSH_POLL="${poll:-600}"
export AUTOSSH_PIDFILE="/var/run/autossh.${ssh##* }.pid"
export AUTOSSH_LOGFILE="/var/log/autossh.${ssh##* }.log"
SERVICE_PID_FILE="${AUTOSSH_PIDFILE}"
service_start /usr/sbin/autossh -M ${monitorport:-20000} -f ${ssh}
${ssh##* } is used to get the user@host or host target.
this permit to have something like :
root@turtle:~# cat /etc/config/autossh
config autossh
option gatetime '0'
option monitorport '30022'
option poll '600'
option ssh '-i /root/.ssh/id_rsa -N -T -R 32200:localhost:22 host1'
config autossh
option gatetime '0'
option monitorport '40022'
option poll '600'
option ssh '-i /root/.ssh/id_rsa -N -T -R 42200:localhost:22 host2'
Regards
PS : can't register/submit a trac defect => Submission rejected as potential spam !