How To Install and configure daemon for supervisor on CentOS7
To Install and configure daemon for supervisor on CentOS7
Supervisor is a client/server process control system that allows its users to monitor and control a number of processes on Linux and other UNIX-like operating systems. Supervisor will mange your process to live all time. It is so simple to install Supervisor, and this article covers the method to install and configure Supervisor on CentOS7
Installing Daemon
It is really very essential to install the dependency python package in your system before you actually install the supervisor.
[root@linuxhelp ~]# yum -y install python-setuptools python-pip
BDB2053 Freeing read locks for locker 0x504: 2881/140415299045184
BDB2053 Freeing read locks for locker 0x506: 2881/140415299045184
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: centos.excellmedia.net
* extras: centos.excellmedia.net
* updates: centos.excellmedia.net
Package python-setuptools-0.9.8-7.el7.noarch already installed and latest version
Nothing to do
After that, you shall proceed with the installation of Supervisor and for that, you need to run the following command.
[root@linuxhelp ~]# easy_install supervisor
Searching for supervisor
Reading https://pypi.python.org/simple/supervisor/
Best match: supervisor 3.3.3
Downloading https://pypi.python.org/packages/31/7e/788fc6566211e77c395ea272058eb71299c65cc5e55b6214d479c6c2ec9a/supervisor-3.3.3.tar.gz#md5=0fe86dfec4e5c5d98324d24c4cf944bd
Processing supervisor-3.3.3.tar.gz
Writing /tmp/easy_install-rpPGqZ/supervisor-3.3.3/setup.cfg
Running supervisor-3.3.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-rpPGqZ/supervisor-3.3.3/egg-dist-tmp-F9eOtC
warning: no previously-included files matching ' *' found under directory ' docs/.build'
Adding supervisor 3.3.3 to easy-install.pth file
Installing echo_supervisord_conf script to /usr/bin
Installing pidproxy script to /usr/bin
Installing supervisorctl script to /usr/bin
Installing supervisord script to /usr/bin
Installed /usr/lib/python2.7/site-packages/supervisor-3.3.3-py2.7.egg
Processing dependencies for supervisor
Searching for meld3> =0.6.5
Reading https://pypi.python.org/simple/meld3/
Best match: meld3 1.0.2
Downloading https://pypi.python.org/packages/45/a0/317c6422b26c12fe0161e936fc35f36552069ba8e6f7ecbd99bbffe32a5f/meld3-1.0.2.tar.gz#md5=3ccc78cd79cffd63a751ad7684c02c91
Processing meld3-1.0.2.tar.gz
Writing /tmp/easy_install-OIgs1p/meld3-1.0.2/setup.cfg
Running meld3-1.0.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-OIgs1p/meld3-1.0.2/egg-dist-tmp-5t_61u
zip_safe flag not set analyzing archive contents...
Adding meld3 1.0.2 to easy-install.pth file
Installed /usr/lib/python2.7/site-packages/meld3-1.0.2-py2.7.egg
Finished processing dependencies for supervisor
Once it is installed, you shall check the version of Supervisor which you have just installed.
[root@linuxhelp ~]# supervisord -version
3.3.3
Later, you need to copy the configuration file from echo_supervisord_conf to /etc/ supervisord.conf, and for that purpose, you shall run the following command.
[root@linuxhelp ~]# echo_supervisord_conf > /etc/supervisord.conf
You should now create a new file in systemd location for daemon configuration. Do that through the vim editor as follows.
[root@linuxhelp ~]# vim /usr/lib/systemd/system/supervisord.service
In that file, you need to add the following lines.
[Unit] Description=supervisord - Supervisor process control system for UNIX Documentation=http://supervisord.org After=network.target [Service] User=user1 Type=forking ExecStart=/usr/bin/supervisord -c /etc/supervisord.conf ExecReload=/usr/bin/supervisorctl reload ExecStop=/usr/bin/supervisorctl shutdown [Install] WantedBy=multi-user.target
After the configuration, you need to reload the daemon as follows.
[root@linuxhelp ~]# systemctl daemon-reload
And then, enable supervisor with the help of the following command.
[root@linuxhelp ~]# systemctl enable supervisord
Created symlink from /etc/systemd/system/multi-user.target.wants/supervisord.service to /usr/lib/systemd/system/supervisord.service.
Later, you should start supervisor sevice, and for that you need to run the following command.
[root@linuxhelp ~]# systemctl start supervisord.service
You shall now check the status for supervisor.
[root@linuxhelp ~]# systemctl status supervisord.service
● supervisord.service - Process Monitoring and Control Daemon
Loaded: loaded (/usr/lib/systemd/system/supervisord.service disabled vendor preset: disabled)
Active: active (running) since Fri 2017-12-22 07:23:47 EST 7s ago
Process: 2999 ExecStart=/usr/bin/supervisord -c /etc/supervisord.conf (code=exited, status=0/SUCCESS)
Main PID: 3000 (supervisord)
CGroup: /system.slice/supervisord.service
└─3000 /usr/bin/python /usr/bin/supervisord -c /etc/supervisord.co...
Dec 22 07:23:47 linuxhelp.com systemd[1]: Starting Process Monitoring and Co....
Dec 22 07:23:47 linuxhelp.com systemd[1]: Started Process Monitoring and Con....
Hint: Some lines were ellipsized, use -l to show in full.
With this, the installation and configuration of daemon for Supervisor on CentOS7 comes to an end.
Comments ( 0 )
No comments available