unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Carlo Zancanaro <carlo@zancanaro.id.au>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: Shepherd does not recycle zombie processes
Date: Mon, 07 Nov 2016 22:35:41 +1100	[thread overview]
Message-ID: <87a8db5xpu.fsf@zancanaro.id.au> (raw)
In-Reply-To: <87eg2ny8ka.fsf@gnu.org>


[-- Attachment #1.1: Type: text/plain, Size: 1312 bytes --]


Hey Ludo!

On Mon, Nov 07 2016, Ludovic Courtès wrote
> Could it be that you invoke the ‘daemonize’ action after 
> respawnable processes have been started?  The manual has this 
> caveat (info "(shepherd) The root and unknown services"):
>
>   ‘daemonize’ 
>        Fork and go into the background.  This should be called 
>        before respawnable services are started, as otherwise we 
>        would not get the ‘SIGCHLD’ signals when they terminate.

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 
other way that I was supposed to do that?

With that line in place, Shepherd will leave behind a process 
every time I stop/start a service.

I have attached an example init.scm that does this for me. If I 
start: 

    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 
Shepherd process. (If the service were respawnable then it also 
would fail to restart the service.)

I assume this behaviour is wrong, but if I'm doing something wrong 
then please let me know what it is.

Carlo


[-- Attachment #1.2: init.scm --]
[-- Type: application/octet-stream, Size: 221 bytes --]

(action 'shepherd 'daemonize)

(define sleep
  (make <service>
    #:provides '(sleep)
    #:start (make-forkexec-constructor '("sleep" "100"))
    #:stop (make-kill-destructor)))

(register-services sleep)
(start sleep)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

  reply	other threads:[~2016-11-07 12:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-05 22:22 Shepherd does not recycle zombie processes Dale Mellor
     [not found] ` <CAFAGzb_7ryGVJp1zgjYuT_czaS2o5RLMtfkEHGf9m3z=tXJ3mw@mail.gmail.com>
     [not found]   ` <CAFAGzb99gGz-U-DZTaVZyk1OfMOZG_z8JxiWu3JnfnmHAYgcnQ@mail.gmail.com>
2016-11-06 21:21     ` Carlo Zancanaro
2016-11-07  8:53       ` Ludovic Courtès
2016-11-07 11:35         ` Carlo Zancanaro [this message]
2016-11-09 14:49           ` Ludovic Courtès
2016-11-10 13:15             ` Carlo Zancanaro
2016-11-24  8:27         ` Dale Mellor
2016-11-24 13:22           ` Ludovic Courtès
2016-11-06 22:09 ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a8db5xpu.fsf@zancanaro.id.au \
    --to=carlo@zancanaro.id.au \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).