From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id mMSaITroSmTyHwEASxT56A (envelope-from ) for ; Thu, 27 Apr 2023 23:25:14 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id SBtsITroSmRq1QAAauVa8A (envelope-from ) for ; Thu, 27 Apr 2023 23:25:14 +0200 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 AC78A3EBB3 for ; Thu, 27 Apr 2023 23:25:13 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ps96u-0007rI-Bi; Thu, 27 Apr 2023 17:25:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ps96t-0007r8-3d for bug-guix@gnu.org; Thu, 27 Apr 2023 17:25:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ps96s-0007l8-EL for bug-guix@gnu.org; Thu, 27 Apr 2023 17:25:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ps96s-0007pL-5q for bug-guix@gnu.org; Thu, 27 Apr 2023 17:25:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#58485: [shepherd] Restarting guix-publish fails Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 27 Apr 2023 21:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58485 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Lars-Dominik Braun Cc: 58485@debbugs.gnu.org, Lars-Dominik Braun Received: via spool by 58485-submit@debbugs.gnu.org id=B58485.168263065130023 (code B ref 58485); Thu, 27 Apr 2023 21:25:02 +0000 Received: (at 58485) by debbugs.gnu.org; 27 Apr 2023 21:24:11 +0000 Received: from localhost ([127.0.0.1]:59939 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ps962-0007oA-ID for submit@debbugs.gnu.org; Thu, 27 Apr 2023 17:24:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39146) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ps961-0007nt-1r for 58485@debbugs.gnu.org; Thu, 27 Apr 2023 17:24:09 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ps95t-0007bc-MI; Thu, 27 Apr 2023 17:24:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=2Sp++paRC6NaPT6NnbMw10j/ktX5qDMIu1wlAzeftUM=; b=VY+nNwq0E4T46OvFzB6u eD/CS7Gpi+kXXjSt7pzIjUniFyY+xhzm0PDShie4BP+liYvropCPQBW0CAAftt9zMP6oobRKu0WA+ mLVA2X3MfvvpHI9TQzepyXpmO3DZe8sk5UNF8rM9olBK8WilP8Yd5M47NWckWaDc1x/jvGx6gEa0w 9tgFw8PzEjtz+xc9eWwOGLR5oRDlikgbXrTSF3R2WlyRp6Y0PVR4hZzVZHd3UReIQfx/CKICe0Gje frRGKFWyYzXdlBD2DC1PxrxhwxcezBuADeK59jtQcxdc7eglNnyZ41desLYQFL52vmK/Yh4EJ0fr9 aM8BvK2Ovc3enQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ps95t-0002Gw-67; Thu, 27 Apr 2023 17:24:01 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <875yfekmze.fsf@gnu.org> <878rgsljtx.fsf@gnu.org> Date: Thu, 27 Apr 2023 23:23:58 +0200 In-Reply-To: (Lars-Dominik Braun's message of "Mon, 20 Feb 2023 14:25:22 +0100") Message-ID: <87pm7puihd.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1682630714; a=rsa-sha256; cv=none; b=kpxHQJPQCbMaP8GglSde/7srycqLlrL2nG74V8L6+A/+XHkJ1jyIrMyDDCx3YoxDpvL6ST vq8zqX7MXX6ul0pjj0ytcmPpxxn6U1YWxHfbAenRtjVbeiROu5lHfL3NSAp4mcKjRnZSDx 7UVO3+P6fyuoNuM5WofnbyZiejt8s1TWkFa1CVVqFO0ososFUcX5bPf/yp/8Yp3y4TWODu siRN+nr194/Ic7qpzUaGNkQ4bNLm2wJH9nheVOZ7azuRJOHxhfDbJQdXNjA8EanhXmJaWR 8kJO+KItgGF0Wq67RNcfIADz3w2JsJVp6CesEMfoKSCHf/6bEJEHsduztstj8w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=VY+nNwq0; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1682630714; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=2Sp++paRC6NaPT6NnbMw10j/ktX5qDMIu1wlAzeftUM=; b=U2cXuaZsOm6jaSoFsD2Ky4NVNK67z6bcOLnViyOtBccAbMdR4BQ2L5QW0pRsxzxKJuspM2 kYcWnpSAUnXL81EL9wJl3BPvG3i6dpzZgETveWyedv/rUVtjIsLfmsHK8kdfNmofICp+i1 Kre1M7JR9a8JQu3jriavtyKdDg5qNZFvqIEaTLWUfZzhWOARSD8NFzEo0LOFUMzRmlSTIL LHZbDQ2rtUY1f4ytoF+Hkx9lzUjFGs8G47CoJuTvRCVB1sC4nTxUqVpTP4pC5+i+J9deEd p9tlo/fO41IW02nIFGEMe1PLG792Tderz+jIeg5GBejY5OnWeCLtQjSMEnC5XQ== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=VY+nNwq0; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.60 X-Spam-Score: -2.60 X-Migadu-Queue-Id: AC78A3EBB3 X-TUID: 7uj0+rolYC2r Hi, Sorry for the late reply. I=E2=80=99m going through Shepherd bug reports a= nd I remembered this discussion=E2=80=A6 Lars-Dominik Braun skribis: >> Can you confirm shepherd (PID 1) is 0.9.3? > it is: > > root 1 0.2 0.2 308148 76816 ? Sl Feb07 52:08 /gnu/sto= re/kphp5d85rrb3q1rdc2lfqc1mdklwh3qp-guile-3.0.9/bin/guile --no-auto-compile= /gnu/store/4nw0zb4swga0cb8i35nvng3rg6z5qm8p-shepherd-0.9.3/bin/shepherd --= config /gnu/store/cvrai6z8777jf7860rnvppfznl1lcxi1-shepherd.conf > >> =E2=80=98sudo herd restart ssh-daemon=E2=80=99 works fine on my laptop F= WIW. > This works fine too. Only unattended-upgrades seems to have this issue :/ > > The strace looks unsuspicious right now: > > ---snip--- > 1 14:12:15.117035 read(21, "(shepherd-command (version 0) (action res= tart) (service ssh-daemon) (arguments ()) (directory \"/root\"))", 1024) = =3D 103 > 1 14:12:15.117254 close(27) =3D 0 > 1 14:12:15.117283 close(30) =3D 0 > 1 14:12:15.117416 newfstatat(AT_FDCWD, "/etc/localtime", {st_dev=3Dma= kedev(0x8, 0x2), st_ino=3D110100491, st_mode=3DS_IFREG|0444, st_nlink=3D1, = st_uid=3D0, st_gid=3D0, st_blksize=3D4096, st_blocks=3D8, s > t_size=3D2298, st_atime=3D1676898665 /* 2023-02-20T14:11:05.338746772+010= 0 */, st_atime_nsec=3D338746772, st_mtime=3D1676898664 /* 2023-02-20T14:11:= 04.874743456+0100 */, st_mtime_nsec=3D874743456, st_c > time=3D1676898664 /* 2023-02-20T14:11:04.874743456+0100 */, st_ctime_nsec= =3D874743456}, 0) =3D 0 > 1 14:12:15.117475 write(17, "shepherd[1]: Service ssh-daemon has been= stopped.\n", 50) =3D 50 > 1 14:12:15.117524 socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBL= OCK, IPPROTO_IP) =3D 26 > 1 14:12:15.117561 setsockopt(26, SOL_SOCKET, SO_REUSEADDR, [1], 4) = =3D 0 > 1 14:12:15.117598 bind(26, {sa_family=3DAF_INET, sin_port=3Dhtons(222= 2), sin_addr=3Dinet_addr("0.0.0.0")}, 16) =3D -1 EADDRINUSE (Address alread= y in use) > 1 14:12:15.117724 write(21, "(reply (version 0) (result #f) (error (e= rror (version 0) action-exception start ssh-daemon system-error (\"bind\" \= "~A\" (\"Address already in use\") (98)))) (messages (\"Service ssh-daemon = has been stopped.\")))", 204) =3D 204 > 1 14:12:15.117754 close(21) =3D 0 This suggests =E2=80=98bind=E2=80=99 can return EADDRINUSE even though the = sockets have been closed before (presumably file descriptors 27 and 30 above). Can you confirm nothing else is competing to bind port 2222 on that machine? I tried to reproduce it with something as brutal as: while sudo herd restart sshd ; do : ; done =E2=80=A6 to no avail (I=E2=80=99m on current Shepherd =E2=80=98master=E2= =80=99 though). Maybe we should just have shepherd retry upon EADDRINUSE (like nginx does, as you wrote), though I=E2=80=99d like to understand under what condi= tions we can get EADDRINUSE in the first place. Ludo=E2=80=99.