1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 12:37:45 +00:00

LaunchServer+SystemServer: Move the portal to a user-specific directory

Various changes are needed to support this:
 - The directory is created by Core::Account on login (and located in
   /tmp).
 - Service's sockets are now deleted on exit (to allow re-creation)
 - SystemServer needs to handle SIGTERM to correctly destroy services.
This commit is contained in:
Lucas CHOLLET 2022-07-17 15:41:01 +02:00 committed by Linus Groh
parent cc0d53d6a6
commit 70846d701c
21 changed files with 47 additions and 26 deletions

View file

@ -416,3 +416,11 @@ ErrorOr<void> Service::determine_account(int fd)
m_account = TRY(Core::Account::from_uid(stat.st_uid));
return {};
}
Service::~Service()
{
for (auto& socket : m_sockets) {
if (auto rc = remove(socket.path.characters()); rc != 0)
dbgln("{}", Error::from_errno(errno));
}
}