From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 01 07:40:02 2021 Received: (at submit) by debbugs.gnu.org; 1 Nov 2021 11:40:02 +0000 Received: from localhost ([127.0.0.1]:33850 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mhVfW-0005O4-4r for submit@debbugs.gnu.org; Mon, 01 Nov 2021 07:40:02 -0400 Received: from lists.gnu.org ([209.51.188.17]:50530) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mhVfT-0005Nl-17 for submit@debbugs.gnu.org; Mon, 01 Nov 2021 07:40:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53140) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhVfS-0001WI-Ic for guix-patches@gnu.org; Mon, 01 Nov 2021 07:39:58 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:59835) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhVfO-0008Az-04 for guix-patches@gnu.org; Mon, 01 Nov 2021 07:39:55 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 929685C00EA for ; Mon, 1 Nov 2021 07:39:52 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 01 Nov 2021 07:39:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= tom-fitzhenry.me.uk; h=message-id:date:mime-version:to:from :subject:content-type:content-transfer-encoding; s=fm3; bh=SLejP sDI8/bMnXJSOai1I1tX8wtELqJDg/bUEpGbmyc=; b=xJuvo39k7nYFHgOUEHJpP 0b1DJvqyJrDtSSrVPNdJaDa20qIiOVf30NooCrIXqa4M8FVY1l5wF62iVKoLoFND kpgWYpQ9PxcQ0cMDKRKH0HWoHmccb94xL+3oh/OMvzRIRtKytCmhSExhFgZAcqJP 67cMnwr9BCOcAAvT5QiUc+9Rf2W6V2fi5vj84ye+Dbjt6v3Dzr6BLQHIFN0Pddej TTfcSu6+gHs2eOSFOQI1YGmmQHzySiK81aLqaEVxr2e3YMg0yzQa2mlaVX8kGodF 4a7UkpeOGpE7m1soOlTuAIioKe4/Hr8AUtixsGPWX+/i3SVL0XldmTOt6qeGzIAN w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=SLejPs DI8/bMnXJSOai1I1tX8wtELqJDg/bUEpGbmyc=; b=dAenl7WAlyPo2EnOAKc0sn 8a8jUHgM13rXGGJNJqNOAoxJwtlu/suaDDcwDWVsKU2iOsYMCTeQNI42xsQ4+PaG fK6t8+ul9Mk3yomCMBO7qa1XfZKF/oEy7H6tK8VguRA4jLpP8CY87aS/X/FPxyzD Mg+H97Xy1FAWCgAM342NcKR/oIX5+jfYH/drb5YNilPeZJCvvFk0GX5vgZ1hC1Ei wHTs4TCoXLiHgWkl49TFWTbrsJihbXOlWRTlNEvtLHqrBLr9HYZGXBf2jTcBWRur 1Zzx/1BnaiM0Zj9kFdMrahdGqWu9QEPnnmWDDiL2vGBCmrQeEuYUx5UFXshRcFUw == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvdehvddgfedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfvhffutgfgsehtjeertd dtfeejnecuhfhrohhmpefvohhmucfhihhtiihhvghnrhihuceothhomhesthhomhdqfhhi thiihhgvnhhrhidrmhgvrdhukheqnecuggftrfgrthhtvghrnhepgeeludejkeeigffhle eiheeuleevkeekhfffffeiudeguedtgfehtefhtdeiieeinecuffhomhgrihhnpehgnhhu rdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epthhomhesthhomhdqfhhithiihhgvnhhrhidrmhgvrdhukh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 1 Nov 2021 07:39:51 -0400 (EDT) Message-ID: <9da03290-b031-fec0-11fe-a3f591b38f61@tom-fitzhenry.me.uk> Date: Mon, 1 Nov 2021 22:39:48 +1100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.2 Content-Language: en-US To: guix-patches@gnu.org From: Tom Fitzhenry Subject: [PATCH] services: Create /run and /var/run on activation. Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=66.111.4.25; envelope-from=tom@tom-fitzhenry.me.uk; helo=out1-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham 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 (--) This is needed as part of being able to boot with just /boot, /guix and /var/guix, per https://issues.guix.gnu.org/51547. Without this patch, activation-on-boot fails due to the inability to open /var/run/utmpx and symlink /run/current-system. This is similar to what activation-script does with /var/log/. * gnu/services.scm (activation-script): Create /run/ and /var/run/. --- gnu/services.scm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gnu/services.scm b/gnu/services.scm index 1655218f2d..f60d7dc4c3 100644 --- a/gnu/services.scm +++ b/gnu/services.scm @@ -620,6 +620,7 @@ (define actions ;; Make sure the user accounting database exists. If it ;; does not exist, 'setutxent' does not create it and ;; thus there is no accounting at all. + (mkdir-p "/var/run") (close-port (open-file "/var/run/utmpx" "a0")) ;; Same for 'wtmp', which is populated by mingetty et @@ -630,6 +631,7 @@ (define actions ;; Set up /run/current-system. Among other things this ;; sets up locales, which the activation snippets ;; executed below may expect. + (mkdir-p "/run") (activate-current-system) ;; Run the services' activation snippets. -- 2.33.1 From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 04 03:00:45 2021 Received: (at submit) by debbugs.gnu.org; 4 Nov 2021 07:00:45 +0000 Received: from localhost ([127.0.0.1]:41894 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1miWjs-0004fU-Rb for submit@debbugs.gnu.org; Thu, 04 Nov 2021 03:00:45 -0400 Received: from lists.gnu.org ([209.51.188.17]:40816) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1miWjr-0004fN-7C for submit@debbugs.gnu.org; Thu, 04 Nov 2021 03:00:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53812) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1miWjq-0002pB-Pn for guix-patches@gnu.org; Thu, 04 Nov 2021 03:00:42 -0400 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:51397) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1miWjd-0001IK-H9 for guix-patches@gnu.org; Thu, 04 Nov 2021 03:00:42 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id E4DD83200F6F for ; Thu, 4 Nov 2021 03:00:25 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 04 Nov 2021 03:00:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= tom-fitzhenry.me.uk; h=message-id:date:mime-version:from:to :references:subject:in-reply-to:content-type :content-transfer-encoding; s=fm3; bh=MkgRRp/1jSyADdrVz6M9tSmbHn 4K2qBIgdwOWdUUrig=; b=rZUv3XImthn5Arc+xwiSXt0wIHE2k6yC/Llcyiwp5z /gEMn7hPUwS6NNjbqZFNAW38nEDynC0mEfxGOmxSwYW2JsZHoimEIjsoOL62scLu tcfRo0q44FzWaPb+CVX9Vyz+zeMieul3D2Yp0TXI/saQHlGyhjdcAR2kV8S2QfSp AaoKHMnZD9i9EEtihQiI3bS1gX5+EoI/qtqJL7At/jNPzWwuz677LGkLW8bXcVWv tLeSoTDSDb6e9C4VyrLgnbZwq+scWyicSSwr1Im4txPH9JGUy3M3LCVkJGWMGZnf 3e2sM+Pk/Zv39bw/vaiv3nD8sVAdeIwVLNvHk6uhT2Tw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=MkgRRp/1jSyADdrVz6M9tSmbHn4K2qBIgdwOWdUUr ig=; b=iNi020Ck++DGM/W0w9WAkfQ72oSTVUJPfqoyKA2JCME1GpPoPivxp/sh8 mvdWsttODQRnC08nd2A+ilCiITWKj3f3oPLudBZLx9hfSDs2IZqgSvtPdKA6cs3n 8NBJUlARO4TiBFTJEY+5AZTJD5cccezcGnMuYxlklTkHozEVo3j6RspeeutQbpn3 UN/lDw4yiWy9njUHFRF6/Qh/uRb8Krj3D2dKHWVRfUp8iQF7BuzKPR7NhtZeN8YZ geH3LsOZqnKUAJMbVtShHBexmSgAUqJMBYMQK4zJWf75EGVbLWTsX6zsRKWUFn9G aGUXcN6r/Y82ouGfcw4A9r48AmylA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrtdefgdelkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfhffvfhfujggtgfesthekre dttdefjeenucfhrhhomhepvfhomhcuhfhithiihhgvnhhrhicuoehtohhmsehtohhmqdhf ihhtiihhvghnrhihrdhmvgdruhhkqeenucggtffrrghtthgvrhhnpeettdejfeekieehhf egkeeludejieehheethffgudehleevteefheekuedtieffgfenucffohhmrghinhepghhn uhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehtohhmsehtohhmqdhfihhtiihhvghnrhihrdhmvgdruhhk X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 4 Nov 2021 03:00:24 -0400 (EDT) Message-ID: <02ac6d0b-6229-0b52-6e97-bc5adee0ff37@tom-fitzhenry.me.uk> Date: Thu, 4 Nov 2021 18:00:18 +1100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.2 Content-Language: en-US From: Tom Fitzhenry To: guix-patches@gnu.org References: <9da03290-b031-fec0-11fe-a3f591b38f61@tom-fitzhenry.me.uk> Subject: Re: [PATCH] services: Create /run and /var/run on activation. In-Reply-To: <9da03290-b031-fec0-11fe-a3f591b38f61@tom-fitzhenry.me.uk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=64.147.123.25; envelope-from=tom@tom-fitzhenry.me.uk; helo=wout2-smtp.messagingengine.com X-Spam_score_int: -55 X-Spam_score: -5.6 X-Spam_bar: ----- X-Spam_report: (-5.6 / 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, NICE_REPLY_A=-3.528, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.5 (-) 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.5 (--) Having thought about this patch some more, I think it can be better done. On 1/11/21 22:39, Tom Fitzhenry wrote: >                        ;; thus there is no accounting at all. > +                      (mkdir-p "/var/run") This line will create /var/run if it doesn't exist during activation. This is safe, but there is already code that creates /var/run : https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/build/install.scm?id=63c356fe13f0c7cc560a1f9aeec4926422c22137#n120 . This runs on installation. By adding this line, this responsibility is split across two parts of the code base: installation and activation. This could cause confusion. If, as this patch intends, we want to be able to boot from just /boot, /gnu and /var/guix, perhaps we should move https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/build/install.scm?id=63c356fe13f0c7cc560a1f9aeec4926422c22137#n120 (and surrounding code) from running at install-time to running at activation-time.