9

How do I find stdout of a process in openrc?

Here's how I created my daemon.

/etc/init.d/mydaemon

#!/sbin/openrc-run

command="python3"
command_args="/srv/http/tornado.py"
command_background="yes"
pidfile="/tmp/tornado.pid"

All I get in my logs is:

 * Starting tornado ... [ ok ]

I have default /etc/rc.conf with set rc_logger="YES". What I would like to get is something like systemd allows to view stdout of a daemon with sudo journalctl -u mydaemon

5

You can specify output_log, error_log or output_logger, error_logger. So you can extend you service file to be

#!/sbin/openrc-run

command="python3"
command_args="/srv/http/tornado.py"
command_background="yes"
pidfile="/tmp/tornado.pid"
output_log="/var/log/tornado.log"
error_log="/var/log/tornado.err"

And then you will find the output inside /var/log/tornado.log. More details can be found in manpage of openrc-run (openrc-run(8)).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.