SystemServer: Rename 'BootModes' config option to 'SystemModes'

This commit is contained in:
Ben Wiederhake 2021-10-23 19:15:01 +02:00 committed by Andreas Kling
parent 8d13f6ddce
commit 3d855a801b
5 changed files with 24 additions and 24 deletions

View file

@ -9,7 +9,7 @@ SocketPermissions=600
Lazy=1 Lazy=1
Priority=low Priority=low
User=anon User=anon
BootModes=text,graphical,self-test SystemModes=text,graphical,self-test
MultiInstance=1 MultiInstance=1
AcceptSocketConnections=1 AcceptSocketConnections=1
@ -19,7 +19,7 @@ SocketPermissions=660
Lazy=1 Lazy=1
Priority=low Priority=low
User=anon User=anon
BootModes=text,graphical,self-test SystemModes=text,graphical,self-test
MultiInstance=1 MultiInstance=1
AcceptSocketConnections=1 AcceptSocketConnections=1
@ -28,7 +28,7 @@ Socket=/tmp/portal/webcontent
SocketPermissions=600 SocketPermissions=600
Lazy=1 Lazy=1
User=anon User=anon
BootModes=graphical SystemModes=graphical
MultiInstance=1 MultiInstance=1
AcceptSocketConnections=1 AcceptSocketConnections=1
@ -37,7 +37,7 @@ Socket=/tmp/portal/image
SocketPermissions=600 SocketPermissions=600
Lazy=1 Lazy=1
User=anon User=anon
BootModes=graphical SystemModes=graphical
MultiInstance=1 MultiInstance=1
AcceptSocketConnections=1 AcceptSocketConnections=1
@ -47,7 +47,7 @@ SocketPermissions=600
Lazy=1 Lazy=1
Priority=low Priority=low
User=anon User=anon
BootModes=text,graphical,self-test SystemModes=text,graphical,self-test
MultiInstance=1 MultiInstance=1
AcceptSocketConnections=1 AcceptSocketConnections=1
@ -57,13 +57,13 @@ SocketPermissions=660
Priority=low Priority=low
KeepAlive=1 KeepAlive=1
User=lookup User=lookup
BootModes=text,graphical,self-test SystemModes=text,graphical,self-test
[DHCPClient] [DHCPClient]
Priority=low Priority=low
KeepAlive=1 KeepAlive=1
User=root User=root
BootModes=text,graphical,self-test SystemModes=text,graphical,self-test
[NotificationServer] [NotificationServer]
Socket=/tmp/portal/notify Socket=/tmp/portal/notify
@ -78,7 +78,7 @@ Socket=/tmp/portal/launch
SocketPermissions=600 SocketPermissions=600
Lazy=1 Lazy=1
User=anon User=anon
BootModes=text,graphical SystemModes=text,graphical
[WindowServer] [WindowServer]
Socket=/tmp/portal/window,/tmp/portal/wm Socket=/tmp/portal/window,/tmp/portal/wm
@ -105,21 +105,21 @@ Socket=/tmp/portal/audio
Priority=high Priority=high
KeepAlive=1 KeepAlive=1
User=anon User=anon
BootModes=text,graphical SystemModes=text,graphical
[Shell@tty0] [Shell@tty0]
Executable=/bin/Shell Executable=/bin/Shell
StdIO=/dev/tty0 StdIO=/dev/tty0
Environment=TERM=xterm Environment=TERM=xterm
KeepAlive=1 KeepAlive=1
BootModes=text SystemModes=text
[Shell@tty1] [Shell@tty1]
Executable=/bin/Shell Executable=/bin/Shell
StdIO=/dev/tty1 StdIO=/dev/tty1
Environment=TERM=xterm Environment=TERM=xterm
KeepAlive=1 KeepAlive=1
BootModes=text SystemModes=text
[CppLanguageServer] [CppLanguageServer]
Socket=/tmp/portal/language/cpp 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 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 User=anon
WorkingDirectory=/home/anon WorkingDirectory=/home/anon
BootModes=self-test SystemModes=self-test
[SpiceAgent] [SpiceAgent]
KeepAlive=0 KeepAlive=0

View file

@ -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`. * `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. * `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. * `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. * `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. * `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. * `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 StdIO=/dev/tty0
Environment=TERM=xterm Environment=TERM=xterm
KeepAlive=1 KeepAlive=1
BootModes=text SystemModes=text
# Launch WindowManager with two sockets: one for main windowing operations, and # Launch WindowManager with two sockets: one for main windowing operations, and
# one for window management operations. Both sockets get file permissions as 660. # one for window management operations. Both sockets get file permissions as 660.

View file

@ -101,7 +101,7 @@ StdIO=/dev/ttyS0
Environment=DO_SHUTDOWN_AFTER_TESTS=1 TERM=xterm PATH=/usr/local/bin:/usr/bin:/bin Environment=DO_SHUTDOWN_AFTER_TESTS=1 TERM=xterm PATH=/usr/local/bin:/usr/bin:/bin
User=anon User=anon
WorkingDirectory=/home/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 `/dev/ttyS0` is used as stdio because that serial port is connected when qemu is run with `-display none` and

View file

@ -314,7 +314,7 @@ Service::Service(const Core::ConfigFile& config, const StringView& name)
m_working_directory = config.read_entry(name, "WorkingDirectory"); m_working_directory = config.read_entry(name, "WorkingDirectory");
m_environment = config.read_entry(name, "Environment").split(' '); 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_multi_instance = config.read_bool_entry(name, "MultiInstance");
m_accept_socket_connections = config.read_bool_entry(name, "AcceptSocketConnections"); m_accept_socket_connections = config.read_bool_entry(name, "AcceptSocketConnections");
@ -366,14 +366,14 @@ void Service::save_to(JsonObject& json)
extra_args.append(arg); extra_args.append(arg);
json.set("extra_arguments", move(extra_args)); json.set("extra_arguments", move(extra_args));
JsonArray boot_modes; JsonArray system_modes;
for (String& mode : m_boot_modes) for (String& mode : m_system_modes)
boot_modes.append(mode); system_modes.append(mode);
json.set("boot_modes", boot_modes); json.set("system_modes", system_modes);
JsonArray environment; JsonArray environment;
for (String& env : m_environment) for (String& env : m_environment)
boot_modes.append(env); system_modes.append(env);
json.set("environment", environment); json.set("environment", environment);
JsonArray sockets; JsonArray sockets;
@ -406,5 +406,5 @@ void Service::save_to(JsonObject& json)
bool Service::is_enabled() const bool Service::is_enabled() const
{ {
extern String g_system_mode; extern String g_system_mode;
return m_boot_modes.contains_slow(g_system_mode); return m_system_modes.contains_slow(g_system_mode);
} }

View file

@ -61,8 +61,8 @@ private:
String m_user; String m_user;
// The working directory in which to spawn the service. // The working directory in which to spawn the service.
String m_working_directory; String m_working_directory;
// Boot modes to run this service in. By default, this is the graphical mode. // System modes in which to run this service. By default, this is the graphical mode.
Vector<String> m_boot_modes; Vector<String> m_system_modes;
// Whether several instances of this service can run at once. // Whether several instances of this service can run at once.
bool m_multi_instance { false }; bool m_multi_instance { false };
// Environment variables to pass to the service. // Environment variables to pass to the service.