delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/12/05/17:04:23

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
X-Injected-Via-Gmane: http://gmane.org/
To: cygwin AT cygwin DOT com
From: Frank Seesink <frank AT mail DOT wvnet DOT edu>
Subject: Re: Cygrunsrv and spawned processes
Date: Fri, 05 Dec 2003 17:03:58 -0500
Lines: 60
Message-ID: <bqqvci$6ro$1@sea.gmane.org>
References: <bqnr0g$goo$1 AT sea DOT gmane DOT org> <Pine DOT GSO DOT 4 DOT 56 DOT 0312041518390 DOT 1463 AT slinky DOT cs DOT nyu DOT edu>
Mime-Version: 1.0
X-Complaints-To: usenet AT sea DOT gmane DOT org
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007
X-Accept-Language: en-us, en
In-Reply-To: <Pine.GSO.4.56.0312041518390.1463@slinky.cs.nyu.edu>

Igor,

Just to be clear, I have now spent the better part of the day working on
this, trying to fathom what's going on.  All I can say is, cygrunsrv is
doing _something_ differently when it comes to running Cygwin apps
compared to running them from the BASH shell.

I have now tested this every way from Sunday, and sure enough, if I run
Jabberd from BASH ('-D' is for debug mode):

	$ cd /usr/local/jabber
	$ ./jabberd/jabberd.exe -D

jabberd.exe fires up and spawns jabadns.exe.  When I hit CTRL-C, both
die gracefully.  When I use cygrunsrv, for example with the following:

cygrunsrv --install jabberd --path /usr/local/jabber/jabberd/jabberd
--args "-D" --chdir /usr/local/jabber --env
PATH=/usr/local/bin:/usr/bin:/bin --disp "JABBER Server" --user jabber
--termsig INT --shutdown

and then type

	net start jabberd

jabberd.exe fires up and spawns jabadns.exe.  However, when I type

	net stop jabberd

only jabberd.exe dies.  jabadns.exe remains behind.  Again, if I repeat
this process, I end up with zombie jabadns.exe processes, each consuming
a few MB RAM.

It's not so much the RAM usage as the inconsistency.  I would love to
have this working cleanly.

I've also run Jabberd in debug mode (it's quite verbose), and using the
example above, the debug logs are _identical_.  They show the same
signal (2) being received, and the exact same sequence of debug
messages.  So it's not like jabberd.exe is being killed off viciously
with a 'kill -9' type termination.  But for some reason, jabadns.exe is
not being terminated.

The only thing I can think to do now is add a bunch of environment vars
to the cygrunsrv line, but not sure what could possibly be needed by
cygrunsrv to kill a process.  Only thought I have left.


Igor Pechtchanski wrote:

...
> Frank,
> 
> When you press Ctrl-C in bash, the application gets SIGINT.  When you stop
> the service installed by cygrunsrv, by default the signal is SIGTERM,
> which the application may not handle gracefully.  Try the '--termsig INT'
> ('-s 2') cygrunsrv option.
> 	Igor




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