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]

[SOLVED] Re: how to create a syslog-ng pidfile


"Igor Peshansky" wrote:
> For some applications that are unable to work in the foreground, cygrunsrv
> contains the -x option, which makes it check the pid file instead of
> waiting for the child process.  That way the child can fork and detach,
> and cygrunsrv can still control it via the pid in that file.  But for that
> to work, the child program now needs to run in detached state.

Thank you for explaining this.  Especially it is good to know that cygrunsrv
can still control the child process, so the Windows service should still 
behave.

> Try specifying the -x option to cygrunsrv, pointing it to the syslog-ng
> pid file (that you specify via the -p option to syslog-ng), and then *not*
> specifying the -F option to syslog-ng.

I had not considered to combine the options! Yes, this worked:

$ cygrunsrv -R syslog-ng

$ cygrunsrv -I syslog-ng -d "CYGWIN syslog-ng" -p /usr/sbin/syslog-ng \
  -a "-p /var/run/syslog-ng.pid" -x /var/run/syslog-ng.pid

The syslog-ng code creates the pidfile 0600, and is running as SYSTEM (by 
default).
I am finding Igor's SYSTEM-owned shell shortcut
http://article.gmane.org/gmane.os.cygwin/52716 very helpful for
working on the next steps of my log rotation scheme. 




--
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]