Magnus Hagander mha
Sun Aug 7 17:04:54 PDT 2005
Hi,


here is a first attempt at win32 service integration. It uses option 3
per the previous mail - this was actually also the easiest to do, even
easier than option 1. 
It will look for a list of config files in the Engine subkey of the
service configuration parameters in the registry - one entry per file,
the name of the value is ignored, just the filename is read. It will
launch a slon.exe for each of these specifying the config file. If one
of the processes die while the service is running, it will be restarted.
When the service is shut down, all slon.exe processes are killed hard.

It also contains eventlog integration code, since you can't log to
stdout/stderr whlie running as a service. It's only activated when
started as a service (set using a global variable). We still write the
log to stdout when running as a service, in case extra debugging is
needed.

Finally, it fixes a bug in the logging code which failed to initialize
outbuf to the empty string if log_timestamp and log_pid were both off.

The files "win32service.c|h" go in the port directory.

//Magnus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: win32service.c
Type: application/octet-stream
Size: 10128 bytes
Desc: win32service.c
Url : http://gborg.postgresql.org/pipermail/slony1-general/attachments/20050807/ef098802/win32service.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: win32service.h
Type: application/octet-stream
Size: 393 bytes
Desc: win32service.h
Url : http://gborg.postgresql.org/pipermail/slony1-general/attachments/20050807/ef098802/win32service-0001.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: slon_win32_service.patch
Type: application/octet-stream
Size: 2865 bytes
Desc: slon_win32_service.patch
Url : http://gborg.postgresql.org/pipermail/slony1-general/attachments/20050807/ef098802/slon_win32_service.obj


More information about the Slony1-general mailing list