diff --git a/Base/usr/share/man/man5/SystemServer.md b/Base/usr/share/man/man5/SystemServer.md index 11a002d469b..9e00d07af50 100644 --- a/Base/usr/share/man/man5/SystemServer.md +++ b/Base/usr/share/man/man5/SystemServer.md @@ -18,7 +18,7 @@ describing how to launch and manage this service. * `Executable` - an executable to spawn. If no explicit executable is specified, SystemServer assumes `/bin/{service name}` (for example, `/bin/WindowServer` for a service named `WindowServer`). * `Arguments` - a space-separated list of arguments to pass to the service as `argv` (excluding `argv[0]`). By default, SystemServer does not pass any arguments other than `argv[0]`. -* `StdIO` - a path to a file to be passed as standard I/O streams to the service. By default, services inherit SystemServer's own standard I/O streams, which are normally set to `/dev/tty0`. +* `StdIO` - a path to a file to be passed as standard I/O streams to the service. By default, services run with `/dev/null` for standard I/O. * `Priority` - the scheduling priority to set for the service, either "low", "normal", or "high". The default is "normal". * `KeepAlive` - whether the service should be restarted if it exits or crashes. For lazy services, this means the service will get respawned once a new connection is attempted on their socket after they exit or crash. * `Lazy` - whether the service should only get spawned once a client attempts to connect to their socket. diff --git a/Servers/SystemServer/Service.cpp b/Servers/SystemServer/Service.cpp index 8d7c0cd7467..4191b8d4c2b 100644 --- a/Servers/SystemServer/Service.cpp +++ b/Servers/SystemServer/Service.cpp @@ -190,6 +190,11 @@ void Service::spawn() close(STDIN_FILENO); close(STDOUT_FILENO); close(STDERR_FILENO); + + int fd = open("/dev/null", O_RDWR); + ASSERT(fd == STDIN_FILENO); + dup2(STDIN_FILENO, STDOUT_FILENO); + dup2(STDIN_FILENO, STDERR_FILENO); } if (!m_socket_path.is_null()) {