summaryrefslogtreecommitdiff
path: root/src/service.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-06-22 04:09:50 +0200
committerLennart Poettering <lennart@poettering.net>2010-06-22 04:09:50 +0200
commit4eab639f92c0e4fa1a1baee5575bf3bc21810dcf (patch)
treea88d8deef0f7d3798c0f2c3831e7d9fb7c36dc32 /src/service.c
parent827119a9cbf617aa42eef63e5b99e981776c744a (diff)
service: rework logic when we consider a service running
Diffstat (limited to 'src/service.c')
-rw-r--r--src/service.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/service.c b/src/service.c
index aff355112d..e1dab70f81 100644
--- a/src/service.c
+++ b/src/service.c
@@ -1587,13 +1587,16 @@ fail:
}
static void service_enter_running(Service *s, bool success) {
+ int main_pid_ok, cgroup_ok;
assert(s);
if (!success)
s->failure = true;
- if (main_pid_good(s) != 0 &&
- cgroup_good(s) != 0 &&
+ main_pid_ok = main_pid_good(s);
+ cgroup_ok = cgroup_good(s);
+
+ if ((main_pid_ok > 0 || (main_pid_ok < 0 && cgroup_ok != 0)) &&
(s->bus_name_good || s->type != SERVICE_DBUS))
service_set_state(s, SERVICE_RUNNING);
else if (s->valid_no_process)