Re: [systemd-devel] systemd-container: Trying to use a bookworm chroot with a buster host fails / Failed to create /init.scope control group

2022-10-16 Thread Michael Biebl
Host system: Debian bookworm, systemd v241 (default-hierarchy=hybrid)

container (systemd compiled with default-hierarchy=unified)

v247: works
v248: works
v249: works
v250: fails, with the aforementioned error

So something apparently regressed between v249 and v250.

Am Mo., 17. Okt. 2022 um 01:38 Uhr schrieb Michael Biebl :
>
> What are you Missing?
>
> Lennart Poettering  schrieb am So., 16. Okt. 2022, 
> 23:45:
>>
>> On So, 16.10.22 21:02, Michael Biebl (mbi...@gmail.com) wrote:
>>
>> > Am So., 16. Okt. 2022 um 16:23 Uhr schrieb Lennart Poettering
>> > :
>> > >
>> > > On Fr, 14.10.22 22:57, Michael Biebl (mbi...@gmail.com) wrote:
>> > >
>> > > > Hi,
>> > > >
>> > > > since the issue came up on the Debian bug tracker at
>> > > > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1019147 , I figured
>> > > > I ask here:
>> > >
>> > > Do you have any MACs in effect?
>> >
>> > No SELinux or Apparmor active
>> >
>> > > Does the host use cgroupsv2 or cgroupsv2 or hybrid? What is mounted to
>> > > /sys/fs/cgroup and below?
>> >
>> > The host system uses systemd v241, compiled with default-hierarchy=hybrid
>> >
>> >
>> > > Was the container configured to use either?
>> >
>> > The container uses systemd v251 with default-hierarchy=unified
>> >
>> > Trying to boot this container v251 container via systemd-nspawn leads to
>> >
>> > Welcome to Debian GNU/Linux bookworm/sid!
>> >
>> > Hostname set to .
>> > Failed to create /init.scope control group: Operation not permitted
>> > Failed to allocate manager object: Operation not permitted
>> > [!!] Failed to allocate manager object.
>> > Exiting PID 1...
>> > Container test-bookworm failed with error code 255.
>>
>> Please answer the questions I asked, otherwise not actionable...
>>
>> Lennart
>>
>> --
>> Lennart Poettering, Berlin


Re: [systemd-devel] systemd-container: Trying to use a bookworm chroot with a buster host fails / Failed to create /init.scope control group

2022-10-16 Thread Michael Biebl
What are you Missing?

Lennart Poettering  schrieb am So., 16. Okt. 2022,
23:45:

> On So, 16.10.22 21:02, Michael Biebl (mbi...@gmail.com) wrote:
>
> > Am So., 16. Okt. 2022 um 16:23 Uhr schrieb Lennart Poettering
> > :
> > >
> > > On Fr, 14.10.22 22:57, Michael Biebl (mbi...@gmail.com) wrote:
> > >
> > > > Hi,
> > > >
> > > > since the issue came up on the Debian bug tracker at
> > > > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1019147 , I
> figured
> > > > I ask here:
> > >
> > > Do you have any MACs in effect?
> >
> > No SELinux or Apparmor active
> >
> > > Does the host use cgroupsv2 or cgroupsv2 or hybrid? What is mounted to
> > > /sys/fs/cgroup and below?
> >
> > The host system uses systemd v241, compiled with default-hierarchy=hybrid
> >
> >
> > > Was the container configured to use either?
> >
> > The container uses systemd v251 with default-hierarchy=unified
> >
> > Trying to boot this container v251 container via systemd-nspawn leads to
> >
> > Welcome to Debian GNU/Linux bookworm/sid!
> >
> > Hostname set to .
> > Failed to create /init.scope control group: Operation not permitted
> > Failed to allocate manager object: Operation not permitted
> > [!!] Failed to allocate manager object.
> > Exiting PID 1...
> > Container test-bookworm failed with error code 255.
>
> Please answer the questions I asked, otherwise not actionable...
>
> Lennart
>
> --
> Lennart Poettering, Berlin
>


Re: [systemd-devel] systemd-container: Trying to use a bookworm chroot with a buster host fails / Failed to create /init.scope control group

2022-10-16 Thread Lennart Poettering
On So, 16.10.22 21:02, Michael Biebl (mbi...@gmail.com) wrote:

> Am So., 16. Okt. 2022 um 16:23 Uhr schrieb Lennart Poettering
> :
> >
> > On Fr, 14.10.22 22:57, Michael Biebl (mbi...@gmail.com) wrote:
> >
> > > Hi,
> > >
> > > since the issue came up on the Debian bug tracker at
> > > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1019147 , I figured
> > > I ask here:
> >
> > Do you have any MACs in effect?
>
> No SELinux or Apparmor active
>
> > Does the host use cgroupsv2 or cgroupsv2 or hybrid? What is mounted to
> > /sys/fs/cgroup and below?
>
> The host system uses systemd v241, compiled with default-hierarchy=hybrid
>
>
> > Was the container configured to use either?
>
> The container uses systemd v251 with default-hierarchy=unified
>
> Trying to boot this container v251 container via systemd-nspawn leads to
>
> Welcome to Debian GNU/Linux bookworm/sid!
>
> Hostname set to .
> Failed to create /init.scope control group: Operation not permitted
> Failed to allocate manager object: Operation not permitted
> [!!] Failed to allocate manager object.
> Exiting PID 1...
> Container test-bookworm failed with error code 255.

