installation of supervisor
aptitude install supervisor
setting of supervisor
vim /etc/supervisor/conf.d/programname.conf
[program:programname]
user=username
directory=/home/username/programname
command=/home/username/programname/script/run.sh
autostart=true
autorestart=true
stopsignal=QUIT
stdout_logfile=/var/log/supervisor/programname.log
stderr_logfile=/var/log/supervisor/programname_error.log
creating a run script
vim /home/username/programname/script/run.sh
#!/bin/bash
cd /home/username/programname/
export HOME=/home/username
exec /home/username/perl5/perlbrew/perls/perl-5.20.1/bin/start_server \
--port 3000 \
--interval 2 \
-- /home/username/perl5/perlbrew/perls/perl-5.20.1/bin/plackup \
-Ilib -s Starman \
-E production \
/home/username/programname/webapp.pl \
--workers 6
restart of supervisor
/etc/init.d/supervisor restart
Check Status
supervisorctl status
supervisorctl start, stop, reload
supervisorctl start programname
supervisorctl stop programname
supervisorctl reread
Confirmation
pkill starman
ps aux | grep starman
reference materials:
0 件のコメント:
コメントを投稿