Merge "send SIGTERM only once"
This commit is contained in:
commit
9ead7c4a74
1 changed files with 7 additions and 1 deletions
|
@ -211,7 +211,13 @@ void Service::KillProcessGroup(int signal) {
|
|||
LOG(INFO) << "Sending signal " << signal
|
||||
<< " to service '" << name_
|
||||
<< "' (pid " << pid_ << ") process group...";
|
||||
if (killProcessGroup(uid_, pid_, signal) == -1) {
|
||||
int r;
|
||||
if (signal == SIGTERM) {
|
||||
r = killProcessGroupOnce(uid_, pid_, signal);
|
||||
} else {
|
||||
r = killProcessGroup(uid_, pid_, signal);
|
||||
}
|
||||
if (r == -1) {
|
||||
PLOG(ERROR) << "killProcessGroup(" << uid_ << ", " << pid_ << ", " << signal << ") failed";
|
||||
}
|
||||
if (kill(-pid_, signal) == -1) {
|
||||
|
|
Loading…
Reference in a new issue