mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
Base: Launch InspectorServer at session start-up
This commit is contained in:
parent
b01822bdd4
commit
c248569d6b
|
@ -19,12 +19,6 @@ User=window
|
|||
# Ensure windowserver has a controlling TTY.
|
||||
StdIO=/dev/tty0
|
||||
|
||||
[InspectorServer]
|
||||
Socket=/tmp/portal/inspector,/tmp/portal/inspectables
|
||||
SocketPermissions=600,666
|
||||
KeepAlive=true
|
||||
User=anon
|
||||
|
||||
[Clipboard]
|
||||
Socket=/tmp/portal/clipboard
|
||||
SocketPermissions=600
|
||||
|
|
|
@ -52,6 +52,11 @@ Lazy=true
|
|||
Priority=low
|
||||
KeepAlive=true
|
||||
|
||||
[InspectorServer]
|
||||
Socket=/tmp/user/%uid/portal/inspector,/tmp/user/%uid/portal/inspectables
|
||||
SocketPermissions=600,666
|
||||
KeepAlive=true
|
||||
|
||||
[LaunchServer]
|
||||
Socket=/tmp/user/%uid/portal/launch
|
||||
SocketPermissions=600
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Inspector {
|
|||
class InspectorServerClient final
|
||||
: public IPC::ConnectionToServer<InspectorClientEndpoint, InspectorServerEndpoint>
|
||||
, public InspectorClientEndpoint {
|
||||
IPC_CLIENT_CONNECTION(InspectorServerClient, "/tmp/portal/inspector"sv)
|
||||
IPC_CLIENT_CONNECTION(InspectorServerClient, "/tmp/user/%uid/portal/inspector"sv)
|
||||
|
||||
public:
|
||||
virtual ~InspectorServerClient() override = default;
|
||||
|
|
|
@ -359,7 +359,7 @@ EventLoop::~EventLoop()
|
|||
bool connect_to_inspector_server()
|
||||
{
|
||||
#ifdef __serenity__
|
||||
auto maybe_socket = Core::Stream::LocalSocket::connect("/tmp/portal/inspectables");
|
||||
auto maybe_socket = Core::Stream::LocalSocket::connect("/tmp/user/%uid/portal/inspectables");
|
||||
if (maybe_socket.is_error()) {
|
||||
dbgln("connect_to_inspector_server: Failed to connect: {}", maybe_socket.error());
|
||||
return false;
|
||||
|
|
|
@ -19,10 +19,10 @@ ErrorOr<int> serenity_main(Main::Arguments)
|
|||
|
||||
TRY(Core::System::pledge("stdio unix accept"));
|
||||
|
||||
auto server = TRY(IPC::MultiServer<InspectorServer::ConnectionFromClient>::try_create("/tmp/portal/inspector"));
|
||||
auto server = TRY(IPC::MultiServer<InspectorServer::ConnectionFromClient>::try_create("/tmp/user/%uid/portal/inspector"));
|
||||
|
||||
auto inspectables_server = TRY(Core::LocalServer::try_create());
|
||||
TRY(inspectables_server->take_over_from_system_server("/tmp/portal/inspectables"));
|
||||
TRY(inspectables_server->take_over_from_system_server("/tmp/user/%uid/portal/inspectables"));
|
||||
|
||||
inspectables_server->on_accept = [&](auto client_socket) {
|
||||
auto pid = client_socket->peer_pid().release_value_but_fixme_should_propagate_errors();
|
||||
|
|
Loading…
Reference in a new issue