From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id ADO9KIKqcF+1VwAA0tVLHw (envelope-from ) for ; Sun, 27 Sep 2020 15:06:42 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id oDitJIKqcF+LQgAAB5/wlQ (envelope-from ) for ; Sun, 27 Sep 2020 15:06:42 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 883B39402AA for ; Sun, 27 Sep 2020 15:06:41 +0000 (UTC) Received: from localhost ([::1]:40528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMXXE-0006FG-WA for larch@yhetil.org; Sun, 27 Sep 2020 10:20:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44280) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMXX0-0006Es-U9 for bug-guix@gnu.org; Sun, 27 Sep 2020 10:20:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38553) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kMXX0-0002oW-Kc for bug-guix@gnu.org; Sun, 27 Sep 2020 10:20:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kMXX0-00059R-Ee for bug-guix@gnu.org; Sun, 27 Sep 2020 10:20:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#43643: start shepherd when a previous instance was killed by kill -9 Resent-From: Danny Milosavljevic Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 27 Sep 2020 14:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43643 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: gfleury Received: via spool by 43643-submit@debbugs.gnu.org id=B43643.160121637719764 (code B ref 43643); Sun, 27 Sep 2020 14:20:02 +0000 Received: (at 43643) by debbugs.gnu.org; 27 Sep 2020 14:19:37 +0000 Received: from localhost ([127.0.0.1]:50099 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMXWa-00058i-Tm for submit@debbugs.gnu.org; Sun, 27 Sep 2020 10:19:37 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:38552) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMXWY-00058Z-QX for 43643@debbugs.gnu.org; Sun, 27 Sep 2020 10:19:35 -0400 Received: from localhost (80-110-126-103.cgn.dynamic.surfer.at [80.110.126.103]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 5A3EA33681E5; Sun, 27 Sep 2020 16:19:33 +0200 (CEST) Date: Sun, 27 Sep 2020 16:19:06 +0200 From: Danny Milosavljevic Message-ID: <20200927161906.399fe259@scratchpost.org> In-Reply-To: <87k0wfejjw.fsf@disroot.org> References: <87k0wfejjw.fsf@disroot.org> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/0noLJoh7SFr=l1pg4veMw3B"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.7 (-) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 43643@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: -1.11 X-TUID: zpIzXyxEEgXr --Sig_/0noLJoh7SFr=l1pg4veMw3B Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hello, On Sun, 27 Sep 2020 10:00:03 +0200 gfleury 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 # #(1 "/run/user/1000?") #) >=20 > ERROR: In procedure bind: > In procedure bind: Address already in use > --------------------------------------------------------- >=20 > 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. --Sig_/0noLJoh7SFr=l1pg4veMw3B Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl9wn1oACgkQ5xo1VCww uqXoCwgAoMcxwXRxKGV1diFf7Ii5eJ7vz8PnZbVFaPpCcGHPlF6v7JuYJUOnn/L0 wBvXIbZhefMXdlEk6pQz8RrLvT9A1HFSyPBSCB1mVHw7ln0xJaxVKa9mPeALh4X/ m1voIDSPSC6iAMFgXAUai7Q8DDO9HnGYSWZfJw2icTtKGJ5b7VmwosGLUhZrIDR9 jCH0duwxRjZppkppkkDgXpVYAqs4WVq47jzUr1C0xA0u0iAkVP9tEYrd7MhFQG9S pjlkOa+4L/ndFDcGwEQX+phF+hL5i+eFjD/OyszVsGJuw9xiGmiAvhAGaYbiLVjp bj+K0C2w791Mn18yDPwP3w/zkmOhWQ== =Cc66 -----END PGP SIGNATURE----- --Sig_/0noLJoh7SFr=l1pg4veMw3B--