delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/11/20/11:58:30

X-Spam-Check-By: sourceware.org
Message-ID: <4380AB2E.7010302@t-online.de>
Date: Sun, 20 Nov 2005 17:58:22 +0100
From: Christian Franke <Christian DOT Franke AT t-online DOT de>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b) Gecko/20050217
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Suggest cygrunsrv extension: --pidfile option (patch included)
X-ID: XVo5u8ZOged6llu5pnuzlFbbTvhAK87xkw6SAmiEoz2Nc8+gzfbIUA
X-TOI-MSGID: 1988c4b7-3035-45e9-bcce-0c2090b1a557
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

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/

- Raw text -


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