Re: PG in container w/ pid namespace is init, process exits cause restart - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: PG in container w/ pid namespace is init, process exits cause restart
Date
Msg-id 20210503195307.GA13060@alvherre.pgsql
Whole thread Raw
In response to Re: PG in container w/ pid namespace is init, process exits cause restart  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 2021-May-03, Tom Lane wrote:

> Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> > I also heard a story where things ran into trouble (I didn't get the
> > whole story of *what* was the problem with that) because the datadir is /.
> 
> BTW, as far as that goes, I think the general recommendation is that
> the datadir shouldn't be a mount point, because bad things happen if
> you mount or unmount the drive while the postmaster is up.  I could
> see enforcing that, if we could find a reasonably platform-independent
> way to do it.

/ is not a mount point; it's just that the container system binds (?)
some different directory as / for the process to run into.  I suppose it
must be similar to chrooting to /, but I'm not sure if it's exactly
that.

> (Of course, / can't be unmounted, so I wonder exactly what bad thing
> happened in that story.)

It's not related to unmounting.  I'll try to get the details.

-- 
Álvaro Herrera       Valdivia, Chile



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: MaxOffsetNumber for Table AMs
Next
From: Andres Freund
Date:
Subject: Re: PG in container w/ pid namespace is init, process exits cause restart