systemd 237 reports incorrect state when drop-in present

Bug #1752722 reported by Brian Moyles
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
systemd
Fix Released
Unknown
systemd (Ubuntu)
Fix Released
High
Unassigned
Bionic
Fix Released
High
Unassigned

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.

Revision history for this message
Brian Moyles (bmoyles) wrote :
Download full text (3.6 KiB)

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: ...

Read more...

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in systemd (Ubuntu):
status: New → Confirmed
Scott Emmons (lscotte)
tags: added: bionic
Revision history for this message
Brian Moyles (bmoyles) wrote :

It looks like this was fixed upstream and it would be fantastic if this could make it into Bionic before anything is frozen.

Changed in systemd:
status: Unknown → Fix Released
Revision history for this message
Steve Langasek (vorlon) wrote :
Changed in systemd (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → High
tags: added: id-5a998e676a158b97f18ebdc0
Changed in systemd (Ubuntu Bionic):
status: Triaged → Fix Committed
tags: added: id-5ab94db18b8ce4cc5b39a518
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 237-3ubuntu6

---------------
systemd (237-3ubuntu6) bionic; urgency=medium

  * Adjust the new dropin test, for v237 systemd.
  * Refresh the keyring patch, to the one merged.

 -- Dimitri John Ledkov <email address hidden> Tue, 27 Mar 2018 13:40:09 +0100

Changed in systemd (Ubuntu Bionic):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.