mirror of
https://github.com/AuxXxilium/eudev.git
synced 2024-12-20 21:50:23 +07:00
service: rework logic when we consider a service running
This commit is contained in:
parent
827119a9cb
commit
4eab639f92
@ -1587,13 +1587,16 @@ fail:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void service_enter_running(Service *s, bool success) {
|
static void service_enter_running(Service *s, bool success) {
|
||||||
|
int main_pid_ok, cgroup_ok;
|
||||||
assert(s);
|
assert(s);
|
||||||
|
|
||||||
if (!success)
|
if (!success)
|
||||||
s->failure = true;
|
s->failure = true;
|
||||||
|
|
||||||
if (main_pid_good(s) != 0 &&
|
main_pid_ok = main_pid_good(s);
|
||||||
cgroup_good(s) != 0 &&
|
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))
|
(s->bus_name_good || s->type != SERVICE_DBUS))
|
||||||
service_set_state(s, SERVICE_RUNNING);
|
service_set_state(s, SERVICE_RUNNING);
|
||||||
else if (s->valid_no_process)
|
else if (s->valid_no_process)
|
||||||
|
Loading…
Reference in New Issue
Block a user