mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: Ian Abbott <abbotti@mev.co.uk>
Cc: ptxdist <ptxdist@pengutronix.de>
Subject: Re: [ptxdist] Race condition between rc-once.service and systemd-remount-fs.service
Date: Thu, 9 May 2024 11:34:13 +0200	[thread overview]
Message-ID: <ZjyYlWvT6BP_BMmF@pengutronix.de> (raw)
In-Reply-To: <bee78d99-7c3a-4fea-8416-99d18ebb82ed@mev.co.uk>

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 |



  reply	other threads:[~2024-05-09  9:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-03 18:33 Ian Abbott
2024-05-09  9:34 ` Michael Olbrich [this message]
2024-05-09 11:40   ` Ian Abbott

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZjyYlWvT6BP_BMmF@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --cc=abbotti@mev.co.uk \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox