all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: Attila Lendvai <attila@lendvai.name>, 53580@debbugs.gnu.org
Subject: bug#53580: /var/run/shepherd/socket is missing on an otherwise functional system
Date: Tue, 01 Feb 2022 19:28:03 +0000	[thread overview]
Message-ID: <04e30e30595ba96786a78c1dbc1768636b5c71e9.camel@telenet.be> (raw)
In-Reply-To: <BNbiqHqu6jP5GgHIZ0AMLhBo1O4baZdy21bgcUmGS1GqxOKnCHG_5uzzedymxwQsSFtL5gSw9Bppr1FXPoHDqIiKfe5K720Wb9Jivbsr_z4=@lendvai.name>

[-- Attachment #1: Type: text/plain, Size: 1477 bytes --]

Attila Lendvai schreef op do 27-01-2022 om 11:32 [+0000]:
> (define (call-with-server-socket file-name proc)
>   "Call PROC, passing it a listening socket at FILE-NAME and deleting the
> socket file at FILE-NAME upon exit of PROC.  Return the values of PROC."
>   (let ((sock (open-server-socket file-name)))
>     (dynamic-wind
>       noop
>       (lambda () (proc sock))
>       (lambda ()
>         (close sock)
>         (catch-system-error (delete-file file-name))))))
> ```
> 
> maybe this is caused by some call/cc magic that causes an unwind that deletes the file, but then continues?

Shepherd doesn't use call/cc anywhere.  However, it does use
_delimited_ continuations, even though only through let/ec and
'guard'/'catch'/...  More generally, call/cc is typically unused in
(Guile) Scheme code, and call-with-prompt / abort-to-prompt / shift /
reset / % are used instead.

My guess what happens: the start code of a shepherd service
fails between 'fork' and 'exec', with an exception.  The exception
isn't caught (or is caught and reraised), so the 'out' guard of the
'dynamic-wind' is entered and the file representing the socket is
deleted.

If that's indeed the case, it might be a good idea to install
some exception handlers in fork+exec-command and friends (including
make-forkexec-constructor/container), to make shepherd more robust
w.r.t. services failing to start.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

  parent reply	other threads:[~2022-02-02  0:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27 11:32 bug#53580: /var/run/shepherd/socket is missing on an otherwise functional system Attila Lendvai
2022-01-27 12:13 ` bug#53580: (No Subject) Attila Lendvai
2022-02-01 11:06   ` Efraim Flashner
2022-02-01 19:28 ` Maxime Devos [this message]
2022-04-04  7:15   ` bug#53580: /var/run/shepherd/socket is missing on an otherwise functional system Attila Lendvai
2023-05-18 20:12 ` Ludovic Courtès
2023-05-27 10:33 ` bug#53580: shepherd's architecture Attila Lendvai
2023-05-28 22:23   ` Attila Lendvai
2023-05-29 14:46     ` bug#53580: " Brian Cully via Bug reports for GNU Guix
2023-05-29 15:18       ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
2023-06-06 15:16   ` bug#53580: " Ludovic Courtès
2023-06-08 12:54     ` Csepp
2023-06-08 20:56     ` Attila Lendvai
2023-06-11 14:16       ` bug#53580: /var/run/shepherd/socket is missing on an otherwise functional system Ludovic Courtès
2023-06-11 14:18 ` 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

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

  git send-email \
    --in-reply-to=04e30e30595ba96786a78c1dbc1768636b5c71e9.camel@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=53580@debbugs.gnu.org \
    --cc=attila@lendvai.name \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.