From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:5f26::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id MAH0IIXpn2UGmQAAkFu2QA (envelope-from ) for ; Thu, 11 Jan 2024 14:13:41 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id iC2bHYXpn2VyNAAAqHPOHw (envelope-from ) for ; Thu, 11 Jan 2024 14:13:41 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=wolfsden.cz header.s=mail header.b=l6XSuIoi; dkim=pass header.d=wolfsden.cz header.s=mail header.b=l6XSuIoi; dmarc=pass (policy=none) header.from=wolfsden.cz; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1704978821; a=rsa-sha256; cv=none; b=EWwij0JNgMAhoC7LAb4OJkbbIHE30b6uBChqUYNqBYZxdRjXN4ZH66D3ILB3P+WLzcVvSM c0XYptVq0rBjUNYa9a7KB58lx4hsKI8WK6LCCmtm76Lu084mXT4jHgBsnvOTunMr0u1nkr V8I7XTWbsBgLK5cbLr1Gxf1ZtjOlRGoQodmQwhDQxU4p18Q8k5cFcpPtBqhLpMEnkm+vt5 iTfpTHJ64r8/pg1R8my2JTMSzRGRxjjGZpnuiVW+1sxv1++q7CbwH7dtJm64vS2uVHP++c KFg5qfRGuR/NWM+fij/nXs0fyi/XFSpqrpDeNSQqUKLQkD9ZyagxUfNHfMtwzQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=wolfsden.cz header.s=mail header.b=l6XSuIoi; dkim=pass header.d=wolfsden.cz header.s=mail header.b=l6XSuIoi; dmarc=pass (policy=none) header.from=wolfsden.cz; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1704978821; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=xumTwgs5N/Rn8OrHM2NTUglf0vFUgB4Sh+q4JbjmZhg=; b=VrukGfj872dUhKglqEgmVFNikgGZf85yODfb/454Wj1/JSu7jyo76l+bQrheOch66BRptR njUcJg3TPJDrJEToF4mOWoPO4SXsfdfYryX9CbkZcteXrMBlL/LIO3qhaNnoKXTPF2Ose3 6C/BHs8+4DrJs77NsbYIq25s33z70rM2AoK3g/mDrFH9ejHjeU7xPa56TF0tE7+3AhwfBN qSg0Jt2GiO6IAvMjmM8lj1pdnAYT3C/ZMVnZzoy+Sb2InyjXXopht/xH0TpaDOhM2Li7ye 9+KGsKvzXxApLrhKkeveGazBcS+TTUlG23Ng1gRajs9ZSLoppG5SMUSssgvryg== 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 4109157AD8 for ; Thu, 11 Jan 2024 14:13:41 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNurk-00069E-7q; Thu, 11 Jan 2024 08:13:00 -0500 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 <~@wolfsden.cz>) id 1rNuri-000696-NR for guix-devel@gnu.org; Thu, 11 Jan 2024 08:12:58 -0500 Received: from wolfsden.cz ([37.205.8.62]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <~@wolfsden.cz>) id 1rNurg-0000t8-AG; Thu, 11 Jan 2024 08:12:58 -0500 Received: by wolfsden.cz (Postfix, from userid 104) id BD4E324FBA4; Thu, 11 Jan 2024 13:12:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1704978772; bh=I7B4/41zidbCjpVxKSwFfdcib7DDwbdIzREjDRji9Ww=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=l6XSuIoiUSTpBxro9wLzHAcCQx4BjoNxaeMpPhLCNKuR74NkCr4SONXrjT84bzk3m 6KdFSZpjZX6Az/n9EUvzXYwZbYrpacnLAvtNCdbxBguLOuaUhy04EkoDHu2wwXovmv c//rEtAAdx3+BnjEjphMVMW7XdUqRgtaXtCi5KkgbOo15PqzjfrDAsF/8zvLueFZjH SirbEkbUn2Ck+bfdF58hKItEFhEnuPG6SlOzbCKUAIiKWItvJElFjh28DA5zeZ+EZS W8c7e4f7Xka9CFg+sqwPlQscRZKnOcyfzeJDU8jjABr/416Sd5Fo5mY4/WT5PPV0M9 usX1NrHQKHBFxrsH4FXCqZ4PyiYD/EHxST1psWgDMaLchkDLRRBUMGyRGyyg5h0WfZ 3b3pLvsb6s4vGgDrWh1P0Ne6nkuq0+yNC4Y4nqjBQ4GRKiwRkyC1jOPpycB9npQUYX mQZIPNuET9aiKlyirB8VJHjx8ZkyeOXrLvFSbwEKxyS0gBo+f7deu78OhcYmdkbyLu cGk5EJGJQgdRm2v0W468cOxZMoY69eTxGFMtnsOhVeto7+RN8sySamXXAOS7+pcatZ N+NCFIzRsPjNqyUxIX5kHuMM5iA8QDwroysb9VBkR1ccZglnP/ttOfOSNQVp0ICk3N /AQ8gmNZ2ZovTFEY0f7N2dJ4= Received: from localhost (unknown [193.32.127.158]) by wolfsden.cz (Postfix) with ESMTPSA id 68FC724EDF7; Thu, 11 Jan 2024 13:12:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1704978772; bh=I7B4/41zidbCjpVxKSwFfdcib7DDwbdIzREjDRji9Ww=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=l6XSuIoiUSTpBxro9wLzHAcCQx4BjoNxaeMpPhLCNKuR74NkCr4SONXrjT84bzk3m 6KdFSZpjZX6Az/n9EUvzXYwZbYrpacnLAvtNCdbxBguLOuaUhy04EkoDHu2wwXovmv c//rEtAAdx3+BnjEjphMVMW7XdUqRgtaXtCi5KkgbOo15PqzjfrDAsF/8zvLueFZjH SirbEkbUn2Ck+bfdF58hKItEFhEnuPG6SlOzbCKUAIiKWItvJElFjh28DA5zeZ+EZS W8c7e4f7Xka9CFg+sqwPlQscRZKnOcyfzeJDU8jjABr/416Sd5Fo5mY4/WT5PPV0M9 usX1NrHQKHBFxrsH4FXCqZ4PyiYD/EHxST1psWgDMaLchkDLRRBUMGyRGyyg5h0WfZ 3b3pLvsb6s4vGgDrWh1P0Ne6nkuq0+yNC4Y4nqjBQ4GRKiwRkyC1jOPpycB9npQUYX mQZIPNuET9aiKlyirB8VJHjx8ZkyeOXrLvFSbwEKxyS0gBo+f7deu78OhcYmdkbyLu cGk5EJGJQgdRm2v0W468cOxZMoY69eTxGFMtnsOhVeto7+RN8sySamXXAOS7+pcatZ N+NCFIzRsPjNqyUxIX5kHuMM5iA8QDwroysb9VBkR1ccZglnP/ttOfOSNQVp0ICk3N /AQ8gmNZ2ZovTFEY0f7N2dJ4= Date: Thu, 11 Jan 2024 14:12:51 +0100 From: Tomas Volf <~@wolfsden.cz> To: Ludovic =?iso-8859-1?Q?Court=E8s?= Cc: guix-devel@gnu.org Subject: Re: GNU Shepherd 0.10.3 released Message-ID: Mail-Followup-To: Ludovic =?iso-8859-1?Q?Court=E8s?= , guix-devel@gnu.org References: <87sf39ck1w.fsf@gnu.org> <878r4yw06f.fsf@gnu.org> <87y1cwnit8.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="M4dp/fRPglnOdqcj" Content-Disposition: inline In-Reply-To: <87y1cwnit8.fsf@gnu.org> Received-SPF: pass client-ip=37.205.8.62; envelope-from=~@wolfsden.cz; helo=wolfsden.cz X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -11.47 X-Spam-Score: -11.47 X-Migadu-Queue-Id: 4109157AD8 X-Migadu-Scanner: mx13.migadu.com X-TUID: 0ONNGgNXxIFG --M4dp/fRPglnOdqcj Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2024-01-11 13:41:39 +0100, Ludovic Court=C3=A8s wrote: > Tomas Volf <~@wolfsden.cz> skribis: >=20 > > Otherwise the shepherd would be stuck on shutdown waiting for process n= amed > > > > [mt76-tx phy0] > > > > to terminate with messages along the lines of: > > > > shepherd[1]: waiting for process termination (processes left: (1 67= 8)) > > > > It is a kernel thread as far as I can tell (based on > > https://stackoverflow.com/a/12231039): > > > > $ cd /proc/678 > > $ cat cmdline > > $ readlink exe; echo $? > > 1 > > > > Removing the module mt7921e stops the thread, so shepherd does not wait= for it. >=20 > Ooooh. >=20 > Then I=E2=80=99m afraid this bug isn=E2=80=99t fixed yet because that cod= e (=E2=80=9Cwaiting for > process termination=E2=80=9D) is currently in Guix, not in Shepherd. >=20 > However, =E2=80=98processes=E2=80=99, which is what is used here and whic= h is defined in > (guix build syscalls), already checks for kernel threads, though it > does it differently than what I implemented in shepherd: >=20 > (define (kernel? pid) > "Return #t if PID designates a \"kernel thread\" rather than a normal > user-land process." > (let ((stat (call-with-input-file (format #f "/proc/~a/stat" pid) > (compose string-tokenize read-string)))) > ;; See proc.txt in Linux's documentation for the list of fields. > (match stat > ((pid tcomm state ppid pgrp sid tty_nr tty_pgrp flags min_flt > cmin_flt maj_flt cmaj_flt utime stime cutime cstime > priority nice num_thread it_real_value start_time > vsize rss rsslim > (=3D string->number start_code) (=3D string->number end_cod= e) _ ...) > ;; Got this obscure trick from sysvinit's 'killall5' program. > (and (zero? start_code) (zero? end_code)))))) >=20 > It would be great if you could check whether this approach works for > you. Ah, that code indeed returns #f for the pid in question: scheme@(guix-user)> ((@@ (guix build syscalls) kernel?) 688) $1 =3D #f The stat file: $ cat /proc/688/stat 688 (mt76-tx phy0) S 2 0 0 0 -1 2129984 0 0 0 0 0 0 0 0 -2 0 1 0 964 0 = 0 18446744073709551615 0 0 0 0 0 0 0 2147483647 0 0 0 0 17 5 1 1 0 0 0 0 0 = 0 0 0 0 0 0 So the start_code is not zero (I would guess it is -1). I have no idea what that means though. Tomas --=20 There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors. --M4dp/fRPglnOdqcj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmWf6VMACgkQL7/ufbZ/ wal7ag//QyhcOboa+ZB4eYNKotDiKTMFK/R/zBdk0vass5LtcWbKn+/oJbRWiVoG CmhEXiDF/0h/HYu8lbez9SsWWphkXAGiMdPWxFZ2gpTelwkCLypYPpW3iGYOyEM4 bkItkIz/7rTWAn0MDnafhK2fn/72BxoGwlVGDrZGhj8CXuK6JHM5BjkScZEym+3S S+XBo4cJG22Jn6E06u/BemrT7axguafP9Ai0OKtKjenUIHP+eGFv4Y43/idBHol2 6mOlQiZDTHW+q6Fa/1Ffwdsxm0N+B7CVXY9XGAz+SxijIeqYJzKK25/zFyIacqBP EypGWf6nkvCcd+iog0AlG43bDA0XszBx8+OVps/wp53Xw0tgxKAC7omJvybmkegp DilWWysUShJC0agnde94/ffZRO3CTHlYWZkp6w6g+8wpT++bcg6YBwrkeE3dc7vo epZ5kID36+jG27p0Ll/NeDKIVd9SDMKlR62HlQ8Po0c9qmT+87WNOCdhzG+gRQU6 A8dQ9XjYKyqEYM11sVv+dvPuENpXz9N+o7YtSUk7xyI0ER3vKVKbugryg42pEn6h gy/RIZPMKUIP/XZQ5o6Z2Q2hDc8aRjiZuDT1tUt5g9l80b3k2BVaNftIum/nIlX0 2Vfyc/81DHr3ib+qxF6/LB61j/ozmyZBj3VselL1ag12ZHEKcYU= =M7BX -----END PGP SIGNATURE----- --M4dp/fRPglnOdqcj--