SupervisorD

Gewijzigd op Do, 11 Dec om 1:17 PM

SupervisorD

Supervisor daemon is a client/server system that monitors and controls processes on UNIX-like operating systems. The Supervisor check monitors uptime, status, and number of running processes.


How to use SupervisorD

You configure your applications in its configuration file with their start commands and desired behaviour, then control or check the status of all programs using supervisorctl command-line tool.


Configuration file.

You can place your configuration files in ~/.config/supervisor/conf.d/.
Supervisord will automatically pick up any file ending with .conf.

Config files examples:

[program:my_app]
#The full command to execute
command=~/bin/php /path/to/your/app.php --config /path/to/config.ini
#Start the program when supervisord starts
autostart=true
#Restart the program if it exits unexpectedly
autorestart=true
#Log file for stdout
stdout_logfile=~/log/supervisor/my_app.log
#Log file for stderr
stderr_logfile=~/log/supervisor/my_app_error.log

You can define multiple programs in the same configuration file.

[program:my_app]
command=~/bin/php /path/to/your/app.php --config /path/to/config.ini

[program:my_other_app]
command=~/bin/php /path/to/your/my_other_app.php --config /path/to/config.ini


SupervisorD commands

CommandDescription
supervisorctl statusShows the current state (e.g., RUNNING, STOPPED, FATAL) of all managed programs.
supervisorctl start [program_name]Starts a specific program defined in the configuration.
supervisorctl stop [program_name]Gracefully stops a running program.
supervisorctl restart [program_name]Stops and then restarts a specific program.
supervisorctl rereadInstructs the daemon to read the configuration files for any changes.
supervisorctl updateApplies changes detected by reread (e.g., starts new programs or stops deleted ones). Always run after reread.
supervisorctl shutdownShuts down the Supervisord daemon entirely.
supervisorctl tail -f [program_name]Shows the last part of a program's output log and follows it (similar to tail -f).

Was dit artikel nuttig?

Dat is fantastisch!

Hartelijk dank voor uw beoordeling

Sorry dat we u niet konden helpen

Hartelijk dank voor uw beoordeling

Laat ons weten hoe we dit artikel kunnen verbeteren!

Selecteer tenminste een van de redenen
CAPTCHA-verificatie is vereist.

Feedback verzonden

We stellen uw moeite op prijs en zullen proberen het artikel te verbeteren