Supervisor

A user-controlled daemon management system (designed for application management, not a replacement for init).
web | repo | ...

Notes

Commands

sudo supervisorctl status
sudo supervisorctl start NAME
sudo supervisorctl start all
sudo supervisorctl reload # loads new conf files and restarts all daemons

File locations (Debian/Ubuntu)

/etc/supervisor/conf.d/NAME.conf

Errors

unix:///var/run/supervisor.sock no such file
Very first check, run sudo service supervisor start to see if there were any errors parsing /etc/supervisor/supervisord.conf or any conf files in /etc/supervisor/conf.d/

Periodic behaviour (using

:cron

)

  1. Create script that starts the supervisor task

#!/bin/sh
/usr/bin/supervisorctl start TASK_NAME  # NB full path to supervisorctl

  1. Place script in /etc/cron.hourly/
  2. Script filename should be alphanumeric, may contain hyphen or underscore, may not contain period
  3. Make sure script is executable: chmod +x SCRIPT_NAME
  4. Run sudo run-parts --report --test /etc/cron.hourly and confirm script appears
  5. Run sudo run-parts --report /etc/cron.hourly and confirm script executes (NB this will run all scripts)
  6. Wait until scheduled time

To execute the same task in an ad-hoc manner, run sudo supervisorctl start TASK_NAME as normal

References:
http://stackoverflow.com/a/35917302/236081 cronning a supervisor task
https://askubuntu.com/questions/786799 (lists gotchas)

Other options:
https://github.com/klahnakoski/supervisor-plus-cron add period to tasks (start every X)
http://stackoverflow.com/a/27463377/236081 add period to tasks (wrapper logic)

Other schedules:
You could use custom :cron jobs



Backlinks: cron ikiwiki

CC0 / Public domain dedication To the extent possible under law, d3vid seaward has waived all copyright and related or neighboring rights to "Supervisor in Grasmere notebook, including code snippets" (why? how?)