Merge "send SIGTERM only once" am: 9ead7c4a74
am: ba54f32b0a
am: 72d44ae00c
Change-Id: I31b6064ae5625a1f6cd1b34c57085a18d870be27
This commit is contained in:
commit
1bcca04d6b
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