gui: Rename "launch" to "execd"
All checks were successful
Build and test / build (push) Successful in 1m42s
All checks were successful
Build and test / build (push) Successful in 1m42s
This commit is contained in:
parent
865a913502
commit
ad3cea7e78
@ -11,7 +11,7 @@ add_subdirectory(libui)
|
||||
add_subdirectory(wind)
|
||||
add_subdirectory(apps)
|
||||
|
||||
luna_service(launch.cpp launch)
|
||||
luna_service(execd.cpp execd)
|
||||
luna_service(run.cpp run)
|
||||
luna_service(loginui.cpp loginui)
|
||||
target_link_libraries(loginui PRIVATE ui)
|
||||
|
@ -115,7 +115,7 @@ Result<int> luna_main(int, char**)
|
||||
|
||||
TRY(os::EventLoop::the().register_signal_handler(SIGQUIT, sigquit_handler));
|
||||
|
||||
launcher_client = TRY(os::IPC::Client::connect("/tmp/launch.sock", false));
|
||||
launcher_client = TRY(os::IPC::Client::connect("/tmp/execd.sock", false));
|
||||
|
||||
ui::Rect screen = app.screen_rect();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file launch.cpp
|
||||
* @file execd.cpp
|
||||
* @author apio (cloudapio.eu)
|
||||
* @brief Background process that handles detached launching of apps.
|
||||
*
|
||||
@ -42,7 +42,7 @@ void handle_ipc_message(os::IPC::ClientConnection& client, u8 id, void*)
|
||||
switch (id)
|
||||
{
|
||||
case os::Launcher::LAUNCH_DETACHED_ID: handle_launch_detached_message(client); break;
|
||||
default: os::eprintln("launch: Invalid IPC message from client!"); return;
|
||||
default: os::eprintln("execd: Invalid IPC message from client!"); return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,11 +55,11 @@ Result<int> luna_main(int argc, char** argv)
|
||||
{
|
||||
TRY(os::Security::pledge("stdio wpath cpath unix proc exec", NULL));
|
||||
|
||||
StringView socket_path = "/tmp/launch.sock";
|
||||
StringView socket_path = "/tmp/execd.sock";
|
||||
|
||||
os::ArgumentParser parser;
|
||||
parser.add_description("Background process that handles detached launching of apps."_sv);
|
||||
parser.add_system_program_info("launch"_sv);
|
||||
parser.add_system_program_info("execd"_sv);
|
||||
parser.parse(argc, argv);
|
||||
|
||||
signal(SIGCHLD, sigchld_handler);
|
||||
@ -87,7 +87,7 @@ Result<int> luna_main(int argc, char** argv)
|
||||
if (fds[0].revents & POLLIN)
|
||||
{
|
||||
auto client = TRY(server->accept());
|
||||
os::println("launch: New client connected!");
|
||||
os::println("execd: New client connected!");
|
||||
TRY(fds.try_append({ .fd = client.fd(), .events = POLLIN, .revents = 0 }));
|
||||
|
||||
auto connection = TRY(os::IPC::ClientConnection::adopt_connection(move(client)));
|
||||
@ -99,7 +99,7 @@ Result<int> luna_main(int argc, char** argv)
|
||||
if (fds[i + 1].revents & POLLIN) clients[i]->check_for_messages();
|
||||
if (fds[i + 1].revents & POLLHUP)
|
||||
{
|
||||
os::println("launch: Client %zu disconnected", i);
|
||||
os::println("execd: Client %zu disconnected", i);
|
||||
fds.remove_at(i + 1);
|
||||
auto client = clients.remove_at(i);
|
||||
client->disconnect();
|
@ -22,7 +22,7 @@ Result<int> luna_main(int argc, char** argv)
|
||||
parser.add_positional_argument(program, "program", true);
|
||||
parser.parse(argc, argv);
|
||||
|
||||
OwnedPtr<os::IPC::Client> launcher_client = TRY(os::IPC::Client::connect("/tmp/launch.sock", false));
|
||||
OwnedPtr<os::IPC::Client> launcher_client = TRY(os::IPC::Client::connect("/tmp/execd.sock", false));
|
||||
|
||||
os::println("Requesting to start program '%s'...", program.chars());
|
||||
|
||||
|
@ -123,17 +123,17 @@ Result<int> luna_main(int argc, char** argv)
|
||||
setenv("HOME", pw->pw_dir, 1);
|
||||
setenv("SHELL", pw->pw_shell, 1);
|
||||
|
||||
// We also need to wait for this one, since taskbar requires launch.sock.
|
||||
// We also need to wait for this one, since taskbar requires execd.sock.
|
||||
bool success = os::IPC::Notifier::run_and_wait(
|
||||
[&] {
|
||||
(void)os::FileSystem::remove("/tmp/launch.sock");
|
||||
StringView launch_command[] = { "/usr/bin/launch" };
|
||||
spawn_process_as_user(Slice<StringView>(launch_command, 1), pw->pw_uid, pw->pw_gid, groups.slice());
|
||||
(void)os::FileSystem::remove("/tmp/execd.sock");
|
||||
StringView execd_command[] = { "/usr/bin/execd" };
|
||||
spawn_process_as_user(Slice<StringView>(execd_command, 1), pw->pw_uid, pw->pw_gid, groups.slice());
|
||||
},
|
||||
1000);
|
||||
if (!success)
|
||||
{
|
||||
os::eprintln("startui: failed to start launch server, timed out");
|
||||
os::eprintln("startui: failed to start execd, timed out");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ Result<int> luna_main(int argc, char** argv)
|
||||
return err(errno);
|
||||
}
|
||||
|
||||
if (strstr(ps.ps_name, "/usr/bin/launch")) { kill(ps.ps_pid, SIGTERM); }
|
||||
if (strstr(ps.ps_name, "/usr/bin/execd")) { kill(ps.ps_pid, SIGTERM); }
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user