From 3d855a801ba401a4b027e8a7cc3c1d4e59050806 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Sat, 23 Oct 2021 19:15:01 +0200 Subject: [PATCH] SystemServer: Rename 'BootModes' config option to 'SystemModes' --- Base/etc/SystemServer.ini | 24 +++++++++++----------- Base/usr/share/man/man5/SystemServer.md | 4 ++-- Documentation/RunningTests.md | 2 +- Userland/Services/SystemServer/Service.cpp | 14 ++++++------- Userland/Services/SystemServer/Service.h | 4 ++-- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Base/etc/SystemServer.ini b/Base/etc/SystemServer.ini index 76d55e42345..9a36c684f54 100644 --- a/Base/etc/SystemServer.ini +++ b/Base/etc/SystemServer.ini @@ -9,7 +9,7 @@ SocketPermissions=600 Lazy=1 Priority=low User=anon -BootModes=text,graphical,self-test +SystemModes=text,graphical,self-test MultiInstance=1 AcceptSocketConnections=1 @@ -19,7 +19,7 @@ SocketPermissions=660 Lazy=1 Priority=low User=anon -BootModes=text,graphical,self-test +SystemModes=text,graphical,self-test MultiInstance=1 AcceptSocketConnections=1 @@ -28,7 +28,7 @@ Socket=/tmp/portal/webcontent SocketPermissions=600 Lazy=1 User=anon -BootModes=graphical +SystemModes=graphical MultiInstance=1 AcceptSocketConnections=1 @@ -37,7 +37,7 @@ Socket=/tmp/portal/image SocketPermissions=600 Lazy=1 User=anon -BootModes=graphical +SystemModes=graphical MultiInstance=1 AcceptSocketConnections=1 @@ -47,7 +47,7 @@ SocketPermissions=600 Lazy=1 Priority=low User=anon -BootModes=text,graphical,self-test +SystemModes=text,graphical,self-test MultiInstance=1 AcceptSocketConnections=1 @@ -57,13 +57,13 @@ SocketPermissions=660 Priority=low KeepAlive=1 User=lookup -BootModes=text,graphical,self-test +SystemModes=text,graphical,self-test [DHCPClient] Priority=low KeepAlive=1 User=root -BootModes=text,graphical,self-test +SystemModes=text,graphical,self-test [NotificationServer] Socket=/tmp/portal/notify @@ -78,7 +78,7 @@ Socket=/tmp/portal/launch SocketPermissions=600 Lazy=1 User=anon -BootModes=text,graphical +SystemModes=text,graphical [WindowServer] Socket=/tmp/portal/window,/tmp/portal/wm @@ -105,21 +105,21 @@ Socket=/tmp/portal/audio Priority=high KeepAlive=1 User=anon -BootModes=text,graphical +SystemModes=text,graphical [Shell@tty0] Executable=/bin/Shell StdIO=/dev/tty0 Environment=TERM=xterm KeepAlive=1 -BootModes=text +SystemModes=text [Shell@tty1] Executable=/bin/Shell StdIO=/dev/tty1 Environment=TERM=xterm KeepAlive=1 -BootModes=text +SystemModes=text [CppLanguageServer] Socket=/tmp/portal/language/cpp @@ -158,7 +158,7 @@ StdIO=/dev/ttyS0 Environment=DO_SHUTDOWN_AFTER_TESTS=1 TERM=xterm PATH=/bin:/usr/bin:/usr/local/bin TESTS_ONLY=1 UBSAN_OPTIONS=halt_on_error=1 User=anon WorkingDirectory=/home/anon -BootModes=self-test +SystemModes=self-test [SpiceAgent] KeepAlive=0 diff --git a/Base/usr/share/man/man5/SystemServer.md b/Base/usr/share/man/man5/SystemServer.md index 558b0de0234..a00a49d475c 100644 --- a/Base/usr/share/man/man5/SystemServer.md +++ b/Base/usr/share/man/man5/SystemServer.md @@ -28,7 +28,7 @@ describing how to launch and manage this service. * `SocketPermissions` - comma-separated list of (octal) file system permissions for the socket file. The default permissions are 0600. If the number of socket permissions defined is less than the number of sockets defined, then the last defined permission will be used for the remainder of the items in `Socket`. * `User` - a name of the user to run the service as. This impacts what UID, GID (and extra GIDs) the service processes have. By default, services are run as root. * `WorkingDirectory` - the working directory in which the service is spawned. By default, services are spawned in the root (`"/"`) directory. -* `BootModes` - a comma-separated list of boot modes the service should be enabled in. By default, services are only enabled in the "graphical" mode. The current system mode is read from the [kernel command line](../man7/boot_parameters.md#options), and is assumed to be "graphical" if not specified there. +* `SystemModes` - a comma-separated list of system modes in which the service should be enabled. By default, services are only enabled in the "graphical" mode. The current system mode is read from the [kernel command line](../man7/boot_parameters.md#options), and is assumed to be "graphical" if not specified there. * `Environment` - a space-separated list of "variable=value" pairs to set in the environment for the service. * `MultiInstance` - whether multiple instances of the service can be running simultaneously. * `AcceptSocketConnections` - whether SystemServer should accept connections on the socket, and spawn an instance of the service for each client connection. @@ -76,7 +76,7 @@ Executable=/bin/Shell StdIO=/dev/tty0 Environment=TERM=xterm KeepAlive=1 -BootModes=text +SystemModes=text # Launch WindowManager with two sockets: one for main windowing operations, and # one for window management operations. Both sockets get file permissions as 660. diff --git a/Documentation/RunningTests.md b/Documentation/RunningTests.md index 64d9aed4055..2479018f5cd 100644 --- a/Documentation/RunningTests.md +++ b/Documentation/RunningTests.md @@ -101,7 +101,7 @@ StdIO=/dev/ttyS0 Environment=DO_SHUTDOWN_AFTER_TESTS=1 TERM=xterm PATH=/usr/local/bin:/usr/bin:/bin User=anon WorkingDirectory=/home/anon -BootModes=self-test +SystemModes=self-test ``` `/dev/ttyS0` is used as stdio because that serial port is connected when qemu is run with `-display none` and diff --git a/Userland/Services/SystemServer/Service.cpp b/Userland/Services/SystemServer/Service.cpp index e4da86bf729..3431f076062 100644 --- a/Userland/Services/SystemServer/Service.cpp +++ b/Userland/Services/SystemServer/Service.cpp @@ -314,7 +314,7 @@ Service::Service(const Core::ConfigFile& config, const StringView& name) m_working_directory = config.read_entry(name, "WorkingDirectory"); m_environment = config.read_entry(name, "Environment").split(' '); - m_boot_modes = config.read_entry(name, "BootModes", "graphical").split(','); + m_system_modes = config.read_entry(name, "SystemModes", "graphical").split(','); m_multi_instance = config.read_bool_entry(name, "MultiInstance"); m_accept_socket_connections = config.read_bool_entry(name, "AcceptSocketConnections"); @@ -366,14 +366,14 @@ void Service::save_to(JsonObject& json) extra_args.append(arg); json.set("extra_arguments", move(extra_args)); - JsonArray boot_modes; - for (String& mode : m_boot_modes) - boot_modes.append(mode); - json.set("boot_modes", boot_modes); + JsonArray system_modes; + for (String& mode : m_system_modes) + system_modes.append(mode); + json.set("system_modes", system_modes); JsonArray environment; for (String& env : m_environment) - boot_modes.append(env); + system_modes.append(env); json.set("environment", environment); JsonArray sockets; @@ -406,5 +406,5 @@ void Service::save_to(JsonObject& json) bool Service::is_enabled() const { extern String g_system_mode; - return m_boot_modes.contains_slow(g_system_mode); + return m_system_modes.contains_slow(g_system_mode); } diff --git a/Userland/Services/SystemServer/Service.h b/Userland/Services/SystemServer/Service.h index a9ad00939f4..07a0c7adfa4 100644 --- a/Userland/Services/SystemServer/Service.h +++ b/Userland/Services/SystemServer/Service.h @@ -61,8 +61,8 @@ private: String m_user; // The working directory in which to spawn the service. String m_working_directory; - // Boot modes to run this service in. By default, this is the graphical mode. - Vector m_boot_modes; + // System modes in which to run this service. By default, this is the graphical mode. + Vector m_system_modes; // Whether several instances of this service can run at once. bool m_multi_instance { false }; // Environment variables to pass to the service.