Connect. Communicate. Collaborate. Securely.

Home » Kerio User Forums » Kerio Connect » Starting KerioMailServer via ssh
  •  
steinmuehlen_admins

Messages: 4
Karma: 0
Send a private message to this user
Hi,
I'm writing a script in which I need to stop/start the
keriomailserver-daemon via ssh. Stopping causes no problems
but however I want to start the daemon (start/restart)
my ssh-command manage it to start keriomailserver but
fails to close the ssh-session. Locally I've no problems with
starting, it's only if try to do it remotely.

Remotely:
[root<_at_>localhost ~]# ssh remotehost /etc/init.d/keriomailserver stop
Shutting down Kerio MailServer: [ OK ]
[root<_at_>localhost ~]# ssh remotehost /etc/init.d/keriomailserver start
Starting Kerio MailServer: [ OK ]
[..hangs up till I stop the KerioMailServer locally on remotehost]

Locally:
[root<_at_>remotehost ~]# /etc/init.d/keriomailserver stop
Shutting down Kerio MailServer: [ OK ]
[root<_at_>remotehost ~]# /etc/init.d/keriomailserver start
Starting Kerio MailServer: [ OK ]
[root<_at_>remotehost ~]#

What could be the problem??
thanxx
-steinmuehlen_admins
  •  
mdhmi

Messages: 62
Karma: 0
Send a private message to this user

Try starting it with 'nohup'.

Mark

  •  
Iassen Hristov

Messages: 54
Karma: 0
Send a private message to this user
1. If you want to restart you can invoke with "restart", no need to "stop"
first, then "start"

2. Actually it is your ssh session that's blocked and KMS is started just
fine, correct?

Probably the issue is that the startup script invokes deamon (or
startproc), and they start KMS. You can always detach and not wait for the
cmd to finish.

e.g.
[root<_at_>localhost ~]# ssh remotehost /etc/init.d/keriomailserver start &


--On Friday, February 11, 2005 11:24 +0100 steinmuehlen_admins
<admins<_at_>steinmuehlen-brot.de> wrote:

>
> Hi,
> I'm writing a script in which I need to stop/start the
> keriomailserver-daemon via ssh. Stopping causes no problems
> but however I want to start the daemon (start/restart)
> my ssh-command manage it to start keriomailserver but
> fails to close the ssh-session. Locally I've no problems with
> starting, it's only if try to do it remotely.
>
> Remotely:
> [root<_at_>localhost ~]# ssh remotehost /etc/init.d/keriomailserver stop
> Shutting down Kerio MailServer: [ OK ]
> [root<_at_>localhost ~]# ssh remotehost /etc/init.d/keriomailserver start
> Starting Kerio MailServer: [ OK ]
> [..hangs up till I stop the KerioMailServer locally on remotehost]
>
> Locally:
> [root<_at_>remotehost ~]# /etc/init.d/keriomailserver stop
> Shutting down Kerio MailServer: [ OK ]
> [root<_at_>remotehost ~]# /etc/init.d/keriomailserver start
> Starting Kerio MailServer: [ OK ]
> [root<_at_>remotehost ~]#
>
> What could be the problem??
> thanxx
> -steinmuehlen_admins



  •  
Iassen Hristov

Messages: 54
Karma: 0
Send a private message to this user
BTW. If you start it with &, you can't expect that this will return you the
correct error code. It will return you success, merely because it invoked
the command, not because it actually succeeded starting KMS.

In this scenario you would need to use "status" (after a small sleep) to be
sure it was started.

[root<_at_>localhost ~]# ssh remotehost /etc/init.d/keriomailserver status
Status of Kerio MailServer: ..running

--On Friday, February 11, 2005 11:53 -0500 Iassen Hristov
<ih.ng<_at_>databrokers.net> wrote:

> 1. If you want to restart you can invoke with "restart", no need to "stop"
> first, then "start"
>
> 2. Actually it is your ssh session that's blocked and KMS is started just
> fine, correct?
>
> Probably the issue is that the startup script invokes deamon (or
> startproc), and they start KMS. You can always detach and not wait for the
> cmd to finish.
>
> e.g.
> [root<_at_>localhost ~]# ssh remotehost /etc/init.d/keriomailserver start
> &
>
>
> --On Friday, February 11, 2005 11:24 +0100 steinmuehlen_admins
> <admins<_at_>steinmuehlen-brot.de> wrote:
>
>>
>> Hi,
>> I'm writing a script in which I need to stop/start the
>> keriomailserver-daemon via ssh. Stopping causes no problems
>> but however I want to start the daemon (start/restart)
>> my ssh-command manage it to start keriomailserver but
>> fails to close the ssh-session. Locally I've no problems with
>> starting, it's only if try to do it remotely.
>>
>> Remotely:
>> [root<_at_>localhost ~]# ssh remotehost /etc/init.d/keriomailserver stop
>> Shutting down Kerio MailServer: [ OK ]
>> [root<_at_>localhost ~]# ssh remotehost /etc/init.d/keriomailserver start
>> Starting Kerio MailServer: [ OK ]
>> [..hangs up till I stop the KerioMailServer locally on remotehost]
>>
>> Locally:
>> [root<_at_>remotehost ~]# /etc/init.d/keriomailserver stop
>> Shutting down Kerio MailServer: [ OK ]
>> [root<_at_>remotehost ~]# /etc/init.d/keriomailserver start
>> Starting Kerio MailServer: [ OK ]
>> [root<_at_>remotehost ~]#
>>
>> What could be the problem??
>> thanxx
>> -steinmuehlen_admins





Previous Topic: Corrupted Item in KMS 6.0.7 and KOC 6.0.7
Next Topic: Major F**K UP - images show up in webmail
Goto Forum:
  


Disclaimer:
Kerio discussion forums are intended for open communication between forum members and may contain information and material posted by members which may be useful in learning about Kerio products. The discussion forums are not intended to provide technical support for any specific product. Any information implied or expressed in the discussion forums is that of the posting member. Kerio is in no way responsible for the information posted in the forums, or its accuracy. Kerio employees may participate in the discussions, but their postings do not represent an offical position of the company on any issues raised or discussed. Kerio reserves the right to monitor and maintain the forums to promote free and accurate exchange of information.

Current Time: Fri Nov 24 04:57:55 CET 2017

Total time taken to generate the page: 0.00366 seconds
.:: Contact :: Home ::.
Powered by: FUDforum 3.0.4.