Re: -o remount,ro /

From: Eric Vidal <eric_at_obarun.org>
Date: Fri, 13 May 2016 20:41:47 +0400

On Fri, 13 May 2016 17:38:15 +0200
Laurent Bercot <ska-skaware_at_skarnet.org> wrote:

> On 13/05/2016 16:34, Eric Vidal wrote:
> > i forgot :
> >
> > what puzzle me, if i do this in console (so i'm on tty1 just after the booting ) :
> > mount -o remount,ro /
> >
> > all works fine without trouble
>
> Got it.
>
> When you run s6-rc, it takes a lock on the database.
> However, if the database is on a read-only filesystem, it cannot take the
> lock (because it needs a writing fd for that), but ignores the error because
> nothing is going to modify the database on a read-only filesystem anyway.
>
> If your stage 2 runs s6-rc while your / is rw, then it will take a lock on
> the database; attempting to remount / ro in a script run by s6-rc will fail,
> because that lock is preventing you from doing that.
>
> Just boot with your / ro already. s6-rc will not grab a lock and everything
> will be fine. Note that if you then remount / rw and proceed to modify the
> current compiled database while s6-rc is still running, you will be asking
> for trouble, and pretty likely to get it.
>
> --
> Laurent
>

ok, i understand the trouble.
> Just boot with your / ro already

i have made it. It works yes, but if i want a service like syslogd-linux (or any other service which need to read/write on /) started at the end of the init script by s6-svcscan with the / mounted on ro, the syslogd service fail, because it can write the log on e.g. /var/log/. So the service must wait until the / is mounted rw.

Anyway thank for your time and explanation. i will try to find a solution

-- 
Eric Vidal <eric_at_obarun.org>
Received on Fri May 13 2016 - 16:41:47 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC