summaryrefslogtreecommitdiff
path: root/src/unit.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-07-03 19:48:33 +0200
committerLennart Poettering <lennart@poettering.net>2010-07-03 19:48:33 +0200
commita40eb73224e237f758d38847ae216c019425ebac (patch)
treedc95aa3e1800bb44f43393341acb469863483036 /src/unit.c
parent2c966c038dc32ef39baa176371395cde4e541d01 (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/unit.c')
-rw-r--r--src/unit.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/unit.c b/src/unit.c
index 8c495b46eb..8f5ae8af3f 100644
--- a/src/unit.c
+++ b/src/unit.c
@@ -69,6 +69,7 @@ Unit *unit_new(Manager *m) {
u->meta.manager = m;
u->meta.type = _UNIT_TYPE_INVALID;
u->meta.deserialized_job = _JOB_TYPE_INVALID;
+ u->meta.default_dependencies = true;
return u;
}
@@ -593,8 +594,7 @@ void unit_dump(Unit *u, FILE *f, const char *prefix) {
"%s\tActive Enter Timestamp: %s\n"
"%s\tActive Exit Timestamp: %s\n"
"%s\tInactive Enter Timestamp: %s\n"
- "%s\tGC Check Good: %s\n"
- "%s\tOnly By Dependency: %s\n",
+ "%s\tGC Check Good: %s\n",
prefix, u->meta.id,
prefix, unit_description(u),
prefix, strna(u->meta.instance),
@@ -604,8 +604,7 @@ void unit_dump(Unit *u, FILE *f, const char *prefix) {
prefix, strna(format_timestamp(timestamp2, sizeof(timestamp2), u->meta.active_enter_timestamp.realtime)),
prefix, strna(format_timestamp(timestamp3, sizeof(timestamp3), u->meta.active_exit_timestamp.realtime)),
prefix, strna(format_timestamp(timestamp4, sizeof(timestamp4), u->meta.inactive_enter_timestamp.realtime)),
- prefix, yes_no(unit_check_gc(u)),
- prefix, yes_no(u->meta.only_by_dependency));
+ prefix, yes_no(unit_check_gc(u)));
SET_FOREACH(t, u->meta.names, i)
fprintf(f, "%s\tName: %s\n", prefix, t);
@@ -623,9 +622,13 @@ void unit_dump(Unit *u, FILE *f, const char *prefix) {
if (u->meta.load_state == UNIT_LOADED) {
fprintf(f,
"%s\tRecursive Stop: %s\n"
- "%s\tStop When Unneeded: %s\n",
+ "%s\tStopWhenUnneeded: %s\n"
+ "%s\tOnlyByDependency: %s\n"
+ "%s\tDefaultDependencies: %s\n",
prefix, yes_no(u->meta.recursive_stop),
- prefix, yes_no(u->meta.stop_when_unneeded));
+ prefix, yes_no(u->meta.stop_when_unneeded),
+ prefix, yes_no(u->meta.only_by_dependency),
+ prefix, yes_no(u->meta.default_dependencies));
LIST_FOREACH(by_unit, b, u->meta.cgroup_bondings)
fprintf(f, "%s\tControlGroup: %s:%s\n",