From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carlo Zancanaro Subject: Re: Shepherd does not recycle zombie processes Date: Mon, 07 Nov 2016 22:35:41 +1100 Message-ID: <87a8db5xpu.fsf@zancanaro.id.au> References: <1478384577.31924.2.camel@rdmp.org> <87eg2ny8ka.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36612) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c3jPj-0005Xr-TT for guix-devel@gnu.org; Mon, 07 Nov 2016 07:52:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c3jPf-000385-12 for guix-devel@gnu.org; Mon, 07 Nov 2016 07:52:39 -0500 In-reply-to: <87eg2ny8ka.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Hey Ludo! On Mon, Nov 07 2016, Ludovic Court=C3=A8s wrote > Could it be that you invoke the =E2=80=98daemonize=E2=80=99 action after= =20 > respawnable processes have been started? The manual has this=20 > caveat (info "(shepherd) The root and unknown services"): > > =E2=80=98daemonize=E2=80=99=20 > Fork and go into the background. This should be called=20 > before respawnable services are started, as otherwise we=20 > would not get the =E2=80=98SIGCHLD=E2=80=99 signals when they term= inate. Yeah, I saw that note in the documentation. I used to have (action 'shepherd 'daemonize) as the first line in ~/.config/shepherd/init.scm. Is there some=20 other way that I was supposed to do that? With that line in place, Shepherd will leave behind a process=20 every time I stop/start a service. I have attached an example init.scm that does this for me. If I=20 start:=20 shepherd -c init.scm and then run: herd stop sleep herd start sleep herd stop sleep herd start sleep herd stop sleep then I will have three zombie sleep processes underneath my=20 Shepherd process. (If the service were respawnable then it also=20 would fail to restart the service.) I assume this behaviour is wrong, but if I'm doing something wrong=20 then please let me know what it is. Carlo --=-=-= Content-Type: application/octet-stream Content-Disposition: attachment; filename=init.scm Content-Transfer-Encoding: base64 KGFjdGlvbiAnc2hlcGhlcmQgJ2RhZW1vbml6ZSkKCihkZWZpbmUgc2xlZXAKICAobWFrZSA8c2Vy dmljZT4KICAgICM6cHJvdmlkZXMgJyhzbGVlcCkKICAgICM6c3RhcnQgKG1ha2UtZm9ya2V4ZWMt Y29uc3RydWN0b3IgJygic2xlZXAiICIxMDAiKSkKICAgICM6c3RvcCAobWFrZS1raWxsLWRlc3Ry dWN0b3IpKSkKCihyZWdpc3Rlci1zZXJ2aWNlcyBzbGVlcCkKKHN0YXJ0IHNsZWVwKQo= --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJYIGcNAAoJEMBVJci7YG0rLroH/0XS7voX8zvMoUt7ZJh7uPVP Me4y1Wo8H1x9ipez1g2jI13UIj91yKcSwzmS7OmprkcpAUEMf0E+nAoIQeSWxzFe K3f+hQ9vE+dfGc58uL5zbVqd+iJX7ntZOmwgFndE17NGWLx2YqoCxbugR/QqaLgb Z7CAFdpyC70yBCS7IWQF+1Lsuiez8hb1anHvQ7Lh2emFB550+Z38Ufr7wYsoTXDi ChACMvGg1UrhZJaz/CBtdNvGum78R0ahKW2hZeKhWvhFnInJrr38rw2e0NUW0jOT vRvneV0lCQzGu8O285XXPsguNB7pMGiZTBG0aDlK5dcDxZZChUeqBJFU0+Pq3tw= =BRxK -----END PGP SIGNATURE----- --==-=-=--