How to setup Rsync as an NT Service

BOLLERUD,CHRIS W (HP-MountainView,ex1) chris_bollerud at hp.com
Thu Nov 22 11:41:12 EST 2001


The pre-compiled version of Rsync does not offer a way to turn off forking
in daemon mode.  When an NT Service tries to stop or pause a service it uses
the same PID that was used to start the program.  Because the program forks
it creates a new PID and the Service Control Panel is no longer able to stop
the Service.  Also, if the Service was started under the System account it
is not possible to stop the program using End Task.  This leaves restarting
the computer as the only option to stop the service. (A Microsoft Quirk)  By
adding the no-fork option, the service works as any other NT Service.  If
there is another way to do this I would be very interested in learning about
it.

Thanks for the information on the cygrunsrv program.  I was not aware that
this was an option.

Chris Bollerud

-----Original Message-----
From: Lapo Luchini [mailto:lapo at lapo.it]
Sent: Wednesday, November 21, 2001 4:19 PM
To: rsync at lists.samba.org
Cc: BOLLERUD,CHRIS W (HP-MountainView,ex1)
Subject: Re: How to setup Rsync as an NT Service


> To create the install package described here you will need to obtain a
copy of the NT Server or Windows 2000 Server Resource Kit. There are many
sources for these utilities. Perhaps the easiest is to get the book and CD
from any technical bookstore or online at http://www.amazon.com for as low
as $35. Search for:
> The NT Server 4.0 Resource Kit Supplement 4
> Windows 2000 Server Resource Kit
>

I suggest to add a paragraph to use "cygrunsrv" instead of "srvany" as any
CygWin user can download it easily =)
(as in: cygrunsrv -I "rsyncd" -p /usr/bin/rsync -a '--config /etc/rsync.conf
--daemon')

BTW: whats' wrong in a plain&easy CygWin's precompiled rsync? (I'm
interested in
comments&suggestions as I'm the mantainer of that package... ^_^)

--
Lapo 'Raist' Luchini
lapo at lapo.it (PGP & X.509 keys available)
http://www.lapo.it (ICQ UIN: 529796)





More information about the rsync mailing list