From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id iMIzBIB61GUxfwAA62LTzQ:P1 (envelope-from ) for ; Tue, 20 Feb 2024 11:10:08 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id iMIzBIB61GUxfwAA62LTzQ (envelope-from ) for ; Tue, 20 Feb 2024 11:10:08 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=VO9PolVh; 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"; 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=1708423807; 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-to: 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=4yzegrpOHnVmUt2JeDbwzHaO2uJ30BAzPbcT9K4C+p8=; b=J1uqITdhZ8Fj9z0QNmldoWgNCSb1b2Xe9ySCP36gbEHqdji8/kwemxy7n/irOBnscRhDgb BHvM9umx0ag2oL/9ROYilt456Yh2M8Mu3qY0hB2EziEV0YkdGL0BIiOPzL0s3OocqKzPKG UeJ+oT0Dzj6JvaiUpjXjizUPL6hdydBVIjvdmDoRWb8WP5gy7z8s8jL6No4gpFANnhd373 dzS92nlQwBulbra4pPACvUNPqKbnfWOT4ITaXxhGKv395K37UJ5ywesFoLu1csIlGyJr4o K8EvsvLHT/ZpdLFozRmXBYeOz2xorIxAWful2rqIrpH+DDdWWup9jms07PO1JQ== 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=VO9PolVh; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1708423807; a=rsa-sha256; cv=none; b=RvUyBU6H9L7RRqnuslBhuoh1mj1Ije7H6dR8BP42keUK/cdfgyGJBvIY8IAWiY4lgWm/0G 8eENx0yky28zXumDEESIXBaZEqjEkLQPY+Z8w9Q3AN9gKZdbkpaZ7jECCUCUdWvNn19G5b ExxLCtCs0fgrTmhjGxB2h3D0F1dSnuyj/0ciY3MoEF19YSeaVY8aGUmiJQ7HwXlR21aU2G 2Oobz3X4XLA2RSxMauIkDeWEpz+bQ2xSpNWOzhWeshNTTE2vFyHC74llHSSRWRFvuGBfLr 5c3NynIxtMuIdDpdICzbOnvw1cqNDIYOxPdslSGNrTIqpcGO7wFE0JpDsBwcww== 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 4F7F8727D9 for ; Tue, 20 Feb 2024 11:10:07 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rcN4K-0000L6-1f; Tue, 20 Feb 2024 05:09:44 -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 1rcN4H-0000K5-2P for bug-guix@gnu.org; Tue, 20 Feb 2024 05:09:41 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rcN4G-0004nX-Lc for bug-guix@gnu.org; Tue, 20 Feb 2024 05:09:40 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rcN4c-00017d-5G for bug-guix@gnu.org; Tue, 20 Feb 2024 05:10:02 -0500 Subject: bug#68800: Guix waits for termination of a kernel thread Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-To: bug-guix@gnu.org Resent-Date: Tue, 20 Feb 2024 10:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 68800 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Tomas Volf <~@wolfsden.cz> Cc: 68800-done@debbugs.gnu.org Mail-Followup-To: 68800@debbugs.gnu.org, ludo@gnu.org, ~@wolfsden.cz Received: via spool by 68800-done@debbugs.gnu.org id=D68800.17084237464239 (code D ref 68800); Tue, 20 Feb 2024 10:10:02 +0000 Received: (at 68800-done) by debbugs.gnu.org; 20 Feb 2024 10:09:06 +0000 Received: from localhost ([127.0.0.1]:44345 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcN3h-00016I-4C for submit@debbugs.gnu.org; Tue, 20 Feb 2024 05:09:06 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcN3Q-00015P-1o for 68800-done@debbugs.gnu.org; Tue, 20 Feb 2024 05:09:03 -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 1rcN2y-0004a4-SN; Tue, 20 Feb 2024 05:08:20 -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=4yzegrpOHnVmUt2JeDbwzHaO2uJ30BAzPbcT9K4C+p8=; b=VO9PolVhzhY1M09k3bgB rcPnyGFrrhGiJcmhGSM0o97ia5mURnKDEjGBtpNNufNGS/dwnL4UFDWfIXnq0OOIcy/vqgVd7DiSl XGzTNKULIOBq1hJmjZdF3T6Gb88mVmjZkRowH/5YgpPQkE98t83bETW4u1Fpw9vSAD0opxstrWfiq KjG1KmB3ZBQYPV1Z6hWyi9JT5QIQlXghsNpAiULK1346gzjBZCI0q3FD4HWzfW5AJkFuaFG+frU2L 9ffoqtyyR3BXyY0t4WY3+Cit8KfsYZO7I8l5EG6GtAgdIRvtgLdn4pSTflVwc53jDSYkfy6PHY9xF c3bifmbkgnI5xw==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: (Tomas Volf's message of "Mon, 29 Jan 2024 18:44:00 +0100") References: Date: Tue, 20 Feb 2024 11:08:15 +0100 Message-ID: <877cizmos0.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: 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 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -5.51 X-Spam-Score: -5.51 X-Migadu-Queue-Id: 4F7F8727D9 X-TUID: zWY/RBjFFapq Hi Tomas, Tomas Volf <~@wolfsden.cz> skribis: >> What about this method (from shepherd)? >> >> --8<---------------cut here---------------start------------->8--- >> (define (linux-process-flags pid) >> "Return the process flags of @var{pid} (or'd @code{PF_} constants), as= suming >> the Linux /proc file system is mounted; raise a @code{system-error} exce= ption >> otherwise." >> (call-with-input-file (string-append "/proc/" (number->string pid) >> "/stat") >> (lambda (port) >> (define line >> (get-string-all port)) >> >> ;; Parse like systemd's 'is_kernel_thread' function. >> (let ((offset (string-index line #\)))) ;offset past 'tcomm' f= ield >> (match (and offset >> (string-tokenize (string-drop line (+ offset 1)))) >> ((state ppid pgrp sid tty-nr tty-pgrp flags . _) >> (or (string->number flags) 0)) >> (_ >> 0)))))) >> >> ;; Per-process flag defined in . >> (define PF_KTHREAD #x00200000) ;I am a kernel thread >> >> (define (linux-kernel-thread? pid) >> "Return true if @var{pid} is a Linux kernel thread." >> (=3D PF_KTHREAD (logand (linux-process-flags pid) PF_KTHREAD))) >> --8<---------------cut here---------------end--------------->8--- >> >> If it works better, we can use that in syscalls.scm as well. > > Yes, that does seem to work: Pushed as 34c79c6ae8103ebae9ce08c81a9220a6b82b05f6. Thank you! Ludo=E2=80=99.