]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
units: use SuccessExitStatus to ignore syntax errors in tmpfiles
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 22 Nov 2017 13:18:25 +0000 (14:18 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 1 Dec 2017 17:58:54 +0000 (18:58 +0100)
This makes sense from the point of view of the whole distribution:
if there are some specific files that have syntax problems, or unknown
users or groups, or use unsupported features, failing the whole service
is not useful.

In particular, services with tmpfiles --boot should not be started after boot.
The premise of --boot is that there are actions which are only safe to do once
during boot, because the state evolves later through other means and re-running
the boot-time setup would destroy it. If services with --boot fail in the
initial transaction, they would be re-run later on when a unit which
(indirectly) depends on them is started, causing problems.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1507501.

(If we had a mode where a service would at most run once, and would not be
started in subsequent transactions, that'd be a good additional safeguard.
Using ExecStart=-... is a bit like that, but it causes all failure to be
ignored, which is too big of a hammer.)

units/systemd-tmpfiles-clean.service.in
units/systemd-tmpfiles-setup-dev.service.in
units/systemd-tmpfiles-setup.service.in

index 5963cf27fbd30122dd90cdbb3d0b620038924c7b..d1025afadb4d34ca16f69b9173e686a61b0722c4 100644 (file)
@@ -18,4 +18,5 @@ Before=shutdown.target
 [Service]
 Type=oneshot
 ExecStart=@rootbindir@/systemd-tmpfiles --clean
+SuccessExitStatus=65
 IOSchedulingClass=idle
index 29b4f0bec033bc8083237b94890289ee6bbe3e9f..6a6ebed9550131f0c617ada5dd5b4d45dcdb18c2 100644 (file)
@@ -20,3 +20,4 @@ ConditionCapability=CAP_SYS_MODULE
 Type=oneshot
 RemainAfterExit=yes
 ExecStart=@rootbindir@/systemd-tmpfiles --prefix=/dev --create --boot
+SuccessExitStatus=65
index ba24b8d8237533d55826a6efb6e7e31bb13a5f77..0410d0bfd8596b66da7d38b090250d04b1313df6 100644 (file)
@@ -20,3 +20,4 @@ RefuseManualStop=yes
 Type=oneshot
 RemainAfterExit=yes
 ExecStart=@rootbindir@/systemd-tmpfiles --create --remove --boot --exclude-prefix=/dev
+SuccessExitStatus=65