[systemd-devel] systemd-nspawn isolation potentially causing issues with distccmon-text
John
graysky at archlinux.us
Tue Nov 19 18:13:05 UTC 2019
Thank you for the reply. I believe the container is being invoked from
a user session. I am unclear how to set the containername. The Arch
tools are invoking systemd-nspawn like this:
exec ${CARCH:+setarch "$CARCH"} systemd-nspawn -q \
-D "$working_dir" \
-E "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin" \
--register=no --keep-unit --as-pid2 \
"${mount_args[@]}" \
"$@"
I tried appending a -M name into that mix but got these errors. Can
you recommend a workaround for either the script or the systemd-run
command?
"--keep-unit --register=yes may not be used when invoked from a user session."
On Tue, Nov 19, 2019 at 4:14 AM Lennart Poettering
<lennart at poettering.net> wrote:
>
> On Fr, 15.11.19 17:17, John (graysky at archlinux.us) wrote:
>
> > The container is created by one of the Arch Linux build scripts
> > (https://git.archlinux.org/devtools.git/tree/arch-nspawn.in). I do
> > not believe it runs with its own systemd/dbus. When I am compiling
> > (https://git.archlinux.org/devtools.git/tree/makechrootpkg.in) in the
> > container, is there a way I can run distccmon-text from within the
> > same container to get it to read the same PID values?
>
> No this doesn't work. PID namespacing is kinda at the core of what a
> container is, making them match in the host and container's view isn't
> really feasible.
>
> (You should be able to run your distcc tool inside the container
> though, with systemd-run --pipe -M <containername> …)
>
> Sorry!
>
> Lennart
>
> --
> Lennart Poettering, Berlin
More information about the systemd-devel
mailing list