How to Install supervisord in Linux CentOS 7

Posted on

Introduction

This is an article which is displaying steps for the installation of supervisor. Actually, the process for installing supervisor in this article exist in the Linux CentOS 7. Basically, supervisor is very useful as it exist in its official reference in this link. As in that reference link, supervisor is a client/server system that allows its users to monitor and control a number of processes on UNIX-like operating systems. Moreover, it shares some of the same goals of programs like launchd, daemontools, and runit. Finally, as an addition, unlike some of these programs, it is not running as a substitute for init as “process id 1”. Instead it is running to control processes related to a project or a customer, and is meant to start like any other program at boot time.

Supervisor Installation

So, without further explanation, the following is the actual process for installing supervisor :

  1. First of all, just login to the operating system.

  2. The following after, just switch to ‘root’ or super user in order to have a privilege for package installation.

  3. Next, just execute the following command to install ‘supervisor’ as follows :

    [root@localhost ~]# yum -y install supervisor
    Loaded plugins: fastestmirror
    Determining fastest mirrors
    epel/x86_64/metalink                                                                                                                                 | 7.9 kB  00:00:00
     * base: xxxxxxx.xxxxx.xxx.xx
     * epel: xxxxxxx.xxxxxxxxxxxxxxx.xxx.xx
     * extras: xxxxxxx.xxxxxxx.xxx.xx
     * updates: xxxxxxx.xxxxx.xxxxx
    base                                                                                                                                                 | 3.6 kB  00:00:00
    docker-ce-stable                                                                                                                                     | 3.5 kB  00:00:00
    epel                                                                                                                                                 | 4.7 kB  00:00:00
    extras                                                                                                                                               | 2.9 kB  00:00:00
    pgdg-common/7/x86_64/signature                                                                                                                       |  198 B  00:00:00
    pgdg-common/7/x86_64/signature                                                                                                                       | 2.9 kB  00:00:00 !!!
    pgdg10/7/x86_64/signature                                                                                                                            |  198 B  00:00:00
    pgdg10/7/x86_64/signature                                                                                                                            | 3.6 kB  00:00:00 !!!
    pgdg11/7/x86_64/signature                                                                                                                            |  198 B  00:00:00
    pgdg11/7/x86_64/signature                                                                                                                            | 3.6 kB  00:00:00 !!!
    pgdg12/7/x86_64/signature                                                                                                                            |  198 B  00:00:00
    pgdg12/7/x86_64/signature                                                                                                                            | 3.6 kB  00:00:00 !!!
    pgdg13/7/x86_64/signature                                                                                                                            |  198 B  00:00:00
    pgdg13/7/x86_64/signature                                                                                                                            | 3.6 kB  00:00:00 !!!
    pgdg14/7/x86_64/signature                                                                                                                            |  198 B  00:00:00
    pgdg14/7/x86_64/signature                                                                                                                            | 3.6 kB  00:00:00 !!!
    pgdg96/7/x86_64/signature                                                                                                                            |  198 B  00:00:00
    pgdg96/7/x86_64/signature                                                                                                                            | 3.6 kB  00:00:00 !!!
    updates                                                                                                                                              | 2.9 kB  00:00:00
    (1/22): base/7/x86_64/group_gz                                                                                                                       | 153 kB  00:00:00
    (2/22): docker-ce-stable/7/x86_64/primary_db                                                                                                         |  69 kB  00:00:00
    (3/22): docker-ce-stable/7/x86_64/updateinfo                                                                                                         |   55 B  00:00:00
    (4/22): epel/x86_64/group_gz                                                                                                                         |  96 kB  00:00:00
    (5/22): epel/x86_64/updateinfo                                                                                                                       | 1.0 MB  00:00:00
    (6/22): extras/7/x86_64/primary_db                                                                                                                   | 243 kB  00:00:00
    (7/22): pgdg10/7/x86_64/group_gz                                                                                                                     |  245 B  00:00:01
    (8/22): base/7/x86_64/primary_db                                                                                                                     | 6.1 MB  00:00:01
    (9/22): pgdg11/7/x86_64/group_gz                                                                                                                     |  245 B  00:00:00
    (10/22): pgdg12/7/x86_64/group_gz                                                                                                                    |  245 B  00:00:00
    (11/22): pgdg-common/7/x86_64/primary_db                                                                                                             | 147 kB  00:00:01
    (12/22): pgdg13/7/x86_64/group_gz                                                                                                                    |  246 B  00:00:00
    (13/22): pgdg10/7/x86_64/primary_db                                                                                                                  | 355 kB  00:00:01
    (14/22): pgdg13/7/x86_64/primary_db                                                                                                                  | 155 kB  00:00:00
    (15/22): pgdg14/7/x86_64/group_gz                                                                                                                    |  244 B  00:00:00
    (16/22): pgdg12/7/x86_64/primary_db                                                                                                                  | 240 kB  00:00:00
    (17/22): pgdg14/7/x86_64/primary_db                                                                                                                  |  72 kB  00:00:00
    (18/22): pgdg96/7/x86_64/group_gz                                                                                                                    |  249 B  00:00:00
    (19/22): pgdg11/7/x86_64/primary_db                                                                                                                  | 380 kB  00:00:01
    (20/22): pgdg96/7/x86_64/primary_db                                                                                                                  | 341 kB  00:00:00
    (21/22): epel/x86_64/primary_db                                                                                                                      | 7.0 MB  00:00:03
    (22/22): updates/7/x86_64/primary_db                                                                                                                 |  12 MB  00:00:02
    Resolving Dependencies
    --> Running transaction check
    ---> Package supervisor.noarch 0:3.4.0-1.el7 will be installed
    --> Processing Dependency: python-meld3 >= 0.6.5 for package: supervisor-3.4.0-1.el7.noarch
    --> Running transaction check
    ---> Package python-meld3.x86_64 0:0.6.10-1.el7 will be installed
    --> Finished Dependency Resolution
    Dependencies Resolved
    ============================================================================================================================================================================
     Package                                     Arch                                  Version                                        Repository                           Size
    ============================================================================================================================================================================
    Installing:
     supervisor                                  noarch                                3.4.0-1.el7                                    epel                                498 k
    Installing for dependencies:
     python-meld3                                x86_64                                0.6.10-1.el7                                   epel                                 73 k
    Transaction Summary
    ============================================================================================================================================================================
    Install  1 Package (+1 Dependent package)
    Total download size: 571 k
    Installed size: 2.9 M
    Downloading packages:
    (1/2): python-meld3-0.6.10-1.el7.x86_64.rpm                                                                                                          |  73 kB  00:00:00
    (2/2): supervisor-3.4.0-1.el7.noarch.rpm                                                                                                             | 498 kB  00:00:00
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Total                                                                                                                                       1.5 MB/s | 571 kB  00:00:00
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
      Installing : python-meld3-0.6.10-1.el7.x86_64                                                                                                                         1/2
      Installing : supervisor-3.4.0-1.el7.noarch                                                                                                                            2/2
      Verifying  : python-meld3-0.6.10-1.el7.x86_64                                                                                                                         1/2
      Verifying  : supervisor-3.4.0-1.el7.noarch                                                                                                                            2/2
    Installed:
      supervisor.noarch 0:3.4.0-1.el7
    Dependency Installed:
      python-meld3.x86_64 0:0.6.10-1.el7
    Complete!
    [root@localhost ~]#
    
  4. Finally, after successfully installing supervisor, just start the service in order for the supervisor service to be active. The following is the command in order to be able to do that :

    [root@localhost ~]# systemctl start supervisord
    [root@localhost ~]#
    
  5. Last but not least, in order to be able to check whether supervisor service is running properly or not by typing the following command :

    [root@localhost ~]# systemctl status supervisord
    ● supervisord.service - Process Monitoring and Control Daemon
       Loaded: loaded (/usr/lib/systemd/system/supervisord.service; disabled; vendor preset: disabled)
       Active: active (running) since Thu 2021-11-25 16:54:22 UTC; 3s ago
      Process: 2206 ExecStart=/usr/bin/supervisord -c /etc/supervisord.conf (code=exited, status=0/SUCCESS)
     Main PID: 2209 (supervisord)
       CGroup: /system.slice/supervisord.service
               ├─2209 /usr/bin/python /usr/bin/supervisord -c /etc/supervisord.conf
               ├─2219 /home/django/env/bin/python /home/django/env/bin/gunicorn --workers 3 --bind unix:/home/django/newsinergi/core.sock core.wsgi:appl...
               ├─2222 /home/django/env/bin/python /home/django/env/bin/gunicorn --workers 3 --bind unix:/home/django/newsinergi/core.sock core.wsgi:appl...
               └─2224 /home/django/env/bin/python /home/django/env/bin/gunicorn --workers 3 --bind unix:/home/django/newsinergi/core.sock core.wsgi:appl...
    Nov 25 16:54:22 localhost systemd[1]: Starting Process Monitoring and Control Daemon...
    Nov 25 16:54:22 localhost systemd[1]: Started Process Monitoring and Control Daemon.
    [root@localhost ~]#
    

Leave a Reply