summaryrefslogtreecommitdiff
path: root/src/manager.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-09-01 03:30:59 +0200
committerLennart Poettering <lennart@poettering.net>2010-09-01 03:30:59 +0200
commit8f6df3fa98ee74eaf5c34dddd272d2e3c10c3c27 (patch)
tree5fec4954f329146a2d6952e16e1319ba5bb1b2af /src/manager.c
parentaabd9b11ba563e1d988b119960c94b139ec5de00 (diff)
dbus: don't accept activation requests anymore if we are going down anyway
Diffstat (limited to 'src/manager.c')
-rw-r--r--src/manager.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/manager.c b/src/manager.c
index 517473b802..ff1c70b484 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -2584,6 +2584,26 @@ int manager_set_console(Manager *m, const char *console) {
return 0;
}
+bool manager_unit_pending_inactive(Manager *m, const char *name) {
+ Unit *u;
+
+ assert(m);
+ assert(name);
+
+ /* Returns true if the unit is inactive or going down */
+
+ if (!(u = manager_get_unit(m, name)))
+ return true;
+
+ if (UNIT_IS_INACTIVE_OR_DEACTIVATING(unit_active_state(u)))
+ return true;
+
+ if (u->meta.job && u->meta.job->type == JOB_STOP)
+ return true;
+
+ return false;
+}
+
static const char* const manager_running_as_table[_MANAGER_RUNNING_AS_MAX] = {
[MANAGER_SYSTEM] = "system",
[MANAGER_SESSION] = "session"