Re: ssh session does not end after executing remote command



That did the trick!

I now do:

ssh user@xxxxxxxxxxxx "sudo -u zimbra /opt/zimbra/bin/zmcontrol start < /dev/null "

and it works.

thanks a lot.
regards Bart.

Richard E. Silverman wrote:
"BH" == Bart Heinsius <bheinsius@xxxxxxxxx> writes:

BH> Hi, After remotely stopping my email server and backing it up
BH> using rsnapshot, I want to restart my email server. For that I
BH> created the following shell script:

BH> #!/bin/sh

BH> # Start Zimbra ssh user@xxxxxxxxxxxx "sudo -u zimbra
BH> /opt/zimbra/bin/zmcontrol start"


BH> ssh logs in automatically through rsa authentication.

BH> The "zmcontrol start" command gets executed remotely and completes
BH> successfully (rc=0). The problem is that the ssh session doesn't
BH> end.

BH> Strange thing is that the same script executing "zmcontrol stop"
BH> does finish normally.

BH> I read the ssh documentation and it says that the ssh session will
BH> end if all X11 and initiated tcp/ip sessions have ended. My guess
BH> is that the zmcontrol program initiates a few tcp/ip sessions but
BH> doesn't close them properly.

BH> Is there anyway to force ssh to terminate the session after the
BH> zmcontrol program has ended?

BH> kind regards Bart.

Perhaps: http://www.snailbook.com/faq/background-jobs.auto.html

.



Relevant Pages

  • ssh session does not end after executing remote command
    ... For that I created the following shell script: ... The problem is that the ssh session doesn't end. ... I read the ssh documentation and it says that the ssh session will end if all X11 and initiated tcp/ip sessions have ended. ... My guess is that the zmcontrol program initiates a few tcp/ip sessions but doesn't close them properly. ...
    (comp.security.ssh)
  • Re: ssh session does not end after executing remote command
    ... I want to restart my email server. ... BH> ssh logs in automatically through rsa authentication. ... BH> I read the ssh documentation and it says that the ssh session will ... BH> zmcontrol program has ended? ...
    (comp.security.ssh)
  • Re: [kde-linux] Sessions names
    ... ssh 192.168.2.80??? ... You can write a wrapper script that would start ssh to some ip and rename the ... konsole session dynamically. ... dcop call to konsole you need to know the pid of konsole. ...
    (KDE)
  • RE: unexplained pausing/freezing of SSH Terminal Sessions ?
    ... Do you use expect to initiate your SSH connections? ... i'm having an SSH Terminal Session "issue". ... These machines define an internal/private ...
    (SSH)
  • SSH connection thru corporate firewall to home sshd on Port 80
    ... I have a FreeBSD server running sshd listening on port 80 at home. ... I can successfully establish a ssh session from a Winnt/putty:80 box the ... When I take the same Winnt machine behind a corporate firewall which passes ...
    (comp.security.ssh)