units: introduce umount.target for unmounting all file systems

This commit is contained in:
Lennart Poettering
2010-07-10 02:41:06 +02:00
parent b8131a87cc
commit 4e67ddd6b3
6 changed files with 23 additions and 2 deletions
+5
View File
@@ -36,6 +36,7 @@
#include "unit-name.h"
#include "dbus-automount.h"
#include "bus-errors.h"
#include "special.h"
static const UnitActiveState state_translation_table[_AUTOMOUNT_STATE_MAX] = {
[AUTOMOUNT_DEAD] = UNIT_INACTIVE,
@@ -194,6 +195,10 @@ static int automount_load(Unit *u) {
if ((r = unit_add_dependency(u, UNIT_BEFORE, UNIT(a->mount), true)) < 0)
return r;
if (a->meta.default_dependencies)
if ((r = unit_add_two_dependencies_by_name(UNIT(a), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, NULL, true)) < 0)
return r;
}
return automount_verify(a);
+4
View File
@@ -367,6 +367,10 @@ static int mount_load(Unit *u) {
if ((r = unit_add_default_cgroup(u)) < 0)
return r;
if (m->meta.default_dependencies && !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 mount_verify(m);
+1
View File
@@ -29,6 +29,7 @@
* it to bring all services down that want to be brought down on
* system shutdown. */
#define SPECIAL_SHUTDOWN_TARGET "shutdown.target"
#define SPECIAL_UMOUNT_TARGET "umount.target"
#define SPECIAL_LOGGER_SOCKET "systemd-logger.socket"