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 X-Injected-Via-Gmane: http://gmane.org/ To: cygwin AT cygwin DOT com From: Frank Seesink Subject: Re: Cygrunsrv and spawned processes Date: Fri, 05 Dec 2003 17:03:58 -0500 Lines: 60 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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: 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/