This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]