Rsync and WinNT

OMeara, Randy randy.omeara at lmco.com
Sat Aug 11 02:07:00 EST 2001


John,

"rsync --daemon ..." is not compatible with the NT/2K
service manager because it forks().  This fork() creates a
running image under a different process ID than the original
invocation.  You'll have to add the --dont-fork patch (can't
recall where this is located at this time, but a search of
the archives should locate it).

In addition, there are some other issues with abortive socket
closure that may cause the sender's data to be incompletely
read by the receiver.  I made several posts on this subject
within the last few months.

That said, here are the general steps I use to get rsync
to run as a daemon under the NT/2K service manager using the
resource kit's srvany command and Cygwin.

Randy O'Meara

============================================================
Install Daemon (on server)

o Place:
Cygwin1.dll
Rsync.exe
Rsyncd.conf
Rsync-passwd.txt
Rsync-motd.txt
Rsync-secrets.txt
in Daemon server %SYSTEM32% directory.

o Install rsync as service with Resource Kit (instsrv/srvany).

C:\> instsrv Rsync "<your-RK-location>\srvany.exe"

o Modify Target server registry.

Run regedit32 and add the following keys and values (quotation marks ARE
IMPORTANT):

HKEY_LOCAL_MACHINE\
  SYSTEM\
    CurrentControlSet\
      Services\
        Rsync

Edit->Add Key->Key Name: Parameters
  Edit->Add Value->
    Value Name: AppDirectory, Value: "C:\winnt\system32"
  Edit->Add Value->
    Value Name: Application, Value: "C:\winnt\system32\rsync.exe"
  Edit->Add Value->
    Value Name: AppParameters, Value:
--verbose -stats --config="C:\winnt\system32\rsyncd.conf" --daemon
--dont-fork

o Use Control Panel->Services->Rsync to set Logon Account, Description,
Recovery, and Startup Type:

Logon As:               <pcvm admin account/password>
Description:            Manages Content Sync (rsync.samba.org)
Startup type:           Automatic
First Failure:          Restart the Service
Second Failure:         Restart the Service
Subsequent Failures:    Take No Action (could be notification/batch/trap
execution)
Reset fail count after: 0 days
Restart service after:  1 minutes

o Use Control Panel->Services to start the Rsync service
(Note that you should now view startup status and errors for rsync in the
Application Event Log unless you have specified a separate log file in
rsyncd.conf.) 




More information about the rsync mailing list