Supervisor deploys go gin service or deploys independently under Linux
Supervisor deployment method
supervisord installation
wget https://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg
sh setuptools-0.6c11-py2.7.egg
easy_install supervisor
echo_supervisord_conf >/etc/supervisord.conf
mkdir /etc/supervisord.conf.d
Modify the configuration /etc/supervisord.conf
[include]
files = /etc/supervisord.conf.d/*.conf
New management application
cd /etc/supervisord.conf.d
vim idphoto_server_lite_supervisor.conf
Configuration file:
command execute command
directory cd to the specified directory
environment environment variable configuration
[program:idphoto_server_lite]
command = ./main
directory = /data2/yingjie/go/idphoto_server_lite
autostart = true
autorestart = true
startretries=10 ; maximum number of retries when startup fails
startsecs = 5
user = root
redirect_stderr = true
stopsignal=QUIT ; signal used to kill process (default TERM)
stopwaitsecs=2 ; max num secs to wait b4 SIGKILL (default 10)
stopasgroup=true ; send stop signal to the UNIX process group (default false)
killasgroup=true ; SIGKILL the UNIX process group (def false)
stdout_logfile = /data2/yingjie/go/idphoto_server_lite/super_log/idphoto_server_lite_supervisor.log
environment=LD_LIBRARY_PATH=/data2/yingjie/go/idphoto_server_lite/c_library/idphoto/libs