I created a service with runit. Service starts and falls without logging. I need information about STDOUT of service for error detection (service starts without runit properly).
I created a directory /etc/sv/service_name/log
, created run executable for logging (setup executable bit too):
#!/bin/sh
exec svlogd -t /var/log/service_name
And create directory /var/log/service_name
However, after service start/restart log directory is empty
I run service as:
$ sv start service_name
ok: run: service_name: (pid 17017) 0s
$ sv status service_name
run: service_name: (pid 17373) 1sfail: service_name: runsv not running
What's wrong in my logging configuration?
Best Answer
Based on your answer, the clue
tells me that the issue isn't the log, rather, your service itself is failing. What does
ps fax
report to you? Do you see arunsv
with the logger attached to it? Doesrunsv
have the daemon/process attached to it? Is there anrunsv
at all?