Home | News | Download | Packages | Forum | Wiki | Github

Setting up runit user services


I’ve been trying to setup user-services with runit as detailed in http://smarden.org/runit/faq.html#userservices. Unfortunately, when checking the status of runsvdir-[username], it shows that it’s down, and trying to start it will fail with it hanging.

Here are the steps that I followed to attempt to get this working:

  1. sudo mkdir -p /etc/sv/runsvdir-jerry
  2. set /etc/sv/runsvdir-jerry/run to contain:
exec 2>&1
exec chpst -u jerry runsvdir /home/jerry/.service
  1. sudo ln -s /etc/sv/runsvdir-jerry /var/service

As a side note, is there any way to get logs on how this might be failing?


(Jacob Moen) #2

I am not an expert in bash/sh and *nix, but if your script is trying to run itself in the background, it shouldn’t.

The runit “thingie” will make sure that it gets backgrounded. :slight_smile:


Void Linux/Wiki/Runit/Example


chmod +x run


Doh, so obvious in hindsight, thanks!

EDIT: referring to chmod +x run


As a non-root user, would you then create your user services (ie., in ~/sv/theme-demon) and do

ln -s ~/sv/theme-demon ~/.service/

in order for runit to pick it up?

(Michael Aldridge) #6

@pelf yes, that is correct.