12

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

1 Answer 1

7

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)).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .