summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-09-18 12:01:41 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-10-10 14:44:56 +0200
commite151bf467494c042bbfd3a4c47ad83ac8e9df2fd (patch)
tree7172b7a04438e631b878e43deda55ae4e08138fd
parent2b8e574d8242e5d878252e5fc8f26a993a9c794f (diff)
downloadsystemd-e151bf467494c042bbfd3a4c47ad83ac8e9df2fd.tar.gz
units: make systemd-binfmt.service easier to work with no autofs
See https://bugzilla.redhat.com/show_bug.cgi?id=1731772: when autofs4 is disabled in the kernel, proc-sys-fs-binfmt_misc.automount is not started, so the binfmt_misc module is never loaded. If we added a dependency on proc-sys-fs-binfmt_misc.mount to systemd-binfmt.service, things would work even if autofs4 was disabled, but we would unconditionally pull in the module and mount, which we don't want to do. (Right now we ony load the module if some binfmt is configured.) But let's make it easier to handle this case by doing two changes: 1. order systemd-binfmt.service after the .mount unit (so that the .service can count on the mount if both units are pulled in, even if .automount is skipped) 2. add [Install] section to the service unit. This way the user can do 'systemctl enable proc-sys-fs-binfmt_misc.mount' to get the appropriate behaviour. (cherry picked from commit 508133917d9628f8c0adc5db34d595196b72b1c8)
-rw-r--r--units/proc-sys-fs-binfmt_misc.mount3
-rw-r--r--units/systemd-binfmt.service.in1
2 files changed, 4 insertions, 0 deletions
diff --git a/units/proc-sys-fs-binfmt_misc.mount b/units/proc-sys-fs-binfmt_misc.mount
index 66229ec78e..1587853e1e 100644
--- a/units/proc-sys-fs-binfmt_misc.mount
+++ b/units/proc-sys-fs-binfmt_misc.mount
@@ -18,3 +18,6 @@ What=binfmt_misc
Where=/proc/sys/fs/binfmt_misc
Type=binfmt_misc
Options=nosuid,nodev,noexec
+
+[Install]
+WantedBy=sysinit.target
diff --git a/units/systemd-binfmt.service.in b/units/systemd-binfmt.service.in
index e940c7c9ad..0c0f26451b 100644
--- a/units/systemd-binfmt.service.in
+++ b/units/systemd-binfmt.service.in
@@ -15,6 +15,7 @@ Documentation=https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
DefaultDependencies=no
Conflicts=shutdown.target
After=proc-sys-fs-binfmt_misc.automount
+After=proc-sys-fs-binfmt_misc.mount
Before=sysinit.target shutdown.target
ConditionPathIsReadWrite=/proc/sys/
ConditionDirectoryNotEmpty=|/lib/binfmt.d