Skip to content

Commit

Permalink
systemd/system/ensure-sysext: skip unit if systemd-sysext is skipped
Browse files Browse the repository at this point in the history
The unit failed to execute when the dependency systemd-sysext.service
was skipped because it's not needed. Normally this is harmless but it
still triggers a OnFailure event as reported in
flatcar/Flatcar#710

Use the same logic for skipping execution as done in
systemd-sysext.service - we can't use "systemctl is-enabled" because
Flatcar's inbuilt unit symlinks are not reported as "enabled".
  • Loading branch information
pothos committed Apr 12, 2022
1 parent d76453b commit ccade77
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions systemd/system/ensure-sysext.service
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
BindsTo=systemd-sysext.service
After=systemd-sysext.service
DefaultDependencies=no
# Keep in sync with systemd-sysext.service
ConditionDirectoryNotEmpty=|/etc/extensions
ConditionDirectoryNotEmpty=|/run/extensions
ConditionDirectoryNotEmpty=|/var/lib/extensions
ConditionDirectoryNotEmpty=|/usr/local/lib/extensions
ConditionDirectoryNotEmpty=|/usr/lib/extensions
[Service]
Type=oneshot
RemainAfterExit=yes
Expand Down

0 comments on commit ccade77

Please sign in to comment.