runit

user services

manage user services we first have to create a system service, that watches a directory, where we save our user services. just like in the void documetation we just change the user directory:

cat /etc/sv/runsvdir-<username>
#!/bin/sh

export USER="<username>"
export HOME="/home/<username>"

groups="$(id -Gn "$USER" | tr ' ' ':')"
svdir="$HOME/.config/service"

exec chpst -u "$USER:$groups" runsvdir "$svdir"