Skip to content

Default presets contain contradicting policies #25459

@WhyNotHugo

Description

@WhyNotHugo

systemd version the issue has been seen with

252

Used distribution

ArchLinux / AsahiLinux

Linux kernel version used

6.1.0-rc5-asahi-11-1-ARCH

CPU architectures issue was seen on

aarch64

Component

systemd

Expected behaviour you didn't see

If I run systemctl preset-all twice in a row, the second run should change nothing.

Unexpected behaviour you saw

The second run always disables and re-enabled some units. This adds noise trying to interpret the output of preset-all (e.g.: it seems that changes were made when they are not).

Steps to reproduce the problem

systemctl preset-all

The issue stems from presets/90-systemd.preset, which contains the following two lines:

enable systemd-networkd.service
disable systemd-networkd-wait-online.service

But systemd-networkd.service includes:

Also=systemd-networkd-wait-online.service

This results in systemd-networkd-wait-online.service being disabled and re-enabled every time presets run. There are in total three instances of this "quirk", so systemd preset-all will print out six lines of changes which are effectively no-op every time it gets run.

Additional program output to the terminal or log subsystem illustrating the issue

> sudo systemctl preset-all 
Removed "/etc/systemd/system/sockets.target.wants/systemd-networkd.socket".
Removed "/etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service".
Removed "/etc/systemd/system/systemd-homed.service.wants/systemd-homed-activate.service".
Created symlink /etc/systemd/system/systemd-homed.service.wants/systemd-homed-activate.service → /usr/lib/systemd/system/systemd-homed-activate.service.
Created symlink /etc/systemd/system/sockets.target.wants/systemd-networkd.socket → /usr/lib/systemd/system/systemd-networkd.socket.
Created symlink /etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service → /usr/lib/systemd/system/systemd-networkd-wait-online.service.

> sudo systemctl preset-all
Removed "/etc/systemd/system/sockets.target.wants/systemd-networkd.socket".
Removed "/etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service".
Removed "/etc/systemd/system/systemd-homed.service.wants/systemd-homed-activate.service".
Created symlink /etc/systemd/system/systemd-homed.service.wants/systemd-homed-activate.service → /usr/lib/systemd/system/systemd-homed-activate.service.
Created symlink /etc/systemd/system/sockets.target.wants/systemd-networkd.socket → /usr/lib/systemd/system/systemd-networkd.socket.
Created symlink /etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service → /usr/lib/systemd/system/systemd-networkd-wait-online.service.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions