September 26, 2015

use supervisor to monitor your process

https://serversforhackers.com/monitoring-processes-with-supervisord

sudo apt-get install -y supervisor

Let's create a configuration for it called webhooks.conf. This file will be created at /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-data
environment=SECRET_PASSPHRASE='this is secret',SECRET_TWO='another secret'
Then:
supervisorctl reread
supervisorctl update

No comments:

Post a Comment