Ubuntu – Runit logging not working

loggingrunitUbuntu

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

run: service_name: (pid 17373) 1sfail: service_name: runsv not running

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 a runsv with the logger attached to it? Does runsv have the daemon/process attached to it? Is there an runsv at all?

Related Topic