Supervisor deployment

[Supervisor]( )It is a client / server service developed with Python. It is a process management tool under Linux / Unix system and does not support windows system. It is convenient to monitor, start, stop and restart one or more processes. For processes managed by supervisor, when a process is accidentally killed, it will be automatically pulled up again. Developers do not need to write their own shell for process management to maintain their own services.

Install Supervisor

Use the installation method under the 'Ubuntu' system to demonstrate:

apt-get -y install supervisor

Create profile

vim /etc/supervisor/conf.d/easyswoole.conf

The contents of the document are as follows:

# Set the app name to easywoole
# Set running directory
# Start command for project
command=php easyswoole server start
# Set the user to run the process
# Do you want to start the application automatically when supervisor starts
# Does the process exit and restart automatically
# How many seconds after the process starts is considered to be successful. The default is 1s
# The maximum number of failed attempts is 3 by default
# stderr
# stdout


service supervisor start


Start EasySwoole

supervisorctl start easyswoole

Stop EasySwoole

supervisorctl stop easyswoole

Restart EasySwoole

supervisorctl restart easyswoole

View all monitored apps

supervisorctl status

Reload configuration file

supervisorctl update

Restart all apps

supervisorctl reload