This is the mail archive of the
cygwin-developers@cygwin.com
mailing list for the Cygwin project.
Re: 1.5.8 release announcement
On Mar 17 09:22, Pierre A. Humblet wrote:
>
>
> Corinna Vinschen wrote:
> >
> > On Mar 16 21:49, Pierre A. Humblet wrote:
>
> > > It's kind of strange to log and return an error when the signal that
> > > caused the exit was generated by cygrunsrv itself (my 2 cents).
> >
> > My 2ct as well. I've changed cygrunsrv to log the signal only if it
> > wasn't the signal raised by cygrunsrv itself. It's already uploaded.
> >
> > HTH,
> > Corinna
>
> Thanks Corinna. It's still not as good as in January. Now there is
> only an information entry in the log at start, nothing at stop
> (there used to be an information entry at stop).
Sic. Please try the below patch to cygrunsrv. It prints a stop
message and shuts down correctly if the service exited as a result
of cygrunsrv's signal. If that's fine, I'll upload a new cygrunsrv
package.
Corinna
Index: cygrunsrv.cc
===================================================================
RCS file: /cvs/cygwin-apps/cygrunsrv/cygrunsrv.cc,v
retrieving revision 1.20
diff -p -u -r1.20 cygrunsrv.cc
--- cygrunsrv.cc 17 Mar 2004 09:13:09 -0000 1.20
+++ cygrunsrv.cc 17 Mar 2004 15:37:32 -0000
@@ -1193,7 +1193,7 @@ service_main (DWORD argc, LPSTR *argv)
report_service_status ();
- char exitval = -1;
+ char exitval = 1;
int status = 1;
if (!waitpid (server_pid, &status, WNOHANG))
{
@@ -1248,6 +1248,13 @@ service_main (DWORD argc, LPSTR *argv)
if (!termsig_sent || WTERMSIG (status) != termsig)
syslog (LOG_ERR, "service `%s' failed: signal %d raised",
svcname, WTERMSIG (status));
+ else
+ {
+ syslog (LOG_INFO, "`%s' service stopped, signal %d received",
+ svcname, WTERMSIG (status));
+ set_service_status (SERVICE_STOPPED);
+ exitval = 0;
+ }
}
else
syslog (LOG_ERR, "`%s' service stopped for an unknown reason",
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Developer mailto:cygwin@cygwin.com
Red Hat, Inc.