X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: "Bryan D. Thomas" Subject: [SOLVED] Re: how to create a syslog-ng pidfile Date: Tue, 4 Apr 2006 21:46:38 -0700 Lines: 29 Message-ID: References: <20060402194047 DOT 15398 DOT qmail AT web31307 DOT mail DOT mud DOT yahoo DOT com> X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com "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/