GNU bug report logs - #43643
start shepherd when a previous instance was killed by kill -9

Previous Next

Package: guix;

Reported by: gfleury <gfleury <at> disroot.org>

Date: Sun, 27 Sep 2020 08:01:02 UTC

Severity: normal

Full log


Message #8 received at 43643 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: gfleury <gfleury <at> disroot.org>
Cc: 43643 <at> debbugs.gnu.org
Subject: Re: bug#43643: start shepherd when a previous instance was killed
 by kill -9
Date: Sun, 27 Sep 2020 16:19:06 +0200
[Message part 1 (text/plain, inline)]
Hello,

On Sun, 27 Sep 2020 10:00:03 +0200
gfleury <gfleury <at> disroot.org> wrote:

> it throws a error:
> ---------------------------------------------------------
> 3 (primitive-load "/home/gfleury/prod/shepherd/./shepherd")
> In shepherd.scm:
>     56:14  2 (main . _)
>      49:6  1 (open-server-socket _)
> In unknown file:
>            0 (bind #<input-output: socket 16> #(1 "/run/user/1000?") #)
> 
> ERROR: In procedure bind:
> In procedure bind: Address already in use
> ---------------------------------------------------------
> 
> something like this patch can fix it.

Please don't do it that way.

Shepherd has to be able to ascertain that it is not running yet before
starting yet another instance in parallel.

I don't like PID and socket files either--but it's just what we have
available.

Maybe find out who is at the other side of the socket
(connect and then use getpeername on the socket or something ?
 maybe even just trying to connect fails, which would be good for this).

I think UNIX domain sockets are made in a way that it doesn't matter
whether the server or the client connects first, so even that would
probably not be reliable.

So maybe just live with having to remove the socket file yourself.

I'm open to other suggestions that are safe that accomplish the same goal.
[Message part 2 (application/pgp-signature, inline)]

This bug report was last modified 4 years and 267 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.