chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
21d1a67
)
service: always unwatch PIDs before forgetting old ones
author
Lennart Poettering
<lennart@poettering.net>
Fri, 9 Aug 2013 14:40:57 +0000
(16:40 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Fri, 9 Aug 2013 14:40:57 +0000
(16:40 +0200)
src/core/service.c
patch
|
blob
|
history
diff --git
a/src/core/service.c
b/src/core/service.c
index b98f11aed83be9683737969c67c140e9eb0c908e..df49ce18539929db861df1991b0499900ac3ef54 100644
(file)
--- a/
src/core/service.c
+++ b/
src/core/service.c
@@
-191,6
+191,8
@@
static int service_set_main_pid(Service *s, pid_t pid) {
if (pid == getpid())
return -EINVAL;
if (pid == getpid())
return -EINVAL;
+ service_unwatch_main_pid(s);
+
s->main_pid = pid;
s->main_pid_known = true;
s->main_pid = pid;
s->main_pid_known = true;
@@
-2158,10
+2160,8
@@
static void service_enter_start(Service *s) {
assert(s->exec_command[SERVICE_EXEC_START]);
assert(!s->exec_command[SERVICE_EXEC_START]->command_next || s->type == SERVICE_ONESHOT);
assert(s->exec_command[SERVICE_EXEC_START]);
assert(!s->exec_command[SERVICE_EXEC_START]->command_next || s->type == SERVICE_ONESHOT);
- if (s->type == SERVICE_FORKING)
- service_unwatch_control_pid(s);
- else
- service_unwatch_main_pid(s);
+ service_unwatch_control_pid(s);
+ service_unwatch_main_pid(s);
/* We want to ensure that nobody leaks processes from
* START_PRE here, so let's go on a killing spree, People
/* We want to ensure that nobody leaks processes from
* START_PRE here, so let's go on a killing spree, People
@@
-3751,6
+3751,7
@@
static void service_reset_failed(Unit *u) {
static int service_kill(Unit *u, KillWho who, int signo, DBusError *error) {
Service *s = SERVICE(u);
static int service_kill(Unit *u, KillWho who, int signo, DBusError *error) {
Service *s = SERVICE(u);
+
return unit_kill_common(u, who, signo, s->main_pid, s->control_pid, error);
}
return unit_kill_common(u, who, signo, s->main_pid, s->control_pid, error);
}