Please answer the questions I asked, otherwise not actionable...

Lennart

--
Lennart Poettering, Berlin


Re: [systemd-devel] systemd-container: Trying to use a bookworm chroot with a buster host fails / Failed to create /init.scope control group

2022-10-16 Thread Michael Biebl
Am So., 16. Okt. 2022 um 16:23 Uhr schrieb Lennart Poettering
:
>
> On Fr, 14.10.22 22:57, Michael Biebl (mbi...@gmail.com) wrote:
>
> > Hi,
> >
> > since the issue came up on the Debian bug tracker at
> > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1019147 , I figured
> > I ask here:
>
> Do you have any MACs in effect?

No SELinux or Apparmor active

> Does the host use cgroupsv2 or cgroupsv2 or hybrid? What is mounted to
> /sys/fs/cgroup and below?

The host system uses systemd v241, compiled with default-hierarchy=hybrid


> Was the container configured to use either?

The container uses systemd v251 with default-hierarchy=unified

Trying to boot this container v251 container via systemd-nspawn leads to

Welcome to Debian GNU/Linux bookworm/sid!

Hostname set to .
Failed to create /init.scope control group: Operation not permitted
Failed to allocate manager object: Operation not permitted
[!!] Failed to allocate manager object.
Exiting PID 1...
Container test-bookworm failed with error code 255.


Re: [systemd-devel] user unit with delayed users homes mount - ?

2022-10-16 Thread Lennart Poettering
On Fr, 14.10.22 10:59, lejeczek (pelj...@yahoo.co.uk) wrote:

> Hi guys.
>
> I'm on Centos 8 S with systemd 239.
> Users homes are mounted at later (latest?) stage off NFS so when such a user
> logs in then:
>
> -> $ systemctl --user status -l xyz.service
> Unit xyz.service could not be found.
> -> $ systemctl --user daemon-reload
> -> $ systemctl --user status -l xyz.service
> ● xyz.service - Podman container-xyz.service
>    Loaded: loaded (/apps/appownia/.config/systemd/user/xyz.service; enabled;
> vendor preset: enabled)
>    Active: inactive (dead)
>  Docs: man:podman-generate-systemd(1)
>
> Is it possible and if so then how, to make "systemd" account for such a
> "simple" case - where home dir is net mounted very late?

I don't get this scenario. You talk to the systemd --user instance,
which is the per-user instance, so $HOME of that user should be
mounted at that time. But then you issue a reload and new stuff
appears and you appear to suggest that now the user's $HOME was
mounted?

So what now? Usually, the assumption is that first the user logs in,
which is the point where $HOME must be mounted at the latest, and then
systemd --user gets started off it and the user's login session is
allowed to begin.

Lennart

--
Lennart Poettering, Berlin


Re: [systemd-devel] systemd-container: Trying to use a bookworm chroot with a buster host fails / Failed to create /init.scope control group

2022-10-16 Thread Lennart Poettering
On Fr, 14.10.22 22:57, Michael Biebl (mbi...@gmail.com) wrote:

> Hi,
>
> since the issue came up on the Debian bug tracker at
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1019147 , I figured
> I ask here:

Do you have any MACs in effect?

Does the host use cgroupsv2 or cgroupsv2 or hybrid? What is mounted to
/sys/fs/cgroup and below?

Was the container configured to use either?

This is new payload on old host?

if you force container into cgroupsv1 mode as the host (by adding
systemd.unified_cgroup_hierarchy=no to the nspawn cmdline, does that
work?

Generally, systemd should discover everything on its own and just work
when run in an older container manager/cgroup environment. But it's
not something we would regularly test.

Lennart

--
Lennart Poettering, Berlin


Re: [systemd-devel] Finding network interface name in different distro

2022-10-16 Thread Lennart Poettering
On Fr, 14.10.22 22:24, Etienne Champetier (champetier.etie...@gmail.com) wrote:

> Le ven. 14 oct. 2022 à 20:41, Etienne Champetier
>  a écrit :
> >
> > Hi All,
> >
> > When changing distro or distro major versions, network interfaces'
> > names sometimes change.
> > For example on some Dell server running CentOS 7 the interface is
> > named em1 and running Alma 8 it's eno1.
> >
> > I'm looking for a way to find the new interface name in advance
> > without booting the new OS.
> > One way I found is to unpack the initramfs, mount bind /sys, chroot,
> > and then run
> > udevadm test-builtin net_id /sys/class/net/INTF
> > Problem is that it doesn't give me right away the name according to
> > the NamePolicy in 99-default.link
> >
> > Is there a command to get the future name right away ?
>
> I think I found what I need:
> bash-4.4# udevadm test /sys/class/net/em1 2>/dev/null | awk  -F=
> '/ID_NET_NAME=/ {print $2}'
> eno1

The name depends on local and distro policy, systemd version,
kernel version and selected network naming scheme level (see
systemd.net-naming-scheme man page)

Use "udevadm info /sys/class/net/" to query the udev db for
automatically generated names.

Relevant udev props to look out for are:

ID_NET_NAME_FROM_DATABASE
ID_NET_NAME_ONBOARD
ID_NET_NAME_SLOT
ID_NET_NAME_PATH
ID_NET_NAME_MAC

These using hwdb info, firmware info, slot info, device path info or
MAC addresss for naming.

Lennart

--
Lennart Poettering, Berlin