···335335 * @public @memberof ipc_server_mainloop
336336 */
337337int
338338-ipc_server_mainloop_init(struct ipc_server_mainloop *ml);
338338+ipc_server_mainloop_init(struct ipc_server_mainloop *ml, bool no_stdin);
339339340340/*!
341341 * @brief Poll the mainloop.
···423423 * User data passed to callbacks.
424424 */
425425 void *callback_data;
426426+427427+ //! Disable listening on stdin for server stop.
428428+ bool no_stdin;
426429};
427430428431/*!
+3
src/xrt/ipc/server/ipc_server_interface.h
···39394040 //! Flag whether runtime should exit on app disconnect.
4141 bool exit_on_disconnect;
4242+4343+ //! Disable listening on stdin for server stop.
4444+ bool no_stdin;
4245};
43464447/*!
+1-1
src/xrt/ipc/server/ipc_server_mainloop_android.c
···139139}
140140141141int
142142-ipc_server_mainloop_init(struct ipc_server_mainloop *ml)
142142+ipc_server_mainloop_init(struct ipc_server_mainloop *ml, bool no_stdin)
143143{
144144 int ret = init_pipe(ml);
145145 if (ret < 0) {
+5-12
src/xrt/ipc/server/ipc_server_mainloop_linux.c
···11// Copyright 2020-2021, Collabora, Ltd.
22+// Copyright 2025, NVIDIA CORPORATION.
23// SPDX-License-Identifier: BSL-1.0
34/*!
45 * @file
···4647#include <systemd/sd-daemon.h>
4748#endif
48494949-/*
5050- * "XRT_NO_STDIN" option disables stdin and prevents monado-service from terminating.
5151- * This could be useful for situations where there is no proper or in a non-interactive shell.
5252- * Two example scenarios are:
5353- * * IDE terminals,
5454- * * Some scripting environments where monado-service is spawned in the background
5555- */
5656-DEBUG_GET_ONCE_BOOL_OPTION(skip_stdin, "XRT_NO_STDIN", false)
57505851/*
5952 *
···175168}
176169177170static int
178178-init_epoll(struct ipc_server_mainloop *ml)
171171+init_epoll(struct ipc_server_mainloop *ml, bool no_stdin)
179172{
180173 int ret = epoll_create1(EPOLL_CLOEXEC);
181174 if (ret < 0) {
···186179187180 struct epoll_event ev = {0};
188181189189- if (!ml->launched_by_socket && !debug_get_bool_option_skip_stdin()) {
182182+ if (!ml->launched_by_socket && !no_stdin) {
190183 // Can't do this when launched by systemd socket activation by
191184 // default.
192185 // This polls stdin.
···265258}
266259267260int
268268-ipc_server_mainloop_init(struct ipc_server_mainloop *ml)
261261+ipc_server_mainloop_init(struct ipc_server_mainloop *ml, bool no_stdin)
269262{
270263 IPC_TRACE_MARKER();
271264···275268 return ret;
276269 }
277270278278- ret = init_epoll(ml);
271271+ ret = init_epoll(ml, no_stdin);
279272 if (ret < 0) {
280273 ipc_server_mainloop_deinit(ml);
281274 return ret;
···6161DEBUG_GET_ONCE_NUM_OPTION(exit_when_idle_delay_ms, "IPC_EXIT_WHEN_IDLE_DELAY_MS", 5000)
6262DEBUG_GET_ONCE_LOG_OPTION(ipc_log, "IPC_LOG", U_LOGGING_INFO)
63636464+/*
6565+ * "XRT_NO_STDIN" option disables stdin and prevents monado-service from terminating.
6666+ * This could be useful for situations where there is no proper or in a non-interactive shell.
6767+ * Two example scenarios are:
6868+ * * IDE terminals,
6969+ * * Some scripting environments where monado-service is spawned in the background
7070+ */
7171+DEBUG_GET_ONCE_BOOL_OPTION(no_stdin, "XRT_NO_STDIN", false)
7272+64736574/*
6675 *
···504513 xret = xrt_instance_create(NULL, &s->xinst);
505514 IPC_CHK_WITH_GOTO(s, xret, "xrt_instance_create", error);
506515507507- ret = ipc_server_mainloop_init(&s->ml);
516516+ ret = ipc_server_mainloop_init(&s->ml, s->no_stdin);
508517 if (ret < 0) {
509518 xret = XRT_ERROR_IPC_MAINLOOP_FAILED_TO_INIT;
510519 }
···1070107910711080 // Allocate the server itself.
10721081 struct ipc_server *s = U_TYPED_CALLOC(struct ipc_server);
10821082+10831083+ // Can be set by either.
10841084+ s->no_stdin = ismi->no_stdin || debug_get_bool_option_no_stdin();
1073108510741086#ifdef XRT_OS_WINDOWS
10751087 timeBeginPeriod(1);