Suggest cygrunsrv extension: --pidfile option (patch included)

Christian Franke Christian.Franke@t-online.de
Mon Nov 21 15:31:00 GMT 2005


Hi,

when porting new daemons to Cygwin, it is necessary to add a Cygwin 
specific option to prevent fork()ing.
Otherwise, running as service via cygrunsrv would not be possible.

For daemons which are able to write /var/run/daemon.pid files, this pid 
can be used to track the daemon.

Suggest adding a --pidfile option to cygrunsrv for this purpose:

  cygrunsrv -I syslogd --pidfile /var/run/syslog.pid -p /usr/sbin/syslogd

(Yes, "-a -D" is missing)


For a working prototype, try { this->patch->here; }

http://franke.dvrdns.org/cygwin/cygrunsrv-pidfile-patch.txt

Note that the patch contains a new module with a waitanypid() function.
This was necessary (tell me if I missed something) because waitpid() 
cannot wait for child's childs.

Thanks for any comment

Christian


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list