return 0;
}
+static int automount_add_default_dependencies(Automount *a) {
+ int r;
+
+ assert(a);
+
+ if (a->meta.manager->running_as == MANAGER_SYSTEM) {
+
+ if ((r = unit_add_dependency_by_name(UNIT(a), UNIT_AFTER, SPECIAL_SYSINIT_TARGET, NULL, true)) < 0)
+ return r;
+
+ if ((r = unit_add_two_dependencies_by_name(UNIT(a), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, NULL, true)) < 0)
+ return r;
+ }
+
+ return 0;
+}
+
static int automount_verify(Automount *a) {
bool b;
char *e;
if ((r = unit_add_dependency(u, UNIT_BEFORE, UNIT(a->mount), true)) < 0)
return r;
- if (a->meta.default_dependencies &&
- a->meta.manager->running_as == MANAGER_SYSTEM)
- if ((r = unit_add_two_dependencies_by_name(UNIT(a), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, NULL, true)) < 0)
+ if (a->meta.default_dependencies)
+ if ((r = automount_add_default_dependencies(a)) < 0)
return r;
}
}
}
+static int mount_add_default_dependencies(Mount *m) {
+ int r;
+
+ assert(m);
+
+ if (m->meta.manager->running_as == MANAGER_SYSTEM) {
+
+ if ((r = unit_add_dependency_by_name(UNIT(m), UNIT_AFTER, SPECIAL_SYSINIT_TARGET, NULL, true)) < 0)
+ return r;
+
+ if (!path_equal(m->where, "/"))
+ if ((r = unit_add_two_dependencies_by_name(UNIT(m), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, NULL, true)) < 0)
+ return r;
+ }
+
+ return 0;
+}
+
static int mount_verify(Mount *m) {
bool b;
char *e;
if ((r = unit_add_default_cgroup(u)) < 0)
return r;
- if (m->meta.default_dependencies &&
- m->meta.manager->running_as == MANAGER_SYSTEM &&
- !path_equal(m->where, "/"))
- if ((r = unit_add_two_dependencies_by_name(UNIT(m), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, NULL, true)) < 0)
+ if (m->meta.default_dependencies)
+ if ((r = mount_add_default_dependencies(m)) < 0)
return r;
}
return unit_add_dependency(UNIT(s), UNIT_BEFORE, tu, true);
}
+static int swap_add_default_dependencies(Swap *s) {
+ int r;
+
+ assert(s);
+
+ if (s->meta.manager->running_as == MANAGER_SYSTEM) {
+
+ if ((r = unit_add_dependency_by_name(UNIT(s), UNIT_AFTER, SPECIAL_SYSINIT_TARGET, NULL, true)) < 0)
+ return r;
+
+ /* Note that by default we don't disable swap devices
+ * on shutdown. i.e. there is no umount.target
+ * conflicts here. */
+ }
+
+ return 0;
+}
+
static int swap_verify(Swap *s) {
bool b;
char *e;
if ((r = swap_add_target_links(s)) < 0)
return r;
+
+ if (s->meta.default_dependencies)
+ if ((r = swap_add_default_dependencies(s)) < 0)
+ return r;
}
return swap_verify(s);
[Unit]
Description=Huge Pages File System Automount Point
-Before=sysinit.target
+DefaultDependencies=no
[Automount]
Where=/dev/hugepages
[Unit]
Description=Huge Pages File System
+DefaultDependencies=no
[Mount]
What=hugetlbfs
[Unit]
Description=POSIX Message Queue File System Automount Point
-Before=sysinit.target
+DefaultDependencies=no
[Automount]
Where=/dev/mqueue
[Unit]
Description=POSIX Message Queue File System
+DefaultDependencies=no
[Mount]
What=mqueue
[Unit]
Description=Arbitrary Executable File Formats File System Automount Point
-Before=sysinit.target
+DefaultDependencies=no
[Automount]
Where=/proc/sys/fs/binfmt_misc
[Unit]
Description=Arbitrary Executable File Formats File System
+DefaultDependencies=no
[Mount]
What=binfmt_misc
[Unit]
Description=Debug File System Automount Point
-Before=sysinit.target
+DefaultDependencies=no
[Automount]
Where=/sys/kernel/debug
[Unit]
Description=Debug File System
+DefaultDependencies=no
[Mount]
What=debugfs
[Unit]
Description=Security File System Automount Point
-Before=sysinit.target
+DefaultDependencies=no
[Automount]
Where=/sys/kernel/security
[Unit]
Description=Security File System
+DefaultDependencies=no
[Mount]
What=securityfs