[Box Backup] Cygwin and Windows Services

Per Thomsen boxbackup@fluffy.co.uk
Fri, 01 Oct 2004 01:51:56 -0700


I have been spending a lot of time on trying to get the cygwin 
executable to run as a service on Windows.

I thought that my findings might be of use to others.

First off, I used the cygrunsrv utility to install and manage the 
service, but I think instsrv/srvany will work just as well.

Before starting the service, make sure that other users can write to 
files in the /var/bbackupd directory (or whatever your DataDirectory 
is). If you have tested bbackupd as yourself, you will need to either 
delete the files there, or chmod them to be writable by others. You 
might have the same problem with the /var/run directory. I think it's 
pretty safe to delete bbackupd.pid (and bbackupd.sock, if you have it 
there).

The commands below assume a default installation (/usr/local/bin, 
/etc/box, /var/bbackupd, etc.).

To install the service:

cygrunsrv -I boxbackup -p /usr/local/bin/bbackupd.exe -a 
"/etc/box/bbackupd.conf SINGLEPROCESS"

The '-a "/etc/.....' is not strictly necessary, but it does make it 
easier to manage the service from within the Windows Service manager. 
Otherwise you have to find bbackupd.exe in the Process manager and kill 
it there, when you want to stop it.

To start the service:

cygrunsrv -S boxbackup

Now, just make sure that bbackupd starts after a reboot. Reboot, and 
check the logs on the bbstored server, for connections from the rebooted 
machine.

If you run into problems, /usr/share/docs/Cygwin/cygrunsrv.README is a 
great source of information.

I would like to maybe add an edited version of this information into the 
Documentation directory in the release (or even on the web site), so 
Windows users won't have to go through the same travails that I did.

Also, it would be useful for a newbie bbackupd user to have info about 
Cygwin: How to get it; what cygwin packages to install (both for 
building the executables and for deploying), etc.

I will put that information together soon. If any other information is 
needed, let me know, and I'll see if I can dig it up.

Thanks,
Per

-- 
Per Reedtz Thomsen | The Reedtz Corporation | F: 209 883 4119
V: 209 883 4102    |   pthomsen@reedtz.com  | C: 415 425 4025
GPG ID: 1209784F   |  Yahoo! Chat: pthomsen | AIM: pthomsen