How to install and configure the supervisor daemon under centos7

How to install and configure the supervisor daemon under centos7

Newbie, record it yourself

1. Install supervisor. Supervisor is developed based on Python. When you install Supervisor, Python dependencies are automatically installed, so no additional installation is required.

# yun install supervisor

2. After successful installation, check the relevant files and directories generated under /etc

supervisord.conf is the default configuration file

supervisord.d is the directory where separate configuration files for other programs are stored

3. Configure supervisord.conf

For all parameters, please refer to the official documentation. There are too many configuration items for us to understand. We only need to modify one place and keep the others unchanged.

# vim /etc/supervisord.conf

Locate the last [include] item in the document and change files = supervisord.d/*.ini to files = supervisord.d/*.conf to load the configuration of other applications.

4. Add a separate configuration file for the application (dotnet core)

Create a new configuration file in the supervisord.d directory

# touch /etc/supervisord.d/FirstApi.conf

Open the file and add the following content

[program:FirstApi]
#Command to execute command=dotnet FirstApi.dll
#Command execution directory directory=/home/www/first
#Environment variable environment=ASPNETCORE__ENVIRONMENT=Production
#Process execution user identity<br> user=root<br> stopsignal=INT
#Whether to start automatically autostart=true
#Whether to automatically restart autorestart=true
#Automatic restart interval seconds startsecs=1
#Standard error log stderr_logfile=/var/log/FirstApi.err.log
#Standard output log stdout_logfile=/var/log/FirstApi.out.log

5. Restart the supervisor service

# supervisord -c /etc/supervisord.conf

If the prompt "Another program is already listening on a port that one of our HTTP servers" appears, it means that the service is already running. You can restart the service by following the steps below.

#Enter the console# supervisorctl
#Reread the configuration
#Update configuration update
#Start all configurations start all
#Check the status after success 

At this time, visit the program address again and find that the project has run successfully!

This is the end of this article about how to install and configure the supervisor daemon under centos7. For more information about installing supervisor under centos7, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Building .NET Core 2.0 + Nginx + Supervisor environment under Centos7 system
  • Detailed tutorial on using supervisor in centos7

<<:  Vue uses element-ui to implement menu navigation

>>:  Basic usage of find_in_set function in mysql

Recommend

How many common loops do you know about array traversal in JS?

Preface As a basic data structure, arrays and obj...

Steps for docker container exit error code

Sometimes some docker containers exit after a per...

Detailed explanation of Nginx process scheduling problem

Nginx uses a fixed number of multi-process models...

vue-router hook function implements routing guard

Table of contents Overview Global hook function R...

Sample code for installing ASPNET.Core3.0 runtime in Linux

# The following examples are for x64-bit runtime ...

Vue + element to dynamically display background data to options

need: Implement dynamic display of option values ...

In-depth understanding of JavaScript callback functions

Table of contents Preface Quick Review: JavaScrip...

CSS screen size adaptive implementation example

To achieve CSS screen size adaptation, we must fi...

Web Design Teaching or Learning Program

Section Course content Hours 1 Web Design Overvie...

A brief discussion on the whole process of Vue's first rendering

Table of contents 1. Vue initialization vue entry...

How to install PostgreSQL11 on CentOS7

Install PostgreSQL 11 on CentOS 7 PostgreSQL: The...

Canonical enables Linux desktop apps with Flutter (recommended)

Google's goal with Flutter has always been to...

How to query whether the mysql table is locked

Specific method: (Recommended tutorial: MySQL dat...

Detailed explanation of Jquery datagrid query

Table of contents Add code to the Tree item; 1. S...