Skip to content

RFE: add Before=local-fs.target to mount units with noauto #4047

Closed

Description

@intelfx

Submission type

  • Bug report
  • Request for enhancement (RFE)

systemd version the issue has been seen with

systemd 231
+PAM -AUDIT -SELINUX -IMA -APPARMOR +SMACK -SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN

Used distribution

Arch Linux

RFE

/etc/crypttab

With /etc/crypttab, an entry with noauto option generates a unit file with following dependencies:

# /run/systemd/generator/[email protected]
# Automatically generated by systemd-cryptsetup-generator

[Unit]
...
DefaultDependencies=no
Conflicts=umount.target
BindsTo=dev-mapper-%i.device
IgnoreOnIsolate=true
After=cryptsetup-pre.target
Before=cryptsetup.target
BindsTo=dev-disk-by\x2duuid-70d37643\x2d7edb\x2d4d4f\x2db8ec\x2d8779012bd690.device
After=dev-disk-by\x2duuid-70d37643\x2d7edb\x2d4d4f\x2db8ec\x2d8779012bd690.device
Before=umount.target
...

That is, the unit file is not WantedBy=cryptsetup.target, but is still ordered Before=cryptsetup.target.

/etc/fstab

In fstab, entries not marked with noauto create unit files with following dependencies:

# /run/systemd/generator/-.mount
# Automatically generated by systemd-fstab-generator

[Unit]
...
Before=local-fs.target
...

Entries marked with noauto lack the Before=local-fs.target directive. I propose to add this directive anyway.

Rationale

This way, it will be easier to create "soft-auto" mountpoints (just like default auto, but without failing boot on unsuccessful mount).

More generally, with this change noauto mountpoints will be correctly ordered on shutdown, which is a good thing independently of auto/noauto.

Activity

  1. added
    RFE 🎁
    on Aug 28, 2016
  2. afett commented on Oct 7, 2016

    @afett

    systemd.special(7) states under local-fs.target: "systemd-fstab-generator(3) automatically adds dependencies of type Before= to all mount units that refer to local mount points for this target unit." So with the current behavior this seems to be at least a bug in the documentation?

  3. intelfx commented on Mar 6, 2017

    @intelfx
    ContributorAuthor

    Fix in #5547.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFE 🎁fstab-generator

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions