7

I'm trying to set up runit and logging on my debian wheezy VM. So far I've managed to get gunicorn service to start by following this setup:

sudo mkdir /etc/sv/gunicorn
sudo vi /etc/sv/gunicorn/run
sudo ln -s /etc/sv/gunicorn/run /etc/service

My log run file has:

LOG_DIR=/home/$USER/logs/gunicorn/

exec svlogd -tt $LOG_DIR

When I run sudo runsvdir /etc/service/gunicorn

runsv supervise: fatal: unable to lock supervise/lock: temporary failure

No idea what I'm doing wrong, any pointers?

jwesonga
  • 4,249
  • 16
  • 56
  • 83

3 Answers3

4

In ls -la /etc/service/gunicorn/supervise i didn't see a .lock but there was a lock file. Removing that lock file caused a bit of mayhem.

Thus i got rid of the symlink; killed the pids in ps aux | grep gunicorn and re symlinked. May be the ultimate end, but does get the job done.

pjammer
  • 9,489
  • 5
  • 46
  • 56
2

Are you sure that the previous process has shut down completely? You may need to find and remove a .lock or .pid file that tells the system that it is in use by another process

paulscott56
  • 496
  • 4
  • 7
2

This can be caused by the runit daemon being stopped while it's individual services are still running.

Instead of deleting & re-creating symlinks for the runit service:

sv stop myservice
rm /etc/sv/myservice/supervise/lock
sv start myservice # or start the runit service

In your particular case your symlink was incorrect & should be:

ln -s /etc/sv/gunicorn /etc/service/gunicorn

You should be symlinking the sv directory not the run file into /etc/service/myservice

Stuart Cardall
  • 2,099
  • 24
  • 18