[systemd-devel] [PATCH] units: add [Install] blocks for the binfmt_misc units

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Fri Sep 6 07:50:49 PDT 2013


On Fri, Sep 06, 2013 at 03:19:47PM +0100, Ross Burton wrote:
> If the administrator disables systemd-binfmt it can't be re-enabled correctly
> because there is no [Install] block, the symlinks to sysinit being created at
> install time manually.  Add an Install block so that the those symlinks can be
> re-created using systemctl, and a dependency on the automounter in
> systemd-binfmt.
Idea sounds good.

> Signed-off-by: Ross Burton <ross.burton at intel.com>
We don't use that.

> ---
>  units/proc-sys-fs-binfmt_misc.automount |    3 +++
>  units/systemd-binfmt.service.in         |    4 ++++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/units/proc-sys-fs-binfmt_misc.automount b/units/proc-sys-fs-binfmt_misc.automount
> index 6be3893..709adef 100644
> --- a/units/proc-sys-fs-binfmt_misc.automount
> +++ b/units/proc-sys-fs-binfmt_misc.automount
> @@ -16,3 +16,6 @@ ConditionPathIsReadWrite=/proc/sys/
>  
>  [Automount]
>  Where=/proc/sys/fs/binfmt_misc
> +
> +[Install]
> +WantedBy=sysinit.target
> diff --git a/units/systemd-binfmt.service.in b/units/systemd-binfmt.service.in
> index 02dfe77..86d3481 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
> +Wants=proc-sys-fs-binfmt_misc.automount
Can you replace this by RequiresMountsFor=/proc/sys/fs/binfmt_misc ?
That seems cleaner, and also generates better dependencies: Requires and
After. It won't work at all without the mount, so Requires is better,
and without After there's a race condtion.

I'd commit it with this change myself, but I don't currently have the means
to test if everything still works.

Zbyszek


More information about the systemd-devel mailing list