Runit – Fix ‘Unable to Open Supervise/Ok: File Does Not Exist’ Error

daemondaemontoolsinitrunitubuntu-12.04

I'm trying to figure out why runit will not boot or give me the status for the managed applications. Running on Ubuntu 12.04.

I created /service, /etc/sv/myapp (with a run script, a config file, a log folder and a run script inside of it). I create a symlink from /service/ to /etc/sv/myapp

When I run

sudo sv s /service/*

I get the following error message:

warning: /service/myapp: unable to open supervice/ok: file does not exist

Some of my Googling revealed that supposedly rebooting the svscan service might fix this, but killing it and running svscanboot didn't make a difference.

Any suggestions? Am I missing a step here somewhere?

Best Answer

In my case I deleted the lock and pid from the service configuration after stopping the service:

# stops the service 
sv down serviceName

# deletes the 'pid' and 'lock' files
find -L /etc/service/serviceName -type f \( -name "pid" -o -name "lock" \) -delete

# starts the service
sv up serviceName

# verify service status
sv s serviceName

It took me a while to find the solution, so I hope it helps somebody else.