reload ssh configuration without stopping and starting the service?

Corinna Vinschen corinna-cygwin@cygwin.com
Sun Dec 7 09:36:00 GMT 2014


On Dec  7 07:45, Marilo wrote:
> I know linux has ways to reload configuration files without restarting a service.
> 
> Is there a way with cygwin's sshd to reload the configuration files without stopping and starting it.
> 
> I know of net start sshd, net stop sshd, and I have checked cygrunsrv  
> http://web.mit.edu/cygwin/cygwin_v1.3.2/usr/doc/Cygwin/cygrunsrv.README   I see options for start stop install and remove. 
> 
> I don't see any way to reload configuration.

The concept of reloading configuration is not supported on the Windows
service level.  However, something like `systemctl reload' on Linux is
just a layer on top of the "real thing", too.  See the sshd.service
configuration file on Fedora:

  $ grep -i reload /usr/lib/systemd/system/sshd.service
  ExecReload=/bin/kill -HUP $MAINPID

So that's what really happens, systemctl calls kill -HUP on the sshd
master process.  That's what you can do as well on Cygwin, as long
as you're running a shell with admin privileges, for instance:

  $ ps -e | grep -E 'sshd|cygrunsrv'
  3116    4292    3116       1820  ?  1049583 10:29:51 /usr/sbin/sshd
  4292    3912    4292       4536  ?  1049583 10:29:34 /usr/sbin/sshd
  3912       1    3912       3912  ?  1049583 10:29:34 /usr/bin/cygrunsrv

As you can see, the sshd process started by cygrunsrv has the pid 4292,
so

  $ kill -HUP 4292

as admin should do the trick.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20141207/b5475c50/attachment.sig>


More information about the Cygwin mailing list