This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Suggest cygrunsrv extension: --pidfile option (patch included)
- From: Christian Franke <Christian dot Franke at t-online dot de>
- To: cygwin at cygwin dot com
- Date: Sun, 20 Nov 2005 17:58:22 +0100
- Subject: Suggest cygrunsrv extension: --pidfile option (patch included)
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/