units: make systemd-binfmt.service easier to work with no autofs
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 18 Sep 2019 10:01:41 +0000 (12:01 +0200)
committerMichael Biebl <biebl@debian.org>
Fri, 15 Nov 2019 21:01:17 +0000 (21:01 +0000)
commitaf36d47ae4996acc35616bacf17efd57f9b50ea5
treec58304f8bbe19af512e81a5cec195a8198cf1827
parenta6f4773bddd6850e3a686d7f1f33413ca75ea41f
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)
(cherry picked from commit e151bf467494c042bbfd3a4c47ad83ac8e9df2fd)

Gbp-Pq: Name units-make-systemd-binfmt.service-easier-to-work-with-no-.patch
units/proc-sys-fs-binfmt_misc.mount
units/systemd-binfmt.service.in