[systemd-devel] [PATCH 2/2] units: add RequiresMountsFor=/usr/… to various systemd service files

Jon Severinsson jon at severinsson.net
Mon Jul 21 15:39:14 PDT 2014


Unless both /usr and /usr/local is mounted in the initrd these
services might miss some of their configuration otherwise.
---
 units/systemd-binfmt.service.in         | 1 +
 units/systemd-modules-load.service.in   | 1 +
 units/systemd-sysctl.service.in         | 1 +
 units/systemd-sysusers.service.in       | 1 +
 units/systemd-timedated.service.in      | 1 +
 units/systemd-tmpfiles-setup.service.in | 1 +
 6 files changed, 6 insertions(+)

diff --git a/units/systemd-binfmt.service.in b/units/systemd-binfmt.service.in
index 02dfe77..a8fe42e 100644
--- a/units/systemd-binfmt.service.in
+++ b/units/systemd-binfmt.service.in
@@ -11,6 +11,7 @@ Documentation=man:systemd-binfmt.service(8) man:binfmt.d(5)
 Documentation=https://www.kernel.org/doc/Documentation/binfmt_misc.txt
 DefaultDependencies=no
 Conflicts=shutdown.target
+RequiresMountsFor=/usr/lib/binfmt.d /usr/local/lib/binfmt.d
 After=systemd-readahead-collect.service systemd-readahead-replay.service proc-sys-fs-binfmt_misc.automount
 Before=sysinit.target shutdown.target
 ConditionPathIsReadWrite=/proc/sys/
diff --git a/units/systemd-modules-load.service.in b/units/systemd-modules-load.service.in
index 32deb52..0619037 100644
--- a/units/systemd-modules-load.service.in
+++ b/units/systemd-modules-load.service.in
@@ -10,6 +10,7 @@ Description=Load Kernel Modules
 Documentation=man:systemd-modules-load.service(8) man:modules-load.d(5)
 DefaultDependencies=no
 Conflicts=shutdown.target
+RequiresMountsFor=/usr/lib/modules-load.d /usr/local/lib/modules-load.d
 After=systemd-readahead-collect.service systemd-readahead-replay.service
 Before=sysinit.target shutdown.target
 ConditionCapability=CAP_SYS_MODULE
diff --git a/units/systemd-sysctl.service.in b/units/systemd-sysctl.service.in
index ade9dc3..a40bd12 100644
--- a/units/systemd-sysctl.service.in
+++ b/units/systemd-sysctl.service.in
@@ -10,6 +10,7 @@ Description=Apply Kernel Variables
 Documentation=man:systemd-sysctl.service(8) man:sysctl.d(5)
 DefaultDependencies=no
 Conflicts=shutdown.target
+RequiresMountsFor=/usr/lib/sysctl.d /usr/local/lib/sysctl.d
 After=systemd-readahead-collect.service systemd-readahead-replay.service
 After=systemd-modules-load.service
 Before=sysinit.target shutdown.target
diff --git a/units/systemd-sysusers.service.in b/units/systemd-sysusers.service.in
index 69fea11..d7fb678 100644
--- a/units/systemd-sysusers.service.in
+++ b/units/systemd-sysusers.service.in
@@ -10,6 +10,7 @@ Description=Create System Users
 Documentation=man:sysusers.d(5) man:systemd-sysusers.service(8)
 DefaultDependencies=no
 Conflicts=shutdown.target
+RequiresMountsFor=/usr/lib/sysusers.d /usr/local/lib/sysusers.d
 After=systemd-readahead-collect.service systemd-readahead-replay.service systemd-remount-fs.service
 Before=sysinit.target shutdown.target systemd-update-done.service
 ConditionNeedsUpdate=/etc
diff --git a/units/systemd-timedated.service.in b/units/systemd-timedated.service.in
index fe5ccb4..6385738 100644
--- a/units/systemd-timedated.service.in
+++ b/units/systemd-timedated.service.in
@@ -9,6 +9,7 @@
 Description=Time & Date Service
 Documentation=man:systemd-timedated.service(8) man:localtime(5)
 Documentation=http://www.freedesktop.org/wiki/Software/systemd/timedated
+RequiresMountsFor=/usr/share/zoneinfo
 
 [Service]
 ExecStart=@rootlibexecdir@/systemd-timedated
diff --git a/units/systemd-tmpfiles-setup.service.in b/units/systemd-tmpfiles-setup.service.in
index 72ab083..b968e83 100644
--- a/units/systemd-tmpfiles-setup.service.in
+++ b/units/systemd-tmpfiles-setup.service.in
@@ -10,6 +10,7 @@ Description=Create Volatile Files and Directories
 Documentation=man:tmpfiles.d(5) man:systemd-tmpfiles(8)
 DefaultDependencies=no
 Conflicts=shutdown.target
+RequiresMountsFor=/usr/lib/tmpfiles.d /usr/local/lib/tmpfiles.d
 After=systemd-readahead-collect.service systemd-readahead-replay.service local-fs.target systemd-sysusers.service
 Before=sysinit.target shutdown.target
 RefuseManualStop=yes
-- 
2.0.1



More information about the systemd-devel mailing list