Setting up daemontools to run services for an ordinary user

I always forget how to do this, so I’m writing it here in part as a reminder for myself next time I need to do this.

These instructions are for using daemontools and daemontools-run packages on Debian.

  1. Create a directory /etc/service/tonyg-services
  2. Create a file /etc/service/tonyg-services/run containing

    #!/bin/sh
    exec setuidgid tonyg svscan /home/tonyg/services
    

    Replace setuidgid with sudo -u if you want to preserve supplemental groups.

  3. Run chmod a+x /etc/service/tonyg-services/run
  4. Create /home/tonyg/services
  5. Create services ad libitum therein.