From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Thu, 09 May 2024 11:34:35 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1s50Ad-004wdf-15 for lore@lore.pengutronix.de; Thu, 09 May 2024 11:34:35 +0200 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1s50Ac-0003V5-MI; Thu, 09 May 2024 11:34:34 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s50AH-0003Uu-TI; Thu, 09 May 2024 11:34:13 +0200 Received: from [2a0a:edc0:0:1101:1d::54] (helo=dude05.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s50AH-000Qtt-Cv; Thu, 09 May 2024 11:34:13 +0200 Received: from mol by dude05.red.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1s50AH-006XVk-18; Thu, 09 May 2024 11:34:13 +0200 Date: Thu, 9 May 2024 11:34:13 +0200 From: Michael Olbrich To: Ian Abbott Message-ID: Mail-Followup-To: Ian Abbott , ptxdist References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain Subject: Re: [ptxdist] Race condition between rc-once.service and systemd-remount-fs.service X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: ptxdist Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false On Fri, May 03, 2024 at 07:33:32PM +0100, Ian Abbott wrote: > If the root file system is initially mounted read-only, there is a possible > race between rc-once.service and the systemd-remount-fs.service. If > rc-once.service sees the root filesystem is mounted read-only, then it will > temporarily remount it read-write and later mount it read-only again. > Meanwhile, systemd-remount-fs.service will also remount the root file system > as specified by /etc/fstab which could be read-write. Depending on the > ordering, it is possible for the root file-system to end up mounted > read-only when it should have ended up mounted read-write. > > As long as the two services do not run simultaneously, the root file system > should end up mounted in the correct state. However, I do not know what the > intended order is supposed to be. Perhaps it is intentionally > system-dependent? It's not intentional. I just never noticed because I always keep the rootfs read-only by default. I think rc-once.service should have 'After=systemd-remount-fs.service'. That should fix the problem, right? Michael -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |