This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: cygrunsrv - services enters stopped state if underlying program exits or is killed - doesn't auto restart
- From: BGINFO4X <bginfo4x at kztsoftware dot com>
- To: cygwin at cygwin dot com
- Date: Wed, 28 Jan 2015 16:58:07 +0100
- Subject: Re: cygrunsrv - services enters stopped state if underlying program exits or is killed - doesn't auto restart
- Authentication-results: sourceware.org; auth=none
- References: <CAEF1h+Wghm86TybnaLMz9TdX5NUV15aNBAC1KZ1dKhUOVZ-_Qg at mail dot gmail dot com> <20150127090910 dot GF14265 at calimero dot vinschen dot de> <CAEF1h+XeFp_OCDNo-ok_EW=-1h94=mQRRz_ucZsix4wmow+WvQ at mail dot gmail dot com> <20150128101833 dot GX14265 at calimero dot vinschen dot de> <20150128115518 dot GZ14265 at calimero dot vinschen dot de> <CAO2ddnY+fk_CwGTZVyN7u6upZDxOrTbVjUVRCeGj8KBLEDPgig at mail dot gmail dot com> <20150128153705 dot GD14265 at calimero dot vinschen dot de>
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>:
>> > On Jan 28 11:18, Corinna Vinschen wrote:
>> >> On Jan 27 15:02, Cary Lewis wrote:
>> >> > On Tue, Jan 27, 2015 at 4:09 AM, Corinna Vinschen
>> >> > --neverexits works, but not if the program that cygrunsrv starts is
>> >> > stopped with a kill -9 signal. Perhaps the -9 signal propagates to the
>> >> > cygrunsrv.exe program?
>> >>
>> >> Hmm, yes. Cygrunsrv evaluates how the service process ended, and only
>> >> if it exited the neverexits logic comes into play. If it ended due to
>> >> a signal, it does nothing.
>> >>
>> >> This is unfortunate because it diminishes the usefulness of --neverexits.
>> >> 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.
- But if the administrator defines the autorestart option, the
service should be aware of it.
I hope you understand me.
Thanks .
>
>> So, --neverxits should be the default behaviour of cygrunsrv , so
>> --neverexists shouldn't exist as an option. :) But perhaps I'm wrong
>> and I don't understand completely the problem.
>
> I disagree. Automatic restart of services is not desired by default.
> It's a per-service, administrators choice.
>
>
> Corinna
>
> --
> Corinna Vinschen Please, send mails regarding Cygwin to
> Cygwin Maintainer cygwin AT cygwin DOT com
> Red Hat
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple