Supervisord là công cụ quản lý unix process
Một trong những ứng dụng của Supervisor là quản lý background process dạng Worker.
#!/bin/cat |
yum install vim tar wget make automake autoconf gcc gcc-c++ pcre-devel openssl-devel | |
mkdir ~/src | |
mkdir ~/src/modules | |
cd ~/src | |
wget -O modules/echo-nginx-module.tar.gz https://github.com/openresty/echo-nginx-module/archive/v0.57.tar.gz | |
tar -xvfz modules/echo-nginx-module.tar.gz -c modules | |
wget -O modules/header-more-nginx.tar.gz https://github.com/openresty/headers-more-nginx-module/archive/v0.25.tar.gz |
# Short-Description: start and stop nginx | |
#!/bin/sh | |
# | |
# nginx Startup script for nginx | |
# | |
# chkconfig: - 85 15 | |
# processname: nginx | |
# config: /etc/nginx/nginx.conf | |
# config: /etc/sysconfig/nginx | |
# pidfile: /var/run/nginx.pid |
#!/bin/bash | |
. /etc/init.d/functions | |
DAEMON=/usr/bin/supervisord | |
PIDFILE=/var/run/supervisord.pid | |
[ -x "$DAEMON" ] || exit 0 | |
start() { |
[unix_http_server] | |
file=/var/run/supervisor.sock ; (the path to the socket file) | |
chmod=0700 ; socket file mode (default 0700) | |
[supervisord] | |
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log) | |
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB) | |
logfile_backups=10 ; (num of main logfile rotation backups;default 10) | |
loglevel=info ; (log level;default info; others: debug,warn,trace) | |
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid) |
[program:poc] | |
command=echo | |
process_name=%(program_name)s | |
numprocs=1 | |
directory=$_workdir | |
umask=022 | |
priority=999 | |
autostart=true | |
autorestart=true | |
startsecs=1 |
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: haproxy | |
# Required-Start: $local_fs $network $remote_fs | |
# Required-Stop: $local_fs $remote_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: fast and reliable load balancing reverse proxy | |
# Description: This file should be used to start and stop haproxy. | |
### END INIT INFO |
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: haproxy | |
# Required-Start: $local_fs $network $remote_fs | |
# Required-Stop: $local_fs $remote_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: fast and reliable load balancing reverse proxy | |
# Description: This file should be used to start and stop haproxy. | |
### END INIT INFO |
#!/bin/sh | |
# chkconfig: 2345 99 01 | |
# description: SoftEther VPN Server | |
DAEMON=/home/vpnserver/vpnserver | |
LOCK=/var/lock/subsys/vpnserver | |
test -x $DAEMON || exit 0 | |
case "$1" in |