Archivy in supervisord

How to daemonize it

I wanted to run Archivy under supervisord. I installed it locally under its own user. $ pip install archivy

It worked fine when running it manually, but under supervisord it could not find its main python module.

Here's what fixed the problem

$ cat /usr/local/etc/supervisord.conf
[program:archivy]
command=/home/arch/.local/bin/archivy run
directory=/home/arch
autostart=true
autorestart=false
startsecs=10
user=arch
stdout_logfile=/home/arch/arch_log
log_stdout=true
log_stderr=true
stopwaitsecs=20
killasgroup=true
priority=500
environment=HOME=/home/arch

Setting the HOME environment variable was necessary to make it work.