Process States
A process controlled by supervisord will be in one of the below statesat any given time. You may see these state names in various userinterface elements in clients.
STOPPED (0)
The process has been stopped due to a stop request orhas never been started.
STARTING (10)
The process is starting due to a start request.
RUNNING (20)
The process is running.
BACKOFF (30)
The process entered the STARTING state but subsequently exitedtoo quickly to move to the RUNNING state.
STOPPING (40)
The process is stopping due to a stop request.
EXITED (100)
The process exited from the RUNNING state (expectedly orunexpectedly).
FATAL (200)
The process could not be started successfully.
UNKNOWN (1000)
The process is in an unknown state (supervisordprogramming error).
Each process run under supervisor progresses through these states asper the following directed graph.
Subprocess State Transition Graph
A process is in the STOPPED state if it has been stoppedadminstratively or if it has never been started.
When an autorestarting process is in the BACKOFF state, it will beautomatically restarted by supervisord. It will switchbetween STARTING and BACKOFF states until it becomes evidentthat it cannot be started because the number of startretries hasexceeded the maximum, at which point it will transition to theFATAL state. Each start retry will take progressivelymore time.
When a process is in the EXITED state, it willautomatically restart:
- never if its autorestart parameter is set to false.
- unconditionally if its autorestart parameter is set to true.
- conditionally if its autorestart parameter is set tounexpected. If it exited with an exit code that doesn’t matchone of the exit codes defined in the exitcodes configurationparameter for the process, it will be restarted.
A process automatically transitions from EXITED to RUNNING asa result of being configured to autorestart conditionally orunconditionally. The number of transitions between RUNNING andEXITED is not limited in any way: it is possible to create aconfiguration that endlessly restarts an exited process. This is afeature, not a bug.
An autorestarted process will never be automatically restarted if itends up in the FATAL state (it must be manually restarted fromthis state).
A process transitions into the STOPPING state via anadministrative stop request, and will then end up in theSTOPPED state.
A process that cannot be stopped successfully will stay in theSTOPPING state forever. This situation should never be reachedduring normal operations as it implies that the process did notrespond to a final SIGKILL signal sent to it by supervisor, whichis “impossible” under UNIX.
State transitions which always require user action to invoke arethese:
FATAL -> STARTING
RUNNING -> STOPPING
State transitions which typically, but not always, require useraction to invoke are these, with exceptions noted:
STOPPED -> STARTING (except at supervisord startup if processis configured to autostart)
EXITED -> STARTING (except if process is configured toautorestart)
All other state transitions are managed by supervisord automatically.