This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cygrunsrv - services enters stopped state if underlying program exits or is killed - doesn't auto restart


On Jan 28 16:58, BGINFO4X wrote:
> 2015-01-28 16:37 GMT+01:00 Corinna Vinschen <corinna-cygwin@cygwin.com>:
> > On Jan 28 15:42, Kizito Porta Balanyà wrote:
> >> 2015-01-28 12:55 GMT+01:00 Corinna Vinschen <corinna-cygwin@cygwin.com>:
> >> >> I could patch cygrunsrv to do this:
> >> >>
> >> >>   If the service exited due to a signal, and if that signal is not the
> >> >>   defined termination or shutdown signal (default SIGTERM for both),
> >> >>   and if --neverexits has been defined, then performas the neverexits
> >> >>   action.
> >> >>
> >> >> Does that sound ok?
> >>
> >> I would say that this should be the default behavior:
> >>
> >> If the signal is SIGTERM and the service is configured to restart the
> >> program, then restart the program.
> >
> > No.  SIGTERM (rather: the defined termination signal) is send
> > explicitely from cygrunsrv to the service process to stop the service.
> > If this is handled like --neverexits, it would be impossible to stop a
> > service manually.  The neverexits case should only cover the cases of
> > exiting as a result of an unexpected signal (SIGSEGV, etc).
> 
> I explained it bad. English is not my "default" language. :)
> 
> What I mean is:
> 
>    - If the automatic restart of the service is defined by the
> administrator, the service should restart by default.
>    - So, It shouldn't be necessary to register the service with --neverexits.

Ok, I get your drift.  You're right, but this is a bit more complicated
than the simple tweak I applied to cygrunsrv today.

There's certainly room for improvement in cygrunsrv.  It's showing its
age, most of the code is unchanged since Cygwin still supported NT4.
It's not using the QueryServiceConfig2/ChangeServiceConfig2 functions at
all.

I wouldn't be too unhappy about a developer having fun to improve
cygrunsrv...


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: pgpd96P2O5OmK.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]