unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Danny Milosavljevic <dannym@scratchpost.org>
To: gfleury <gfleury@disroot.org>
Cc: 43643@debbugs.gnu.org
Subject: bug#43643: start shepherd when a previous instance was killed by kill -9
Date: Sun, 27 Sep 2020 16:19:06 +0200	[thread overview]
Message-ID: <20200927161906.399fe259@scratchpost.org> (raw)
In-Reply-To: <87k0wfejjw.fsf@disroot.org>

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

Hello,

On Sun, 27 Sep 2020 10:00:03 +0200
gfleury <gfleury@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.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-09-27 15:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-27  8:00 bug#43643: start shepherd when a previous instance was killed by kill -9 gfleury
2020-09-27 14:19 ` Danny Milosavljevic [this message]
2020-09-27 18:09 ` gfleury

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=20200927161906.399fe259@scratchpost.org \
    --to=dannym@scratchpost.org \
    --cc=43643@debbugs.gnu.org \
    --cc=gfleury@disroot.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).