SystemServer: Add support for multi-instance services

For this kind of services, there's no single PID of a running instance;
there may be multiple, or no instances of the service running at any time.
No keepalive functionality is available in this mode, since "alive" doesn't
make sense for multi-instance services.

At the moment, there's no way to actually create multiple instances of
a service; this is going to be added in the next commit.
This commit is contained in:
Sergey Bugaev 2020-06-08 23:47:10 +03:00 committed by Andreas Kling
commit ac4c2f890f
Notes: sideshowbarker 2024-07-19 05:44:13 +09:00
3 changed files with 21 additions and 9 deletions

View file

@ -47,10 +47,10 @@ static void sigchld_handler(int)
if (!pid)
return;
dbg() << "Reaped child with pid " << pid;
dbg() << "Reaped child with pid " << pid << ", exist status " << status;
Service* service = Service::find_by_pid(pid);
if (service == nullptr) {
dbg() << "There was no service with this pid, what is going on?";
// This can happen for multi-instance services.
return;
}