######## config for supervisord
STEP1) make default config file.
# /usr/local/bin/echo_supervisord_conf > /etc/supervisord.conf
STEP2) un-commnet “include block”.
# vi /etc/supervisord.conf [include] files = /etc/supervisord.d/*.ini
######## autostart for supervisord
TYPE A)
# vi /etc/rc.d/rc.local /usr/local/bin/supervisord -c /etc/supervisord.conf
TYPE B)
$ wget https://github.com/Supervisor/initscripts/ ????? (ex. redhat-init-jkoppe ) $ su - # cp redhat-init-jkoppe /etc/rc.d/init.d/supervisord # vi /etc/rc.d/init.d/supervisord path : /usr/bin/ -> /usr/local/bin/ # chmod 755 /etc/rc.d/init.d/supervisord # cp redhat-sysconfig-jkoppe /etc/sysconfig/supervisord # chkconfig --add supervisord # chkconfig --list supervisord
# /etc/rc.d/init.d/supervisord start Starting supervisord: /etc/rc.d/init.d/supervisord: line 36: PIDFILE: unbound variable # /etc/rc.d/init.d/supervisord start Starting supervisord: /etc/rc.d/init.d/supervisord: line 44: OPTIONS: unbound variable
If you have error “unbound variable” , you add “PIDFILE” , “OPTIONS” to “/etc/rc.d/init.d/supervisord”
# vi /etc/rc.d/init.d/supervisord PIDFILE=/var/run/supervisord.pid OPTIONS="-c /etc/supervisord.conf"
######## config for plack(starlet)
# vi /etc/supervisord.d/ean_starlet.ini [program:ean-starlet] directory=/var/www/Ean/app/Ean/script command=/var/www/Ean/local/perl5/bin/start_server --port=5000 --interval=10 \ -- /var/www/Ean/local/perl5/bin/plackup -E development \ --no-default-middleware -s Starlet --max-workers=25 --timeout=1800 \ --keepalive-timeout=0 --max-reqs-per-child=700 --min-reqs-per-child=1000 \ /var/www/Ean/app/Ean/script/Ean-server numprocs=1 autostart=true autorestart=true user=Eanapache redirect_stderr=true stdout_logfile=/var/log/Ean_starlet_log
※”-E development” means “$ export PLACK_ENV=development” .
######## set plack application to supervisord , and start
# /usr/local/bin/supervisorctl reread && /usr/local/bin/supervisorctl update # /usr/local/bin/supervisorctl start ean-starlet