delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/04/05/00:47:15

X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: "Bryan D. Thomas" <cinder_bdt AT yahoo DOT com>
Subject: [SOLVED] Re: how to create a syslog-ng pidfile
Date: Tue, 4 Apr 2006 21:46:38 -0700
Lines: 29
Message-ID: <e0vi3k$fmd$1@sea.gmane.org>
References: <20060402194047 DOT 15398 DOT qmail AT web31307 DOT mail DOT mud DOT yahoo DOT com> <e0sqm8$25j$1 AT sea DOT gmane DOT org> <Pine DOT GSO DOT 4 DOT 63 DOT 0604040007330 DOT 14091 AT access1 DOT cims DOT nyu DOT edu>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019