Skip to content

Commit

Permalink
openrc-run: default supervisor stdout and stderr to logger
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
navi-desu committed Mar 4, 2025
1 parent ef19341 commit d1bf426
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions etc/rc.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions sh/openrc-run.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 ;;
Expand Down

0 comments on commit d1bf426

Please sign in to comment.