Your ssh isn't exiting because a child process, in this case zimbra, remains. As some others have suggested, this is due to ssh waiting on both stdin and stdout of the child process to close.
For example, if you do the following, you'll experience a hang: pc1$ ssh pc2 pc2$ xterm & pc2$ logout ...hang without exit.. until you close the xterm. Something like the following should behave more like you expect: pc1$ ssh pc2 pc2$ xterm < /dev/null >& /dev/null & pc2$ logout ...ssh session terminates pc1$ Hope this helps. Cheers, Stephen -- Stephen Joyce Systems Administrator P A N I C Physics & Astronomy Department Physics & Astronomy University of North Carolina at Chapel Hill Network Infrastructure voice: (919) 962-7214 and Computing fax: (919) 962-0480 http://www.panic.unc.edu Some people make the world turn and others just watch it spin. -- Jimmy Buffet On Tue, 11 Sep 2007, Tobias Brunner wrote: > Hi > > Does no one have an idea? > Are more informations needed? > > I appreciate any help... > > Thanks! > Regards, > Tobias > > Tobias Brunner wrote: >> Hi everybody >> >> On one server, I have DumpPostUserCmd configured to execute a script. This >> is executed after the backup, but it doesn't end so the backup can never >> finish. >> >> Detailed description: >> The DumpPreUserCmd ($sshPath -q -x -l root $host >> /usr/local/bin/zimbra_pre_back.sh) stops the mailserver on the remote >> machine. That works perfectly and the backup runs correctly. >> After the backup has finished, the DumpPostUserCmd ($sshPath -q -x -l root >> $host /usr/local/bin/zimbra_post_back.sh) is executed. But this process does >> never end despite the "exit 0" statement on the end of the bash script. >> When I do a "ps -Af | grep 7224" (7224 is the running backup process) I get >> this: >> >> backuppc 7224 4502 0 01:00 ? 00:02:38 /usr/bin/perl >> /usr/local/BackupPC/bin/BackupPC_dump server >> backuppc 7235 7224 0 01:01 ? 00:00:01 [BackupPC_dump] <defunct> >> backuppc 7236 7224 1 01:01 ? 00:09:49 [BackupPC_dump] <defunct> >> backuppc 7276 7224 0 01:24 ? 00:00:00 /usr/bin/ssh -q -x -l root >> server.domain.ch /usr/local/bin/zimbra_post_back.sh >> >> After killing 7276 the backup finishes and I can see this in the Xfer Log: >> >> Executing DumpPreUserCmd: /usr/bin/ssh -q -x -l root server.domain.ch >> /usr/local/bin/zimbra_pre_back.sh >> Host server.domain.ch >> Stopping stats...Done >> Stopping mta...Done >> Stopping spell...Done >> Stopping snmp...Done >> Stopping antivirus...Done >> Stopping antispam...Done >> Stopping imapproxy...Done >> Stopping mailbox...Done >> Stopping logger...Done >> Stopping ldap...Done >> Successfully stopped Zimbra at 01:01:04 >> incr backup started back to 2007-08-30 13:28:11 (backup #9) for directory etc >> ... >> Executing DumpPostUserCmd: /usr/bin/ssh -q -x -l root server.domain.ch >> /usr/local/bin/zimbra_post_back.sh >> Host server.domain.ch >> Starting ldap...Done. >> Starting logger...Done. >> Starting mailbox...Done. >> Starting antispam...Done. >> Starting antivirus...Done. >> Starting snmp...Done. >> Starting spell...Done. >> Starting mta...Done. >> Starting stats...Done. >> Successfully started Zimbra at 01:25:22 >> >> That looks ok, except that the script does not end... >> Does anyone have an idea why that is? >> I have tried everything even using timeoutd on the remote host (which works >> perfectly) but the ssh process on the backuppc server does not exit =(. >> >> Thanks for your help >> >> Regards, >> Tobias >> >> >> zimbra_pre_back.sh: >> #!/bin/sh >> >> my_date=`date +%Y-%m-%d` >> my_time=`date +%H:%M:%S` >> echo "Stopping time: $my_time" >> /opt/zimbra/backup/zm_backup-$my_date.log >> su - zimbra -c "/opt/zimbra/bin/zmcontrol stop" | tee -a >> /opt/zimbra/backup/zm_backup-$my_date.log >> my_time=`date +%H:%M:%S` >> echo "Successfully stopped Zimbra at $my_time" >> exit 0 >> >> zimbra_post_back.sh: >> #!/bin/sh >> >> my_date=`date +%Y-%m-%d` >> my_time=`date +%H:%M:%S` >> echo "Starting time: $my_time" >> /opt/zimbra/backup/zm_backup-$my_date.log >> su - zimbra -c "/opt/zimbra/bin/zmcontrol start" | tee -a >> /opt/zimbra/backup/zm_backup-$my_date.log >> my_time=`date +%H:%M:%S` >> echo "Successfully started Zimbra at $my_time" >> exit 0 >> >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Splunk Inc. >> Still grepping through log files to find problems? Stop. >> Now Search log events and configuration files using AJAX and a browser. >> Download your FREE copy of Splunk now >> http://get.splunk.com/ >> _______________________________________________ >> BackupPC-users mailing list >> BackupPC-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/backuppc-users >> http://backuppc.sourceforge.net/ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > BackupPC-users mailing list > BackupPC-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/backuppc-users > http://backuppc.sourceforge.net/ > > > -- > > ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ BackupPC-users mailing list BackupPC-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/backuppc-users http://backuppc.sourceforge.net/