Skip to content

Instantly share code, notes, and snippets.

@fire9
Created December 25, 2017 09:21
Show Gist options
  • Save fire9/624e119e2146781eb3add38170a76668 to your computer and use it in GitHub Desktop.
Save fire9/624e119e2146781eb3add38170a76668 to your computer and use it in GitHub Desktop.
Supervisor Note

Supervisor

sudo apt-get update
sudo apt-get install -y supervisor
supervisorctl help
supervisorctl reread

Configuration /etc/supervisor/supervisord.conf

[include]
files = /etc/supervisor/conf.d/*.conf

[inet_http_server]
port = 9000
username = user # Basic auth username
password = pass # Basic auth password

Create File /etc/supervisor/conf.d/webhooks.conf

[program:nodehook]
command=/usr/bin/node /srv/http.js
directory=/srv
autostart=true
autorestart=true
startretries=3
stderr_logfile=/var/log/webhook/nodehook.err.log
stdout_logfile=/var/log/webhook/nodehook.out.log
user=www
environment=SECRET_PASSPHRASE='this is secret',SECRET_TWO='another secret'
sudo mkdir /var/log/webhook

supervisorctl reread
supervisorctl update

supervisorctl

Available commands output here

supervisorctl start nodehook

supervisor> help

supervisor> stop nodehook
nodehook: stopped
Then we can start it back up

supervisor> start nodehook
nodehook: started

cankao

Circus: A Process & Socket Manager process-monitoring-with-supervisord

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment