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.
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.
You can place your configuration files in ~/.config/supervisor/conf.d/.
Supervisord will automatically pick up any file ending with .conf.
[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
| Command | Description |
|---|---|
| supervisorctl status | Shows 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 reread | Instructs the daemon to read the configuration files for any changes. |
| supervisorctl update | Applies changes detected by reread (e.g., starts new programs or stops deleted ones). Always run after reread. |
| supervisorctl shutdown | Shuts 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
Feedback verzonden
We stellen uw moeite op prijs en zullen proberen het artikel te verbeteren