diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-07-03 19:48:33 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-07-03 19:48:33 +0200 |
commit | a40eb73224e237f758d38847ae216c019425ebac (patch) | |
tree | dc95aa3e1800bb44f43393341acb469863483036 /src/path.c | |
parent | 2c966c038dc32ef39baa176371395cde4e541d01 (diff) |
unit: add DefaultDependencies= setting
In order to simplify writing of unit files introduce default
dependencies that are added to all units unless explictly disabled in a
unit. This option can be switched off for select units that are involved
in early boot-up ot late system shutdown,
This should simplify service files for most normal daemons, but breaks
existing service files for software involved in early boot (notably
udev), which need to be updated for a DefaultDependencies=no setting)
Diffstat (limited to 'src/path.c')
-rw-r--r-- | src/path.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/path.c b/src/path.c index 56936fd673..30d946d788 100644 --- a/src/path.c +++ b/src/path.c @@ -29,6 +29,7 @@ #include "unit-name.h" #include "path.h" #include "dbus-path.h" +#include "special.h" static const UnitActiveState state_translation_table[_PATH_STATE_MAX] = { [PATH_DEAD] = UNIT_INACTIVE, @@ -120,6 +121,11 @@ static int path_load(Unit *u) { if ((r = path_add_mount_links(p)) < 0) return r; + + /* Path units shouldn't stay around on shutdown */ + if (p->meta.default_dependencies) + if ((r = unit_add_two_dependencies_by_name(u, UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_SHUTDOWN_TARGET, NULL, true)) < 0) + return r; } return path_verify(p); |