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

SystemServer+LibCore: Implement socket takeover

SystemServer can now create sockets on behalf of services before spawning any
of them, and pass the open socket fd as fd 3. CLocalServer gains a method to
complete the takeover and listen on the passed fd.

This is not used by any services at the moment.
This commit is contained in:
Sergey Bugaev 2019-11-26 19:27:21 +03:00 committed by Andreas Kling
parent 396ad4d6b2
commit c9e21b2bcc
5 changed files with 146 additions and 10 deletions

View file

@ -2,6 +2,7 @@
#include <AK/RefPtr.h>
#include <AK/String.h>
#include <LibCore/CNotifier.h>
#include <LibCore/CObject.h>
class CConfigFile;
@ -33,6 +34,8 @@ private:
int m_priority { 1 };
// Whether we should re-launch it if it exits.
bool m_keep_alive { false };
// Path to the socket to create and listen on on behalf of this service.
String m_socket_path;
// The name of the user we should run this service as.
String m_user;
uid_t m_uid { 0 };
@ -40,6 +43,9 @@ private:
// PID of the running instance of this service.
pid_t m_pid { -1 };
// An open fd to the socket.
int m_socket_fd { -1 };
void resolve_user();
void setup_socket();
};