Merge pull request #11457 from grooverdan/sendsigkill_no

service: killmode=cgroup|mixed, SendSIGKILL=no services are not multiprocess
This commit is contained in:
Lennart Poettering
2019-02-18 13:41:52 +01:00
committed by GitHub
6 changed files with 52 additions and 17 deletions
+8 -4
View File
@@ -223,7 +223,7 @@ int cg_kill(
_cleanup_set_free_ Set *allocated_set = NULL;
bool done = false;
int r, ret = 0;
int r, ret = 0, ret_log_kill = 0;
pid_t my_pid;
assert(sig >= 0);
@@ -267,7 +267,7 @@ int cg_kill(
continue;
if (log_kill)
log_kill(pid, sig, userdata);
ret_log_kill = log_kill(pid, sig, userdata);
/* If we haven't killed this process yet, kill
* it */
@@ -278,8 +278,12 @@ int cg_kill(
if (flags & CGROUP_SIGCONT)
(void) kill(pid, SIGCONT);
if (ret == 0)
ret = 1;
if (ret == 0) {
if (log_kill)
ret = ret_log_kill;
else
ret = 1;
}
}
done = false;
+1 -1
View File
@@ -167,7 +167,7 @@ typedef enum CGroupFlags {
CGROUP_REMOVE = 1 << 2,
} CGroupFlags;
typedef void (*cg_kill_log_func_t)(pid_t pid, int sig, void *userdata);
typedef int (*cg_kill_log_func_t)(pid_t pid, int sig, void *userdata);
int cg_kill(const char *controller, const char *path, int sig, CGroupFlags flags, Set *s, cg_kill_log_func_t kill_log, void *userdata);
int cg_kill_recursive(const char *controller, const char *path, int sig, CGroupFlags flags, Set *s, cg_kill_log_func_t kill_log, void *userdata);