diff options
author | Franck Bui <fbui@suse.com> | 2020-04-02 10:52:24 +0200 |
---|---|---|
committer | Franck Bui <fbui@suse.com> | 2020-04-09 15:17:17 +0200 |
commit | b3d7aef525dc1620a7948ffdbf3f36bfa3d5b5e8 (patch) | |
tree | 8451c8fc2552ed451bdc8445e952a8fe3c350607 /src/core | |
parent | 83cdc870949823b5b9fa04dd76e952d42faab0b1 (diff) | |
download | systemd-b3d7aef525dc1620a7948ffdbf3f36bfa3d5b5e8.tar.gz |
automount: fix handling of default dependencies for automount units
First After=local-fs-pre.target wasn't described in the man page although it's
part of the default dependencies automatically set by pid1.
Secondly, Before=local-fs.target was only set if the automount unit was
generated from the fstab-generator because the dep was explicitly
generated. It was also not documented as a default dependency.
Fix it by managing the dep from pid1 instead.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/automount.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/automount.c b/src/core/automount.c index 0b3f498bfc..99b4eb2c81 100644 --- a/src/core/automount.c +++ b/src/core/automount.c @@ -152,6 +152,10 @@ static int automount_add_default_dependencies(Automount *a) { if (!MANAGER_IS_SYSTEM(UNIT(a)->manager)) return 0; + r = unit_add_dependency_by_name(UNIT(a), UNIT_BEFORE, SPECIAL_LOCAL_FS_TARGET, true, UNIT_DEPENDENCY_DEFAULT); + if (r < 0) + return r; + r = unit_add_dependency_by_name(UNIT(a), UNIT_AFTER, SPECIAL_LOCAL_FS_PRE_TARGET, true, UNIT_DEPENDENCY_DEFAULT); if (r < 0) return r; |