X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; q=dns; s= default; b=ahYP7Q8Jf9Kl0mMOEgUVd1WhBCQKAEb7rQ/XOeFErQdJQi7FsoQSM /edN3nQeM7oBfAU45GhBxiZaJmA67hlZHKxyHIN6jxPXFi4DJRuqhiU2LH1kCdc8 mXPzba0tUceIy9ozuHgCAcV98yKDAnJJjT/uJEO9yaTQnpap/49mtI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; s=default; bh=jKw6vAhTZn78CA96MdT4Ifvr8HY=; b=M8ZC3uisnPI7n9sCzycQKnYQqKMZ WwH9ZGkMEEhtqdhI4Uk8mf1ej6HFCjbK6y7kWI3rQ7Dv2SUzBCFctIH9tjYF4/vt g/12UIGBCDFeWXhAukgkIm+x3rRx86hjRZde9s2yzXC0eBieTiLm2M8TsRVN+KOw SJsIMyOlK4E+1J0= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-4.6 required=5.0 tests=AWL,BAYES_50 autolearn=ham version=3.3.2 X-HELO: calimero.vinschen.de Date: Wed, 28 Jan 2015 21:43:59 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: cygrunsrv - services enters stopped state if underlying program exits or is killed - doesn't auto restart Message-ID: <20150128204359.GH14265@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <20150127090910 DOT GF14265 AT calimero DOT vinschen DOT de> <20150128101833 DOT GX14265 AT calimero DOT vinschen DOT de> <20150128115518 DOT GZ14265 AT calimero DOT vinschen DOT de> <20150128153705 DOT GD14265 AT calimero DOT vinschen DOT de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="juLeBF1Sbpsr6d7u" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) --juLeBF1Sbpsr6d7u Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Jan 28 16:58, BGINFO4X wrote: > 2015-01-28 16:37 GMT+01:00 Corinna Vinschen : > > On Jan 28 15:42, Kizito Porta Balany=C3=A0 wrote: > >> 2015-01-28 12:55 GMT+01:00 Corinna Vinschen : > >> >> 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 neverexi= ts > >> >> 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). >=20 > I explained it bad. English is not my "default" language. :) >=20 > What I mean is: >=20 > - 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 --neverex= its. 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 --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --juLeBF1Sbpsr6d7u Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUyUoPAAoJEPU2Bp2uRE+gG+QP/2V58SJzbEv66gwXOgOYd5iN K1v/qYJNiSnjuCK7kNEhVSVE3nPG+vOzydoScOJgu/MRiJVMzyLqFASqdjArPqzs aQPurvutNKyUITcHMpawvo8jYylPvWMuxlkCeRHpO85/AS1VVN8C69Jt9734iXNU A7qYyQNn2PhiR3uspSjKrsCIFwLokzJsev5xBcve3ew+coN9Jxm47uFpLKljoZna V60Yr0iiA1P1zvhXqQ0Nfy8FOdFrgB5VlH0jLkNitaZyMEiua4yq7NwjgbiwmeUJ 6JPoL5TKGGnYh5RyDH7hQB6rTN9SRukPFmxorwqn01HUnz1tydIrORdLgWeTagcg P4Lh5DCbVv3O0JQJacJxigzdDNcjImgJKMQ9t/aZZVPH8NJucME8rpLstYeI1CuQ 5PrWGWlX6g3a7XVUPc1QQW9Gsb/l2ish0iGznIVzdVjt/79QnT/DcTQWL4lPMFuG ZAUCAtfQ6gEbA5KE3sTvV/6dneAbQcX+Ur46466UBv5yxcnLm2DoHDWQH+hOMI5E yOi314/sfCX4qdmtsyMnx9EL9Vuoo8ikgUv3uLFbDBs1oJAks2b/N6TTiLjOI8n6 Se0UXJYkyf0AGaOMYD+8PW3+xvWlHuIwll8OSaxoSsEvStkI3xPCuuh9b7zsTs/r EA4FV//3NIFxjpxdeSuU =bMDO -----END PGP SIGNATURE----- --juLeBF1Sbpsr6d7u--