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 AEBgChvin2UKPAAAkFu2QA (envelope-from ) for ; Thu, 11 Jan 2024 13:42:03 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id KLQyBRvin2UT9QAAqHPOHw (envelope-from ) for ; Thu, 11 Jan 2024 13:42:03 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=Mv2zHfPu; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1704976923; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=VsdUoU70GqDF9aw3M4/7naSLaDK83Vh7KnJzCCeCpcI=; b=fnxwNc9yOT/q5wgjoJVArvhvqRMrRISr947Ae0Aebp1G5m0rWUE8wgt6aM4wZ7Ni1b6M1v Kb7h9nzta6pjrhoL5HImJavh78DWLMB2W0ii8V0DWDDL1fD4FPV38UWxg0MtLUh82ttJrA uvkyQ7zublDzxhEy19udgYwKsV8N6DpbzspmGcIBNLhLkOzvqeudGZ1zsjOnVv7KxqDc5o 07+Ur+hY/FKdUGpmJ7HAivKodWjdae4kWCubNHVGmdr+j4cHKCVOkFP05dyvfd41m26+NT v2T3XnI0AB91Rws+LJCj6uCAiQm3moo1xVejq5sv4o6Qow2Y/u+Pqn3N9pm5yQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=Mv2zHfPu; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1704976923; a=rsa-sha256; cv=none; b=uJCk3M0Ly4TwH0p1nvdUe9n1cb3+jbEp8wchf/vBfMECD0/041TkT/QaRemynNyQmVY2EM JJxdAuIuhYc7X1E/d4uFA6EIHN/fPS2Mf1nTM+dkOxbedNlD7+eKp32yeGsCdw3lxh6q7q 48rySzDZIac6HZWmOW0I74JFXci2d2JOcRK6ggVNh1kpPXJf8/A8YEuLVxbBvUxntXs+az JESZ5XwvbsRpa1K6BjJ5TQ2IiU0G6N4nSw66gDUqoqJZhpSHSqMEP49Xz2S/g1HxzMFafR Yms/ITnn62N1lziEWd/ysQEYmVhGwrivdI3uW8F2WztZ4bTyy5NMG1Dy3j5tIA== 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 ACD476C6DA for ; Thu, 11 Jan 2024 13:42:02 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNuNV-0005MX-Rt; Thu, 11 Jan 2024 07:41:45 -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 ) id 1rNuNU-0005Lu-TC for guix-devel@gnu.org; Thu, 11 Jan 2024 07:41:44 -0500 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 1rNuNU-0001sE-Kk for guix-devel@gnu.org; Thu, 11 Jan 2024 07:41:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=VsdUoU70GqDF9aw3M4/7naSLaDK83Vh7KnJzCCeCpcI=; b=Mv2zHfPuwKp8UFQ6vNeA N+moHzpdi0P9z4wBHE3H95pTgsA6x/P3ExpwG0iCk4os9tHpFuZCmq0adBcHVOrgwta9bXltO6dLY zE9lx3lRfxnvTpIFMd/ZWI2bt1Iw+EySvM1srBxGLA1FNpIGybIrG7Xr4JX4krmrp7EuopCHaIe4q ph0tirI+WRY4rwK9Akxa4sSXddLUOK++S1+M7upgWvePwH8ptJ3IqJ26BKKsNi/G7fBAArvH+cNq3 WfmXPmp7svwpkTBg3WBM185MhHp1zuAAZjj18q9/WCBwlwlWyQxdD7b5H8HsnIWyjHH3cDtlPQv0X EIAWnjnF/rjT1A==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: guix-devel@gnu.org Subject: Re: GNU Shepherd 0.10.3 released In-Reply-To: (Tomas Volf's message of "Wed, 10 Jan 2024 17:38:17 +0100") References: <87sf39ck1w.fsf@gnu.org> <878r4yw06f.fsf@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Duodi 22 =?utf-8?Q?Niv=C3=B4se?= an 232 de la =?utf-8?Q?R=C3=A9volution=2C?= jour du Sel X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 11 Jan 2024 13:41:39 +0100 Message-ID: <87y1cwnit8.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -11.03 X-Spam-Score: -11.03 X-Migadu-Queue-Id: ACD476C6DA X-TUID: kF19LBEV7SPS Hello, Tomas Volf <~@wolfsden.cz> skribis: > Otherwise the shepherd would be stuck on shutdown waiting for process nam= ed > > [mt76-tx phy0] > > to terminate with messages along the lines of: > > shepherd[1]: waiting for process termination (processes left: (1 678)) > > 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 f= or it. Ooooh. Then I=E2=80=99m afraid this bug isn=E2=80=99t fixed yet because that code = (=E2=80=9Cwaiting for process termination=E2=80=9D) is currently in Guix, not in Shepherd. However, =E2=80=98processes=E2=80=99, which is what is used here and which = is defined in (guix build syscalls), already checks for kernel threads, though it does it differently than what I implemented in shepherd: (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_code)= _ ...) ;; Got this obscure trick from sysvinit's 'killall5' program. (and (zero? start_code) (zero? end_code)))))) It would be great if you could check whether this approach works for you. (I had completely forgotten about this code. Funny thing is this one was inspired by sysvinit, whereas the one in Shepherd was inspired by systemd. A sign of times!) Ludo=E2=80=99.