Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e730246 authored by Elliott Hughes's avatar Elliott Hughes
Browse files

Have init kill the process group.

killProcessGroup actually works on cgroups. Kill the POSIX process
group ourselves.

Bug: http://b/29751426
Change-Id: I1a2808488510f4262811b6407bcd0948ad23bc60
parent c97b73aa
Loading
Loading
Loading
Loading
+9 −5
Original line number Original line Diff line number Diff line
@@ -197,11 +197,15 @@ void Service::NotifyStateChange(const std::string& new_state) const {
}
}


void Service::KillProcessGroup(int signal) {
void Service::KillProcessGroup(int signal) {
    LOG(VERBOSE) << "Sending signal " << signal
    LOG(INFO) << "Sending signal " << signal
              << " to service '" << name_
              << " to service '" << name_
                 << "' (pid " << pid_ << ") process group...\n",
              << "' (pid " << pid_ << ") process group...";
    kill(pid_, signal);
    if (killProcessGroup(uid_, pid_, signal) == -1) {
    killProcessGroup(uid_, pid_, signal);
        PLOG(ERROR) << "killProcessGroup(" << uid_ << ", " << pid_ << ", " << signal << ") failed";
    }
    if (kill(-pid_, signal) == -1) {
        PLOG(ERROR) << "kill(" << pid_ << ", " << signal << ") failed";
    }
}
}


void Service::CreateSockets(const std::string& context) {
void Service::CreateSockets(const std::string& context) {