[Bug 1752722] Re: systemd 237 reports incorrect state when drop-in present
Brian Moyles
1752722 at bugs.launchpad.net
Thu Mar 1 22:30:46 UTC 2018
This does not appear to affect Artful and systemd 234. Example session:
~# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=17.10
DISTRIB_CODENAME=artful
DISTRIB_DESCRIPTION="Ubuntu 17.10"
~# uname -a
Linux ip-100-65-137-86 4.13.0-36-generic #40-Ubuntu SMP Fri Feb 16 20:07:48 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
~# systemctl --version
systemd 234
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN default-hierarchy=hybrid
~# systemctl daemon-reload
~# systemctl list-unit-files test-mask.service
0 unit files listed.
~# cat <<EOF > /lib/systemd/system/test-mask.service
> [Unit]
> Description=dummy service
>
> [Service]
> Type=oneshot
> ExecStart=/bin/true
>
> [Install]
> WantedBy=multi-user.target
>
> EOF
~# systemctl daemon-reload
~# systemctl list-unit-files test-mask.service; echo '**'; systemctl is-enabled test-mask.service; echo '**'; systemctl status test-mask.service
UNIT FILE STATE
test-mask.service disabled
1 unit files listed.
**
disabled
**
● test-mask.service - dummy service
Loaded: loaded (/lib/systemd/system/test-mask.service; disabled; vendor preset: enabled)
Active: inactive (dead)
~# systemctl enable test-mask.service
Created symlink /etc/systemd/system/multi-user.target.wants/test-mask.service → /lib/systemd/system/test-mask.service.
~# systemctl list-unit-files test-mask.service; echo '**'; systemctl is-enabled test-mask.service; echo '**'; systemctl status test-mask.service
UNIT FILE STATE
test-mask.service enabled
1 unit files listed.
**
enabled
**
● test-mask.service - dummy service
Loaded: loaded (/lib/systemd/system/test-mask.service; enabled; vendor preset: enabled)
Active: inactive (dead)
~# systemctl list-unit-files test-mask.service; echo '**'; systemctl is-enabled test-mask.service; echo '**'; systemctl status test-mask.service
UNIT FILE STATE
test-mask.service masked
1 unit files listed.
**
masked
**
● test-mask.service
Loaded: masked (/dev/null; bad)
Active: inactive (dead)
~# systemctl unmask test-mask.service
Removed /etc/systemd/system/test-mask.service.
~# mkdir -p /etc/systemd/system/test-mask.service.d
~# cat <<EOF > /etc/systemd/system/test-mask.service.d/override.conf
> # Arbitrary override for the sake of demonstration
> [Unit]
> After=ssh.service
>
> EOF
~# systemctl daemon-reload
~# systemctl cat test-mask.service
# /lib/systemd/system/test-mask.service
[Unit]
Description=dummy service
[Service]
Type=oneshot
ExecStart=/bin/true
[Install]
WantedBy=multi-user.target
# /etc/systemd/system/test-mask.service.d/override.conf
# Arbitrary override for the sake of demonstration
[Unit]
After=ssh.service
~# systemctl list-unit-files test-mask.service; echo '**'; systemctl is-enabled test-mask.service; echo '**'; systemctl status test-mask.service
UNIT FILE STATE
test-mask.service enabled
1 unit files listed.
**
enabled
**
● test-mask.service - dummy service
Loaded: loaded (/lib/systemd/system/test-mask.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/test-mask.service.d
└─override.conf
Active: inactive (dead)
~# systemctl mask test-mask.service
Created symlink /etc/systemd/system/test-mask.service → /dev/null.
~# systemctl list-unit-files test-mask.service; echo '**'; systemctl is-enabled test-mask.service; echo '**'; systemctl status test-mask.service
UNIT FILE STATE
test-mask.service masked
1 unit files listed.
**
masked
**
Warning: test-mask.service changed on disk. Run 'systemctl daemon-reload' to reload units.
● test-mask.service
Loaded: masked (/dev/null; bad)
Active: inactive (dead)
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1752722
Title:
systemd 237 reports incorrect state when drop-in present
Status in systemd package in Ubuntu:
Confirmed
Bug description:
Raised this upstream:
https://github.com/systemd/systemd/issues/8328
In short, in systemd 237 as it ships with Bionic, if a unit has a
drop-in present but has been masked, systemctl is-enabled and
systemctl list-unit-files report incorrect state, showing the units as
enabled rather than masked.
This works as-expected in systemd 229 under Xenial. I have not tested
under systemd 234 in artful so I cannot say for sure exactly when this
was introduced, but will spin up a quick test to see if this also
exists under systemd 234.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1752722/+subscriptions
More information about the foundations-bugs
mailing list