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 ms0.migadu.com with LMTPS id AFeVBHZM4GFwdwAAgWs5BA (envelope-from ) for ; Thu, 13 Jan 2022 16:59:50 +0100 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 yH0sAXZM4GG/GQEAauVa8A (envelope-from ) for ; Thu, 13 Jan 2022 16:59:50 +0100 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 A537CA7EF for ; Thu, 13 Jan 2022 16:59:49 +0100 (CET) Received: from localhost ([::1]:49890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n82Vw-0003sq-R3 for larch@yhetil.org; Thu, 13 Jan 2022 10:59:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58738) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n82At-00038M-B6 for bug-guix@gnu.org; Thu, 13 Jan 2022 10:38:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:41411) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n82At-0001jS-24 for bug-guix@gnu.org; Thu, 13 Jan 2022 10:38:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n82As-0005IF-W4 for bug-guix@gnu.org; Thu, 13 Jan 2022 10:38:03 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#52779: tests/no-home test failure in Shepherd Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 13 Jan 2022 15:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52779 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Maxim Cournoyer Received: via spool by 52779-submit@debbugs.gnu.org id=B52779.164208827720329 (code B ref 52779); Thu, 13 Jan 2022 15:38:02 +0000 Received: (at 52779) by debbugs.gnu.org; 13 Jan 2022 15:37:57 +0000 Received: from localhost ([127.0.0.1]:34313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n82An-0005Hp-40 for submit@debbugs.gnu.org; Thu, 13 Jan 2022 10:37:57 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:59924) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n82Ak-0005HW-2H for 52779@debbugs.gnu.org; Thu, 13 Jan 2022 10:37:55 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 8285A2A0; Thu, 13 Jan 2022 16:37:47 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LUpf6HjLM18y; Thu, 13 Jan 2022 16:37:46 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 1D4841DC; Thu, 13 Jan 2022 16:37:46 +0100 (CET) From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87h7ayys14.fsf@gmail.com> Date: Thu, 13 Jan 2022 16:37:45 +0100 In-Reply-To: <87h7ayys14.fsf@gmail.com> (Maxim Cournoyer's message of "Fri, 24 Dec 2021 09:52:07 -0500") Message-ID: <87ee5b7ik6.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spamd-Bar: / X-Rspamd-Server: hera X-Rspamd-Queue-Id: 8285A2A0 X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[multipart/mixed,text/plain,text/x-patch]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] 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: , Cc: 52779@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1642089589; 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: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; bh=m3t7CpAELer7dB6wDX4V51jJzBxlYs7rsoXPb56EoUE=; b=gJkcHcD5VPQTN3IpKlGh+EdgLT3ipXlATCMGUYBfpA3XLkh62Oyg6vW9pGVbBzphDA0KUP nDyGJ0ASEdGa2eSVrRxeFevRC6QH8Rs5NpZKLPFs/qg80PVkWOSSsn4Sbsmo6wGLPZVXg8 LkNzN2Cy3tuEWrtIakNImcRlMtyw4/vawiNrou1AGj4okSQSpJ4Tt+/+btNEp+lZq1vswX EyDNOBQ1aTAKW2DUXG/scFqIhFaXRTlao/1GeCpfjVAB3cJQ0c9Ss55mmIe5QgLdI/VM/K WYLxD/yi4VQklCOWGHuDlnV0M1A/rNrZgZPf57RUn3GVyc0eGGBOAUCrFqtNXg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1642089589; a=rsa-sha256; cv=none; b=oKE1jcw+x9KqWSFNcz19LJlJXwKtvOOWtOwVbgrbBAuDoDQ/PAHoWZmbyDiuoXALs/lT55 bXVGXyK7buFv2vTIbLpsy6wl8yyNQF882bySNdNGWGEScCcJUM0wp59IUjQ9UX6RtSZUg7 a4OsNjs0/FMzMJFYB/SvUg/BWYCpMG2bxPr5sJdKv6fJrFx7E0R8I70ckY9WC+UHcW58Qz pzZqgONvNxxtZNYn2YHXvphzVKbt0l5Zh07ufSl0fqO5cGLBLNnIxy0GKs7+d7vfv6a3A8 QcOWLMXEYIiaf99Y5c4vFaox/DYQ+HGZd/drqakXykWKWeY3cLXwEHikuOxamA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; 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: -4.92 Authentication-Results: aspmx1.migadu.com; dkim=none; 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-Queue-Id: A537CA7EF X-Spam-Score: -4.92 X-Migadu-Scanner: scn0.migadu.com X-TUID: cajsWBxad+ij --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, Maxim Cournoyer skribis: > + herd -s t-socket-1651 status root > Started: > + root > + herd -s t-socket-1651 stop root > ++ cat t-pid-1651 > + kill 1896 > + exit 1 > + rm -f t-socket-1651 > + test -f t-pid-1651 > ++ cat t-pid-1651 > + kill 1896 > + rm -f t-pid-1651 > FAIL tests/no-home.sh (exit status: 1) What happens here is that the shepherd process is still alive after =E2=80=98herd stop root=E2=80=99 has completed, contrary to what=E2=80=99s = expected: --8<---------------cut here---------------start------------->8--- $herd stop root if kill `cat "$pid"` then exit 1 fi --8<---------------cut here---------------end--------------->8--- The expectation is that shepherd has terminated by the time =E2=80=98herd s= top root=E2=80=99 exits; I wonder if that=E2=80=99s bogus. =E2=80=98herd stop root=E2=80=99 terminates when shepherd has closed its co= nnection, which normally happens when shepherd exits: --8<---------------cut here---------------start------------->8--- 28003 read(15, "(shepherd-command (version 0) (action stop) (service root) = (arguments ()) (directory \"/data/src/shepherd\"))", 1024) =3D 107 28003 brk(0x1030000) =3D 0x1030000 28003 mmap(NULL, 262144, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_AN= ONYMOUS, -1, 0) =3D 0x7f0072be8000 28003 brk(0x100f000) =3D 0x100f000 28003 getcwd("/data/src/shepherd", 100) =3D 19 28003 chdir("/data/src/shepherd") =3D 0 28003 newfstatat(AT_FDCWD, "/etc/localtime", {st_mode=3DS_IFREG|0444, st_si= ze=3D2962, ...}, 0) =3D 0 28003 write(7, "2022-01-13 16:21:16 Exiting shepherd...\n", 40) =3D 40 28003 chdir("/data/src/shepherd") =3D 0 28003 getuid() =3D 1000 28003 close(13) =3D 0 28003 unlink("test") =3D 0 28003 exit_group(0) =3D ? 28006 <... futex resumed>) =3D ? 28008 <... read resumed> ) =3D ? 28005 <... futex resumed>) =3D ? 28004 <... futex resumed>) =3D ? 28008 +++ exited with 0 +++ 28006 +++ exited with 0 +++ 28005 +++ exited with 0 +++ 28004 +++ exited with 0 +++ 28003 +++ exited with 0 +++ --8<---------------cut here---------------end--------------->8--- Maybe there=E2=80=99s a chance that the shell hasn=E2=80=99t processed the = shepherd=E2=80=99s SIGCHLD when it evaluates the =E2=80=9Cif kill `cat "$pid"`=E2=80=9D condit= ion; in that case, the shepherd process still exists as a zombie. A more robust approach might be to use the shell=E2=80=99s builtin =E2=80= =98wait=E2=80=99, because then I suppose the shell will be forced to process pending SIGCHLDs: --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable diff --git a/tests/no-home.sh b/tests/no-home.sh index 85b6116..5a8c278 100644 --- a/tests/no-home.sh +++ b/tests/no-home.sh @@ -1,5 +1,5 @@ # GNU Shepherd --- Make sure shepherd doesn't fail when $HOME is not writa= ble. -# Copyright =C2=A9 2014, 2016 Ludovic Court=C3=A8s +# Copyright =C2=A9 2014, 2016, 2022 Ludovic Court=C3=A8s # # This file is part of the GNU Shepherd. # @@ -46,7 +46,4 @@ kill -0 `cat "$pid"` $herd status root $herd stop root =20 -if kill `cat "$pid"` -then - exit 1 -fi +wait `cat "$pid"` --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable I can=E2=80=99t get it to fail while waiting for a few minutes of: while make check TESTS=3Dtests/no-home.sh ; do : ; done =E2=80=A6 but I cannot get the original one to fail either. Does it work for you? Ludo=E2=80=99. --=-=-=--