The operation of supervisor under Linux and the use of supervisor CTL

Time:2021-6-10

Running Supervisor

Running Supervisor requires at least one program block to be added to the configuration file.

# /etc/supervisord.conf

[program:foo]
command=/bin/cat

Start up:

$BINDIR/supervisord
#Or manually specify the configuration file to start
$BINDIR/supervisord -c /etc/supervisord.conf

The process will run as a daemon and separate from the current terminal. The operation log is saved in$CWD/supervisor.logIn the middle.

Run supervisorctl

$BINDIR/supervisorctl

Common parameters:

-C specifies the configuration file path, and / etc / supervisor.conf is the default
-The URL address monitored by the s supervisor service, which is the default http://localhost :9001
-U the user name of the authorization service
-P password for the authorization service

Common options:

#Reload the configuration and add / remove as needed, and the affected program will be restarted
supervisorctl update

#Restart the remote supervisor
supervisorctl reload

#Overload the configuration file of the daemons, excluding add / remove (do not restart)
supervisorctl reread

#Start the specified program
supervisorctl start <name>

#Start the specified program组
supervisorctl start <gname>:*

#Start all program groups
supervisorctl start all

#View the specified program status
supervisorctl status <name>

#View all program status
supervisorctl status

#Stop the specified program
supervisorctl stop <name>

#Stop the specified program组
supervisorctl stop <gname>:*

#Stop all programs
supervisorctl stop all

signal

This can be done in the[supervisord]NodalpidfileProcess ID found in parameter.

  • SIGTERM: close supervisor and all its subprocesses.
  • SIGINT: close supervisor and all its subprocesses.
  • Sigquit: close supervisor and all its subprocesses.
  • SIGHUP: stop all processes, reload configuration files, and start all processes.
  • Sigusr2: close and reopen the main activity log and all sub log files.

Start up and Run Supervisor automatically

https://github.com/Supervisor…

Recommended Today

Swift advanced (XV) extension

The extension in swift is somewhat similar to the category in OC Extension can beenumeration、structural morphology、class、agreementAdd new features□ you can add methods, calculation attributes, subscripts, (convenient) initializers, nested types, protocols, etc What extensions can’t do:□ original functions cannot be overwritten□ you cannot add storage attributes or add attribute observers to existing attributes□ cannot add parent […]