From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 25 01:35:48 2022 Received: (at submit) by debbugs.gnu.org; 25 Jun 2022 05:35:48 +0000 Received: from localhost ([127.0.0.1]:43977 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o4ySS-0000uy-8p for submit@debbugs.gnu.org; Sat, 25 Jun 2022 01:35:48 -0400 Received: from lists.gnu.org ([209.51.188.17]:39030) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o4ySQ-0000uq-3j for submit@debbugs.gnu.org; Sat, 25 Jun 2022 01:35:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42074) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o4ySP-0003AN-Dt for bug-guix@gnu.org; Sat, 25 Jun 2022 01:35:45 -0400 Received: from [37.120.193.124] (port=59994 helo=mail.cock.li) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o4ySN-0004Lk-7m for bug-guix@gnu.org; Sat, 25 Jun 2022 01:35:45 -0400 User-agent: mu4e 1.6.11; emacs 29.0.50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cock.li; s=mail; t=1656135337; bh=hICJzYbF6vDhh/ul9JT/iz2kzZ7rziElSIJ+LL2Pry8=; h=From:To:Subject:Date:From; b=kzFBFBcbzfYmDN/6s2P3gVkrso7acFDvGxLmdEuWXy+bp6IGDmmJqO4GtW9csEMoz DDwP5by41xRbAMo2y6cplE+I5ipsXvhxcVVf3a1HWJ4bi265DPq9THmcdAyt94Exx6 NZuckZq1geU/ar6xyL3PfWuIf/yseoD6RJSrNbewnpLc8fjg0efdPgEdeDHVRfRR3g ZjDdAY2NYnNJ6PCBFqQm6or+Bb20vtgnV5bAeIOfnToc/mclllwj67BPcx6fJW/IFd kMWQynoapzYgbz1ye8BzSKhvM+1IlRXrEuwzdI+fcqysUMHE9GAUgncEwLkyeE4qEv BpgtP7RwcOr6A== From: angry rectangle To: bug-guix@gnu.org Subject: Shepherd 0.9 not cleanly unmounting root Date: Sat, 25 Jun 2022 01:27:02 -0400 Message-ID: <87a6a1fgpn.fsf@cock.li> MIME-Version: 1.0 Content-Type: text/plain X-Host-Lookup-Failed: Reverse DNS lookup failed for 37.120.193.124 (failed) Received-SPF: pass client-ip=37.120.193.124; envelope-from=angryrectangle@cock.li; helo=mail.cock.li X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, RDNS_NONE=0.793, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) Since the upgrade to shepherd 0.9, I get "recovering journal" every single time I start my computer. To be specific, "recovering journal" appears after I enter my encryption password in the initrd. I assume this means the filesystem wasn't cleanly unmounted. I am doing a proper shutdown, using either "reboot" or "halt." I've attached the minimal config I've been using. It's nothing special other than encrypted root. I'm using an SSD with a gpt partition table. No custom packages or external channels were used when configuring the system. This is for my desktop computer, but I have the exact same problem with a similar minimal config on my laptop. Mostly the same sitution there with an SSD, gpt table, and encrypted root. The guix commit 400c9ed3d779308e56038305d40cd93acb496180 is the specific commit that upgrades shepherd and causes me this problem. The previous commit is fine. I'm can confirm that it's still broken on recent commits. I'm on 696e2cc345f015c32f211bf0d0330c04b1cf5f15. Thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 25 01:44:02 2022 Received: (at 56209) by debbugs.gnu.org; 25 Jun 2022 05:44:02 +0000 Received: from localhost ([127.0.0.1]:43983 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o4yaQ-00016p-7C for submit@debbugs.gnu.org; Sat, 25 Jun 2022 01:44:02 -0400 Received: from [37.120.193.124] (port=50638 helo=mail.cock.li) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o4yaO-00016B-FY for 56209@debbugs.gnu.org; Sat, 25 Jun 2022 01:44:01 -0400 User-agent: mu4e 1.6.11; emacs 29.0.50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cock.li; s=mail; t=1656135832; bh=VgO6Bg5WQt+Qk+ijwH/puPbXQpbtx51R+zGdYYH6flg=; h=From:To:Subject:Date:From; b=Z+sye3t5FG10Ani0esQtsPy3NvDDNKy5yoALKMQtaWbtPNDLbWImM3+uClgn/2VgZ TIhL0c9TVi3ibLGVH+2RC/qyvAPboDb/cGkWdelu3OUtz+RrTsYSwFtYVeZdI+ll1v AS9sL+MvPXcdQ0Ymqz1SE+H03OWSya2tOCLMKjjQCXG0Djr+Pwp5f6TTToINMGk885 lcOalbSjC82EEVE6pRglbXgrm1NzH7CrhIYvfO7FKg5FcEvH9HZbpgyYebpV09sSU3 xet5c6wMGDLm/dbceXpP/eHbpxtYgWIkW5+h2ocxmnAeiSR+/olUhdxfqbkol5sSce 9manDcJeZzKDg== From: angry rectangle To: 56209@debbugs.gnu.org Subject: Date: Sat, 25 Jun 2022 01:42:33 -0400 Message-ID: <875ykpfgbt.fsf@cock.li> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 3.3 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: forgot the attachment. (use-modules (gnu) (gnu system) (gnu bootloader grub) (gnu packages dns)) (use-package-modules linux certs) (use-service-modules networking) (operating-system (kernel linux-libre) Content analysis details: (3.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS 2.0 BLANK_SUBJECT Subject is present but empty -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 56209 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.3 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: forgot the attachment. (use-modules (gnu) (gnu system) (gnu bootloader grub) (gnu packages dns)) (use-package-modules linux certs) (use-service-modules networking) (operating-system (kernel linux-libre) Content analysis details: (2.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS 2.0 BLANK_SUBJECT Subject is present but empty -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager --=-=-= Content-Type: text/plain forgot the attachment. --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=conf.scm Content-Description: guix system config (use-modules (gnu) (gnu system) (gnu bootloader grub) (gnu packages dns)) (use-package-modules linux certs) (use-service-modules networking) (operating-system (kernel linux-libre) (host-name "myhostname") (timezone "America/New_York") (locale "en_US.utf8") (bootloader (bootloader-configuration (bootloader grub-bootloader) (target #f))) (mapped-devices (list (mapped-device (source (uuid "my--uuid--goes--here")) (target "cryptroot") (type luks-device-mapping)))) (file-systems (append (list (file-system (device "/dev/mapper/cryptroot") (mount-point "/") (type "ext4") (dependencies mapped-devices))) %base-file-systems)) (sudoers-file (plain-file "sudoers" "\ root ALL=(ALL) ALL %wheel ALL=(ALL) NOPASSWD:ALL\n")) (users (cons (user-account (name "angry") (group "users") (password (crypt "a" "$6$abc")) (supplementary-groups '("wheel" "audio" "video"))) %base-user-accounts)) (packages (cons nss-certs %base-packages)) (services (cons* (service dhcp-client-service-type) %base-services))) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 27 04:04:19 2022 Received: (at control) by debbugs.gnu.org; 27 Jun 2022 08:04:19 +0000 Received: from localhost ([127.0.0.1]:49726 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5jjG-0007YP-V6 for submit@debbugs.gnu.org; Mon, 27 Jun 2022 04:04:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51546) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5jjF-0007Y1-KW for control@debbugs.gnu.org; Mon, 27 Jun 2022 04:04:17 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33164) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5jjA-0004Ae-AZ for control@debbugs.gnu.org; Mon, 27 Jun 2022 04:04:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:Subject:From:To:Date:in-reply-to: references; bh=nRxU6Z8H6RxwkcmzWalh/zxkXWYjEniC/qW+DTTKZho=; b=Y+PaSLnfjdksua jHqrb5Ro760Uzb1Kx6arW4qXf2u3ioq0VInSCnc3yJnYBQna+2ecOUzT4V57CXsvHVwUz1+wEacnY ibg3J+/J9r1yB1slwt0dSHHhPPQ5wp39Ocj/LPvtyDLDoI01nNbNzUzYuyM6gp857YNXuVIIsWE6G o1KF6uGGjCH48x6j2+lUkp7lD7GSVJwCMQXoymlgnwCDLfLFBu8SEu/j9b0jhaiYBhvXBs9WYpWWE 0iqkA3WRKfLiiY7PgS+0aaY1kE4YXDk6C60o1N2D0azHpZQorrtWcush2Am5wYRHEFxJ761NGuUJd PqeJzO6c7b//CYa2qF1A==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=52348 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5jj9-0003C7-QH for control@debbugs.gnu.org; Mon, 27 Jun 2022 04:04:12 -0400 Date: Mon, 27 Jun 2022 10:04:10 +0200 Message-Id: <871qvaleh1.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #56209 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) severity 56209 important quit From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 27 04:04:52 2022 Received: (at control) by debbugs.gnu.org; 27 Jun 2022 08:04:52 +0000 Received: from localhost ([127.0.0.1]:49730 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5jjo-0007ZE-5k for submit@debbugs.gnu.org; Mon, 27 Jun 2022 04:04:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51780) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5jjm-0007Yz-FT for control@debbugs.gnu.org; Mon, 27 Jun 2022 04:04:51 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33172) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5jjh-0004JO-8p for control@debbugs.gnu.org; Mon, 27 Jun 2022 04:04:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:Subject:From:To:Date:in-reply-to: references; bh=YRGHKcetZUFi6mQWCm7Ep97B49MiTQSMju+3M8AexIY=; b=CHBBfX98DzkEMZ Dd0gFjAIIoZ8QC6xoWFBY3ncRm9acwzNeG+oeeIQ5qfm5EkkJd0wSj+knZJwjawtDFvnb9PTsYaUz dWBOB/WStldeS3BbO7BwH4BjAY+rPPQNnW8zYjIdCZDZP5pWoJ8IoWIURysIxIKJ17NufMsk7YNPU C82gvGjptCNynnCO8w9AMELI0RWO1QnZhv2Wl9GUr5bH/bkTPA1TXV1WQ87DTlWK+dbGiE+BtjX8l 6c2mHKsdEDi9e7VOJ0xKsWoh1xQW7iWxOYdVHbqRJ6mESHFvVHbLXXIEpOEsThaHKF7356uTNSdjz kw5LOK31SlyZGUsXJZ6A==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=35358 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5jjg-0003TR-FL for control@debbugs.gnu.org; Mon, 27 Jun 2022 04:04:44 -0400 Date: Mon, 27 Jun 2022 10:04:43 +0200 Message-Id: <87zghyjzvo.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #56209 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) merge 56209 56250 quit From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 27 17:51:12 2022 Received: (at 56209) by debbugs.gnu.org; 27 Jun 2022 21:51:12 +0000 Received: from localhost ([127.0.0.1]:53531 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5wdU-0001Lx-77 for submit@debbugs.gnu.org; Mon, 27 Jun 2022 17:51:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51510) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5wdP-0001Lg-FU for 56209@debbugs.gnu.org; Mon, 27 Jun 2022 17:51:10 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:44832) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5wdJ-0000kC-8R; Mon, 27 Jun 2022 17:51: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=a6gToIQLvat0ruyROqKuQBia4F9v9+tAB3YCgsf4hP0=; b=NROQozvqfYwS1qjOt4q1 hAHG0KgUHJPYJlbm6OiAn+57JowP6p+1JuGbmHogKGWP7380f0Qu7hiuwfc/sp/ckDHdju+S1OsF4 sOFQzivz0tKygczxHaQ7fgkvkY806SsmB4TOVoDQBiZocvSXjURv7K+JBGgZKVWiWFePdqrt1wg/S uLaD5sXGE4JYeUAKH5ccYuLvygov38HxdZkTWrQ/bUuzH//qCUup1R7liJ/8GkRqECd/kpBRZmwaI wMIT97IY6H5TVpTz6tAx0WER61lhQh0AQ1mkx7OVznhb4azBXnmNOpHDeIEDtcd7KnUmXtpu84+uF hKCknPkXshFjsw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:58408 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5wdI-0004DL-Rq; Mon, 27 Jun 2022 17:51:01 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: angry rectangle Subject: Re: bug#56209: Shepherd 0.9 not cleanly unmounting root References: <87a6a1fgpn.fsf@cock.li> Date: Mon, 27 Jun 2022 23:50:58 +0200 In-Reply-To: <87a6a1fgpn.fsf@cock.li> (angry rectangle's message of "Sat, 25 Jun 2022 01:27:02 -0400") Message-ID: <87mtdxg4hp.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 56209 Cc: 56209@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, angry rectangle skribis: > Since the upgrade to shepherd 0.9, I get "recovering journal" every singl= e time I start my computer. > To be specific, "recovering journal" appears after I enter my encryption = password in the initrd. > I assume this means the filesystem wasn't cleanly unmounted. > I am doing a proper shutdown, using either "reboot" or "halt."=20 I can see that as well. > The guix commit 400c9ed3d779308e56038305d40cd93acb496180 is the specific = commit that upgrades shepherd and causes me this problem. The previous comm= it is fine. > I'm can confirm that it's still broken on recent commits. I'm on 696e2cc3= 45f015c32f211bf0d0330c04b1cf5f15. Preliminary investigation suggests this is because shepherd doesn=E2=80=99t close log files beforehand (in 0.9, those specified as #:log-file to =E2=80=98make-forkexec-constructor=E2=80=99 & co. are opened by PID=C2=A01;= conversely, shepherd 0.8 would open them in the child process.) To be continued=E2=80=A6 Thanks for reporting the issue and finding the offending commit! Ludo=E2=80=99. PS: Below my (ugly) debugging tricks for posterity. To see those messages, you typically need to start a VM with =E2=80=98-serial stdio= =E2=80=99 and pass =E2=80=9Cconsole=3DttyS0=E2=80=9D to the kernel. (It=E2=80=99s be= st to start a standalone VM with an image created by =E2=80=98guix system image -t qcow2=E2=80=99.) --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/gnu/services/base.scm b/gnu/services/base.scm index d58afb27e3..25d747d226 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -299,6 +299,9 @@ (define %root-file-system-shepherd-service (stop #~(lambda _ ;; Return #f if successfully stopped. (sync) + (call-with-port (open-file "/dev/console" "w0") + (lambda (port) + (display "This is my last message.\n" port))) (call-with-blocked-asyncs (lambda () @@ -314,11 +317,24 @@ (define %root-file-system-shepherd-service ;; Close /dev/console. (for-each close-fdes '(0 1 2)) - ;; At this point, there are no open files left, so the - ;; root file system can be re-mounted read-only. - (mount #f "/" #f - (logior MS_REMOUNT MS_RDONLY) - #:update-mtab? #f) + (open-fdes "/dev/null" O_RDONLY) + (open-fdes "/dev/console" O_WRONLY) + (open-fdes "/dev/console" O_WRONLY) + (current-output-port (fdopen 1 "w0")) + (current-error-port (fdopen 2 "w0")) + (pk 'umount-root) + + (catch 'system-error + (lambda () + ;; At this point, there are no open files left, so the + ;; root file system can be re-mounted read-only. + (mount #f "/" #f + (logior MS_REMOUNT MS_RDONLY) + #:update-mtab? #f)) + (lambda args + (pk 'umount-root-error args) + #f)) + (pk 'done-umount-root) #f))))) (respawn? #f))) @@ -406,7 +422,28 @@ (define (file-system-shepherd-service file-system) ;; Make sure PID 1 doesn't keep TARGET busy. (chdir "/") - (umount #$target) + (call-with-port (open-file "/dev/console" "w0") + (lambda (port) + (parameterize ((current-output-port port) + (current-error-port port)) + (pk 'umount #$target) + #$(if (file-system-mount-may-fail? file-system) + #~(catch 'system-error + (lambda () + (umount #$target)) + (const #f)) + #~(catch 'system-error + (lambda () + (umount #$target)) + (lambda args + (pk 'umount-error args) + (system* #$(file-append (@ (gnu + packages + lsof) + lsof) + "/bin/lsof")) + #f))) + (pk 'done-umount #$target)))) #f)) ;; We need additional modules. diff --git a/gnu/system/examples/bare-bones.tmpl b/gnu/system/examples/bare-bones.tmpl index 387e4b12ba..1f9012c167 100644 --- a/gnu/system/examples/bare-bones.tmpl +++ b/gnu/system/examples/bare-bones.tmpl @@ -2,8 +2,8 @@ ;; for a "bare bones" setup, with no X11 display server. (use-modules (gnu)) -(use-service-modules networking ssh) -(use-package-modules screen ssh) +(use-service-modules networking ssh shepherd) +(use-package-modules screen ssh admin) (operating-system (host-name "komputilo") @@ -38,6 +38,13 @@ "audio" "video"))) %base-user-accounts)) + (essential-services + (modify-services (operating-system-default-essential-services + this-operating-system) + (shepherd-root-service-type + config => (shepherd-configuration + (shepherd shepherd-0.8))))) + ;; Globally-installed packages. (packages (cons screen %base-packages)) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 27 17:51:23 2022 Received: (at control) by debbugs.gnu.org; 27 Jun 2022 21:51:23 +0000 Received: from localhost ([127.0.0.1]:53535 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5wdf-0001MN-KN for submit@debbugs.gnu.org; Mon, 27 Jun 2022 17:51:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51576) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5wdd-0001MA-Vv for control@debbugs.gnu.org; Mon, 27 Jun 2022 17:51:22 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:44834) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5wdY-0000ly-Nc for control@debbugs.gnu.org; Mon, 27 Jun 2022 17:51:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:Subject:From:To:Date:in-reply-to: references; bh=m0JAs8rN09Mtc2rC428BQE1lMvhKN0ux22WiETjRMlo=; b=oktAdJY3MxYatm UXk14RnYmC8fNXFpo2x0pB9ld+f+t5gbP62KhRTWI+znZUCizKvAKIMCTY1nCZs4PhVBnwOJFiuJy rECkDw6VFFe1wZN9Mmy7BXV3bwyiCG1M/oWMRnUQ2AM5rApHylq5arbMUS6CPenMlEnjChu6/NClZ ZRJhmFUajHOIH7rNHhf6Lw6Cr73KkvKKtEBMGfkj0H/7B66Z9hjjcvVcl5KXJVSnXjW90yQwbq1eZ UO0A4F25Hw5cvdh5oox8uVjmVGarGACFkjRIEpb5qQc+JjaD1DT6FRbPbCpS3yLr4XIGmVeKWkG+Y jGQ2o0tcwzYGrEb8rCdw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:58578 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5wdY-0004Ez-At for control@debbugs.gnu.org; Mon, 27 Jun 2022 17:51:16 -0400 Date: Mon, 27 Jun 2022 23:51:15 +0200 Message-Id: <87lethg4h8.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #53214 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) block 53214 by 56209 quit From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 28 18:02:58 2022 Received: (at 56209) by debbugs.gnu.org; 28 Jun 2022 22:02:58 +0000 Received: from localhost ([127.0.0.1]:56581 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o6JIQ-0003Gf-25 for submit@debbugs.gnu.org; Tue, 28 Jun 2022 18:02:58 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35272) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o6JIL-0003GR-QV for 56209@debbugs.gnu.org; Tue, 28 Jun 2022 18:02:56 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:39842) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6JIG-00070h-Gk; Tue, 28 Jun 2022 18:02:48 -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=UGZKKeRtYd7OcpPWkQF1XlVBKB8V6pLprJk45v8ExXc=; b=JftMMCu6hZeaK1FS1UtF tkvIGhBunVuk74OA3czjGMGHZ8GnZkzLmwMomzgTJej4fttgNxLQBt3X9dh3R+mFO9s91z0ACfxxg ijH+wtEk88FsCnm0SVdQLH3TwtdhUFXjx5j5OCVMzuHjwNvvoELC+FS725vhg4q9vW9Igyg/s6IJT aKGEmV0y5ddc3YSHp6sQh7PkYGXve0QddrYL04LOWRcBsBjEmWdJrveWBErDsc5z1qivezhlcYFBD zOLNI+z0qHLX2FVVU0wvoXqu8gRWoRytI5hodTmVePW06j9OrJ5qQpDCqMxruNSREhJbRt2mJp10e wsm4ARs7FRZV2A==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:54125 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6JIG-0006HQ-48; Tue, 28 Jun 2022 18:02:48 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: angry rectangle Subject: Re: bug#56209: Shepherd 0.9 not cleanly unmounting root References: <87a6a1fgpn.fsf@cock.li> <87mtdxg4hp.fsf@gnu.org> Date: Wed, 29 Jun 2022 00:02:45 +0200 In-Reply-To: <87mtdxg4hp.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Mon, 27 Jun 2022 23:50:58 +0200") Message-ID: <87ilokbg56.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 56209 Cc: 56209@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, I believe the attached patch fixes the problem. I=E2=80=99ll do more testi= ng on my side but I=E2=80=99d be grateful if someone would give it a try too. Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 17b7b38a15..dea58354d9 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -328,7 +328,18 @@ (define-public shepherd-0.9 version ".tar.gz")) (sha256 (base32 - "0l2arn6gsyw88xk9phxnyplvv1mn8sqp3ipgyyb0nszdzvxlgd36")))) + "0l2arn6gsyw88xk9phxnyplvv1mn8sqp3ipgyyb0nszdzvxlgd36")) + (modules '((guix build utils))) + (snippet + ;; Avoid continuation barriers so (@ (fibers) sleep) can be + ;; called from a service's 'stop' method + '(substitute* "modules/shepherd/service.scm" + (("call-with-blocked-asyncs") ;in 'stop' method + "(lambda (thunk) (thunk))") + (("\\(for-each-service\n") ;in 'shutdown-services' + "((lambda (proc) + (for-each proc + (fold-services cons '())))\n"))))) (arguments (list #:configure-flags #~'("--localstatedir=/var") #:make-flags #~'("GUILE_AUTO_COMPILE=0") diff --git a/gnu/services/base.scm b/gnu/services/base.scm index d58afb27e3..1fd4cd84f3 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -300,27 +300,36 @@ (define %root-file-system-shepherd-service ;; Return #f if successfully stopped. (sync) - (call-with-blocked-asyncs - (lambda () - (let ((null (%make-void-port "w"))) - ;; Close 'shepherd.log'. - (display "closing log\n") - ((@ (shepherd comm) stop-logging)) + (let ((null (%make-void-port "w"))) + ;; Close 'shepherd.log'. + (display "closing log\n") + ((@ (shepherd comm) stop-logging)) - ;; Redirect the default output ports.. - (set-current-output-port null) - (set-current-error-port null) + ;; Redirect the default output ports.. + (set-current-output-port null) + (set-current-error-port null) - ;; Close /dev/console. - (for-each close-fdes '(0 1 2)) + ;; Close /dev/console. + (for-each close-fdes '(0 1 2)) - ;; At this point, there are no open files left, so the - ;; root file system can be re-mounted read-only. - (mount #f "/" #f - (logior MS_REMOUNT MS_RDONLY) - #:update-mtab? #f) + (let loop ((n 10)) + (unless (catch 'system-error + (lambda () + ;; At this point, there are no open files left, so the + ;; root file system can be re-mounted read-only. + (mount #f "/" #f + (logior MS_REMOUNT MS_RDONLY) + #:update-mtab? #f) + #t) + (const #f)) + (unless (zero? n) + ;; Yield to the other fibers. That gives logging fibers + ;; an opportunity to close log files so the 'mount' call + ;; doesn't fail with EBUSY. + ((@ (fibers) sleep) 1) + (loop (- n 1))))) - #f))))) + #f))) (respawn? #f))) (define root-file-system-service-type --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 28 20:31:04 2022 Received: (at 56209) by debbugs.gnu.org; 29 Jun 2022 00:31:04 +0000 Received: from localhost ([127.0.0.1]:56674 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o6Lbk-0006u4-Bl for submit@debbugs.gnu.org; Tue, 28 Jun 2022 20:31:04 -0400 Received: from [37.120.193.124] (port=42530 helo=mail.cock.li) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o6Lbd-0006tT-Fe for 56209@debbugs.gnu.org; Tue, 28 Jun 2022 20:31:03 -0400 References: <87a6a1fgpn.fsf@cock.li> <87mtdxg4hp.fsf@gnu.org> <87ilokbg56.fsf@gnu.org> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cock.li; s=mail; t=1656462651; bh=xoNEvgckblmy/UYD4EUiLWOXxOhSFWxCTqgMV5khNO8=; h=References:From:To:Cc:Subject:Date:In-reply-to:From; b=UDtDK0MxY/ZueU/pt72ssNtQQgCLQA+iwKrIf7LP8tspjuNnzSgB2FiwRT0Z4Z14B 4dr7Z4L3h48LXWqVT/p4W3yeOimfljn1yCuTOU/z6AtV8K3NPrCN4aZ2DzjUf45ZpR XoziqhouNBXslWpjyLrUBDOmazYsfopshZ1uz6ITzNP2lD9Kiy8N55ni7mwMYz5WRw CcTZjXtof72135/QbVe57g9j22McR1ekZImv3tN6/53nqbZ936T8bG3bm+VXuOn3C2 T546fZz/A2nC1h2Xwnq0L5HYBGJI1EXtUSzlgCT6c/CUZekE+ZAiRn/UqqJy/GPIPW O905IaGnBogvg== User-agent: mu4e 1.6.11; emacs 28.1 From: angry rectangle To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#56209: Shepherd 0.9 not cleanly unmounting root Date: Tue, 28 Jun 2022 20:18:48 -0400 In-reply-to: <87ilokbg56.fsf@gnu.org> Message-ID: <87tu84fgzs.fsf@cock.li> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: I tried your patch on one of my computers and it works. Thank you. Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 56209 Cc: 56209@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) I tried your patch on one of my computers and it works. Thank you. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 01 06:29:42 2022 Received: (at 56209-done) by debbugs.gnu.org; 1 Jul 2022 10:29:42 +0000 Received: from localhost ([127.0.0.1]:36318 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7DuA-0004mX-1g for submit@debbugs.gnu.org; Fri, 01 Jul 2022 06:29:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57046) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7Du7-0004mI-PG for 56209-done@debbugs.gnu.org; Fri, 01 Jul 2022 06:29:40 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55962) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7Du2-0001M2-E0; Fri, 01 Jul 2022 06:29:34 -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=EH3JuXullKNRWznYEgODGRFwxT6PThiN7MAkjdfLNZI=; b=cSQcuNzBVpMx26IEqq73 VnapHO0nx57vA4JCH6DjgzkYYDY1lqz+arfjQg0fjDRnCnKwh0daBAmOsD3BGUAbgqbIWxmcAqr5r NAQDJTI2yZpoiCfbwcnxw1caltXRA4JSKTKZBYR1iMbyLNAbr1f56apQXpStp+7H1mDc+1c7vP6Bw pPY6MKe9ViqRhvYgCtITGt3oxRXbWrDLm42uf+vLxj01GbN8CKFF2VBMTmqzgVo1GZYuM436pE55I SbQ0/h7/sF+YqykN+pCXf5zWKnVJMSwyHi/yH9oPUy/CkFZhL/FLQdNUkKxyGoGku1XEMqjqm5P21 6DBa/hE3XkJKRA==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:49778 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7Du1-0000zC-Sp; Fri, 01 Jul 2022 06:29:34 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: angry rectangle Subject: Re: bug#56209: Shepherd 0.9 not cleanly unmounting root References: <87a6a1fgpn.fsf@cock.li> <87mtdxg4hp.fsf@gnu.org> <87ilokbg56.fsf@gnu.org> <87tu84fgzs.fsf@cock.li> Date: Fri, 01 Jul 2022 12:29:31 +0200 In-Reply-To: <87tu84fgzs.fsf@cock.li> (angry rectangle's message of "Tue, 28 Jun 2022 20:18:48 -0400") Message-ID: <87czep5do4.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 56209-done Cc: 56209-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, angry rectangle skribis: > I tried your patch on one of my computers and it works. Thanks for testing. Pushed as 0483c71cc5aeb3b69f6deb154fe12c0b2e6dc17f. The reason is took me more time is that I wanted to have a system test for that to make sure it doesn=E2=80=99t come back to haunt us in the future. Now we should= be fine. :-) Ludo=E2=80=99. From unknown Sun Jun 22 07:38:51 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 29 Jul 2022 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator