Hi all,
Very good news,
The problem of "timed out" does not come from SSH at all but from BackupPC.
It is BackupPC that closes the connection because it does not receive an answer to "Are you alive?". BackupPC is too fast asking, and the remote server is busy doing the previous request or "in pause" because of the "sleep". I would point the finger at the too low settings of ServerAliveInterval and ServerAliveCountMax of BackupPC itself...
I found the trouble when I put the "sleep" outside the server command after reversing the order of pre-backup and AutoBlock which make more sense. In doing so, it was BackuPC which was taking the "pause" and the remote server had plenty of time to complete the previous command long before BackupPC asked for "Are you alive?" When asked by BackupPC, he could respond immediately.
It was always working with localserver-template because BackupPC knows it is local and maybe it is not asking the "Are you alive?" IANAP but...
Poor SSH, I have to apologize for doubting him.
Michel-André
Might help someone...
pre-backup script called by: /var/lib/BackupPC/script/pre-sauvegarde.sh $host
#!/bin/sh
#-------------------------------------------
# /var/lib/BackupPC/script/pre-sauvegarde.sh
#
# Michel-André, 2018-05-05_20h24
#-------------------------------------------
# Désactivation d'AutoBlock
/usr/bin/ssh -l root $1 "config setprop sshd AutoBlock disabled; \
/sbin/e-smith/signal-event remoteaccess-update"
# Pause de BackupPC
/bin/sleep 45
# Le test ci-dessous va écrire le statut de la propriété AutoBlock dans le journal.
# Output from DumpPreUserCmd: AutoBlock=disabled
# ou
# Output from DumpPreUserCmd: AutoBlock=enabled
if ( ! (/usr/bin/ssh -l root $1 config show sshd | grep 'AutoBlock=disabled') )
then
/bin/mail -s "AutoBlock=disabled NON FONCTIONNEL, arrêt des sauvegardes de la machine $1 pour 24 heures" admin@micronator-101.org < /dev/null
# Arrêt de la sauvegarde en cours et désactivation des sauvegardes de cette machine
# pour 24 heures.
#
# Référence:
# https://www.mail-archive.com/backuppc-users@lists.sourceforge.net/msg10075.html
# Stop/delay backups
# BackupPC_serverMesg stop HOST REQ_USER BACKOFF
# HOST is the host to cancel, REQ_USER is the requesting user (just for
# log purposes) and BACKOFF is the backoff time in hours.
/usr/share/BackupPC/bin/BackupPC_serverMesg stop $1 backuppc 24
fi
# pre-backup
/usr/bin/ssh -l root $1 "/sbin/e-smith/signal-event pre-backup"
# Pause de BackupPC
/bin/sleep 15
post-backup script called by: /var/lib/BackupPC/script/post-sauvegarde.sh $host
#!/bin/sh
#--------------------------------------------
# /var/lib/BackupPC/script/post-sauvegarde.sh
#
# Michel-André, 2018-05-05_20h24
#--------------------------------------------
# Commande post-backup
/usr/bin/ssh -l root $1 "/sbin/e-smith/signal-event post-backup"
# Pause de BackupPC
/bin/sleep 15
# Activation d'AutoBlock
/usr/bin/ssh -l root $1 "config setprop sshd AutoBlock enabled; \
/sbin/e-smith/signal-event remoteaccess-update"
# Pause de BackupPC
/bin/sleep 45
# Le test ci-desous va écrire le statut de AutoBlock dans le journal.
# Output from DumpPreUserCmd: AutoBlock=disabled
# ou
# Output from DumpPreUserCmd: AutoBlock=enabled
if ( ! (/usr/bin/ssh -l root $1 config show sshd | grep 'AutoBlock=enabled') )
then
/bin/mail -s "AutoBlock=ensabled NON FONCTIONNEL. Vérifiez le paramètre s.v.p." admin@micronator-101.org < /dev/null
fi