10

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

karel
  • 1,961
  • 2
  • 17
  • 26
deathangel908
  • 356
  • 5
  • 19

1 Answers1

6

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

graywolf
  • 901
  • 2
  • 8
  • 25