A process controlled by supervisord will be in one of the below
states at any given time. You may see these state names in various user
interface elements in clients.
Each process run under supervisor progresses through these states
as per the following directed graph.
[image: Subprocess State Transition Graph] [image]
Subprocess State Transition Graph.UNINDENT
A process is in the STOPPED state if it has been stopped
adminstratively or if it has never been started.
When an autorestarting process is in the BACKOFF state, it
will be automatically restarted by supervisord. It will switch
between STARTING and BACKOFF states until it becomes evident
that it cannot be started because the number of startretries has
exceeded the maximum, at which point it will transition to the FATAL
state. Each start retry will take progressively more time.
When a process is in the EXITED state, it will
automatically 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 to
unexpected. If it exited with an exit code that doesn't match one
of the exit codes defined in the exitcodes configuration parameter
for the process, it will be restarted.
A process automatically transitions from EXITED to
RUNNING as a result of being configured to autorestart conditionally
or unconditionally. The number of transitions between RUNNING and
EXITED is not limited in any way: it is possible to create a
configuration that endlessly restarts an exited process. This is a feature,
not a bug.
An autorestarted process will never be automatically restarted if
it ends up in the FATAL state (it must be manually restarted from
this state).
A process transitions into the STOPPING state via an
administrative stop request, and will then end up in the STOPPED
state.
A process that cannot be stopped successfully will stay in the
STOPPING state forever. This situation should never be reached during
normal operations as it implies that the process did not respond to a final
SIGKILL signal sent to it by supervisor, which is
"impossible" under UNIX.
State transitions which always require user action to invoke are
these:
FATAL -> STARTING
RUNNING -> STOPPING
State transitions which typically, but not always, require user
action to invoke are these, with exceptions noted:
STOPPED -> STARTING (except at supervisord
startup if process is configured to autostart)
EXITED -> STARTING (except if process is
configured to autorestart)
All other state transitions are managed by supervisord
automatically.