summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2025-03-04 20:54:48 +0100
committerAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2025-03-04 21:11:27 +0100
commitd1bf4263d5f680e93fdf73a2311ff5712dc6e12c (patch)
tree4066ff52f6221a1dcac24b527f6eae8cdcc238f6
parentef193417c202cc23a4f5502d2eb6ae475cdd5ffd (diff)
openrc-run: default supervisor stdout and stderr to loggerorigin/default_logger
Currently we redirect any stdout and stderr output to /dev/null. This is making debugging, or helping others debug, unnecessarily harder, so let's just assign a sane default that should work on most systems.
-rw-r--r--etc/rc.conf7
-rw-r--r--sh/openrc-run.sh.in4
2 files changed, 11 insertions, 0 deletions
diff --git a/etc/rc.conf b/etc/rc.conf
index ca0f9207..73b65847 100644
--- a/etc/rc.conf
+++ b/etc/rc.conf
@@ -54,6 +54,13 @@
# The default value is: /var/log/rc.log
#rc_log_path="/var/log/rc.log"
+# rc_output_logger and rc_error_logger specify the default commands
+# used to log the stdout and stderr of services.
+# Scripts can override those by setting output_logger and error_logger,
+# respectively, to a value, or disable logging by setting to null.
+#rc_output_logger="logger -t 'openrc[$RC_SVCNAME]' -p daemon.notice"
+#rc_error_logger="logger -t 'openrc[$RC_SVCNAME]' -p daemon.err"
+
# If you want verbose output for OpenRC, set this to yes. If you want
# verbose output for service foo only, set it to yes in /etc/conf.d/foo.
#rc_verbose=no
diff --git a/sh/openrc-run.sh.in b/sh/openrc-run.sh.in
index c8e347dd..ca22915d 100644
--- a/sh/openrc-run.sh.in
+++ b/sh/openrc-run.sh.in
@@ -164,6 +164,10 @@ _status()
default_start()
{
local func=ssd_start
+
+ : ${output_logger=${rc_output_logger-"logger -t 'openrc[$RC_SVCNAME]' -p daemon.notice"}}
+ : ${error_logger=${rc_error_logger-"logger -t 'openrc[$RC_SVCNAME]' -p daemon.err"}}
+
case "$supervisor" in
runit) func=runit_start ;;
s6) func=s6_start ;;