mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
SystemServer: Rename 'BootModes' config option to 'SystemModes'
This commit is contained in:
parent
8d13f6ddce
commit
3d855a801b
Notes:
sideshowbarker
2024-07-18 01:52:25 +09:00
Author: https://github.com/BenWiederhake Commit: https://github.com/SerenityOS/serenity/commit/3d855a801ba Pull-request: https://github.com/SerenityOS/serenity/pull/10607 Reviewed-by: https://github.com/ADKaster ✅
5 changed files with 24 additions and 24 deletions
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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<String> m_boot_modes;
|
||||
// System modes in which to run this service. By default, this is the graphical mode.
|
||||
Vector<String> 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.
|
||||
|
|
Loading…
Reference in a new issue