configuration.rst 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498
  1. Configuration File
  2. ==================
  3. The Supervisor configuration file is conventionally named
  4. :file:`supervisord.conf`. It is used by both :program:`supervisord`
  5. and :program:`supervisorctl`. If either application is started
  6. without the ``-c`` option (the option which is used to tell the
  7. application the configuration filename explicitly), the application
  8. will look for a file named :file:`supervisord.conf` within the
  9. following locations, in the specified order. It will use the first
  10. file it finds.
  11. #. :file:`$CWD/supervisord.conf`
  12. #. :file:`$CWD/etc/supervisord.conf`
  13. #. :file:`/etc/supervisord.conf`
  14. #. :file:`../etc/supervisord.conf` (Relative to the executable)
  15. #. :file:`../supervisord.conf` (Relative to the executable)
  16. .. note::
  17. Some distributions have packaged Supervisor with their own
  18. customizations. These modified versions of Supervisor may load the
  19. configuration file from locations other than those described here.
  20. Notably, Ubuntu packages have been found that use
  21. ``/etc/supervisor/supervisord.conf``.
  22. File Format
  23. -----------
  24. :file:`supervisord.conf` is a Windows-INI-style (Python ConfigParser)
  25. file. It has sections (each denoted by a ``[header]``) and key / value
  26. pairs within the sections. The sections and their allowable values
  27. are described below.
  28. Environment Variables
  29. ~~~~~~~~~~~~~~~~~~~~~
  30. Environment variables that are present in the environment at the time that
  31. :program:`supervisord` is started can be used in the configuration file
  32. using the Python string expression syntax ``%(ENV_X)s``:
  33. .. code-block:: ini
  34. [program:example]
  35. command=/usr/bin/example --loglevel=%(ENV_LOGLEVEL)s
  36. In the example above, the expression ``%(ENV_LOGLEVEL)s`` would be expanded
  37. to the value of the environment variable ``LOGLEVEL``.
  38. .. note::
  39. In Supervisor 3.2 and later, ``%(ENV_X)s`` expressions are supported in
  40. all options. In prior versions, some options support them, but most
  41. do not. See the documentation for each option below.
  42. ``[unix_http_server]`` Section Settings
  43. ---------------------------------------
  44. The :file:`supervisord.conf` file contains a section named
  45. ``[unix_http_server]`` under which configuration parameters for an
  46. HTTP server that listens on a UNIX domain socket should be inserted.
  47. If the configuration file has no ``[unix_http_server]`` section, a
  48. UNIX domain socket HTTP server will not be started. The allowable
  49. configuration values are as follows.
  50. ``[unix_http_server]`` Section Values
  51. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  52. ``file``
  53. A path to a UNIX domain socket (e.g. :file:`/tmp/supervisord.sock`)
  54. on which supervisor will listen for HTTP/XML-RPC requests.
  55. :program:`supervisorctl` uses XML-RPC to communicate with
  56. :program:`supervisord` over this port. This option can include the
  57. value ``%(here)s``, which expands to the directory in which the
  58. :program:`supervisord` configuration file was found.
  59. *Default*: None.
  60. *Required*: No.
  61. *Introduced*: 3.0
  62. ``chmod``
  63. Change the UNIX permission mode bits of the UNIX domain socket to
  64. this value at startup.
  65. *Default*: ``0700``
  66. *Required*: No.
  67. *Introduced*: 3.0
  68. ``chown``
  69. Change the user and group of the socket file to this value. May be
  70. a UNIX username (e.g. ``chrism``) or a UNIX username and group
  71. separated by a colon (e.g. ``chrism:wheel``).
  72. *Default*: Use the username and group of the user who starts supervisord.
  73. *Required*: No.
  74. *Introduced*: 3.0
  75. ``username``
  76. The username required for authentication to this HTTP server.
  77. *Default*: No username required.
  78. *Required*: No.
  79. *Introduced*: 3.0
  80. ``password``
  81. The password required for authentication to this HTTP server. This
  82. can be a cleartext password, or can be specified as a SHA-1 hash if
  83. prefixed by the string ``{SHA}``. For example,
  84. ``{SHA}82ab876d1387bfafe46cc1c8a2ef074eae50cb1d`` is the SHA-stored
  85. version of the password "thepassword".
  86. Note that hashed password must be in hex format.
  87. *Default*: No password required.
  88. *Required*: No.
  89. *Introduced*: 3.0
  90. ``[unix_http_server]`` Section Example
  91. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  92. .. code-block:: ini
  93. [unix_http_server]
  94. file = /tmp/supervisor.sock
  95. chmod = 0777
  96. chown= nobody:nogroup
  97. username = user
  98. password = 123
  99. ``[inet_http_server]`` Section Settings
  100. ---------------------------------------
  101. The :file:`supervisord.conf` file contains a section named
  102. ``[inet_http_server]`` under which configuration parameters for an
  103. HTTP server that listens on a TCP (internet) socket should be
  104. inserted. If the configuration file has no ``[inet_http_server]``
  105. section, an inet HTTP server will not be started. The allowable
  106. configuration values are as follows.
  107. ``[inet_http_server]`` Section Values
  108. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  109. ``port``
  110. A TCP host:port value or (e.g. ``127.0.0.1:9001``) on which
  111. supervisor will listen for HTTP/XML-RPC requests.
  112. :program:`supervisorctl` will use XML-RPC to communicate with
  113. :program:`supervisord` over this port. To listen on all interfaces
  114. in the machine, use ``:9001`` or ``*:9001``.
  115. *Default*: No default.
  116. *Required*: Yes.
  117. *Introduced*: 3.0
  118. ``username``
  119. The username required for authentication to this HTTP server.
  120. *Default*: No username required.
  121. *Required*: No.
  122. *Introduced*: 3.0
  123. ``password``
  124. The password required for authentication to this HTTP server. This
  125. can be a cleartext password, or can be specified as a SHA-1 hash if
  126. prefixed by the string ``{SHA}``. For example,
  127. ``{SHA}82ab876d1387bfafe46cc1c8a2ef074eae50cb1d`` is the SHA-stored
  128. version of the password "thepassword".
  129. Note that hashed password must be in hex format.
  130. *Default*: No password required.
  131. *Required*: No.
  132. *Introduced*: 3.0
  133. ``[inet_http_server]`` Section Example
  134. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  135. .. code-block:: ini
  136. [inet_http_server]
  137. port = 127.0.0.1:9001
  138. username = user
  139. password = 123
  140. ``[supervisord]`` Section Settings
  141. ----------------------------------
  142. The :file:`supervisord.conf` file contains a section named
  143. ``[supervisord]`` in which global settings related to the
  144. :program:`supervisord` process should be inserted. These are as
  145. follows.
  146. ``[supervisord]`` Section Values
  147. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  148. ``logfile``
  149. The path to the activity log of the supervisord process. This
  150. option can include the value ``%(here)s``, which expands to the
  151. directory in which the supervisord configuration file was found.
  152. *Default*: :file:`$CWD/supervisord.log`
  153. *Required*: No.
  154. *Introduced*: 3.0
  155. ``logfile_maxbytes``
  156. The maximum number of bytes that may be consumed by the activity log
  157. file before it is rotated (suffix multipliers like "KB", "MB", and
  158. "GB" can be used in the value). Set this value to 0 to indicate an
  159. unlimited log size.
  160. *Default*: 50MB
  161. *Required*: No.
  162. *Introduced*: 3.0
  163. ``logfile_backups``
  164. The number of backups to keep around resulting from activity log
  165. file rotation. If set to 0, no backups will be kept.
  166. *Default*: 10
  167. *Required*: No.
  168. *Introduced*: 3.0
  169. ``loglevel``
  170. The logging level, dictating what is written to the supervisord
  171. activity log. One of ``critical``, ``error``, ``warn``, ``info``,
  172. ``debug``, ``trace``, or ``blather``. Note that at log level
  173. ``debug``, the supervisord log file will record the stderr/stdout
  174. output of its child processes and extended info info about process
  175. state changes, which is useful for debugging a process which isn't
  176. starting properly. See also: :ref:`activity_log_levels`.
  177. *Default*: info
  178. *Required*: No.
  179. *Introduced*: 3.0
  180. ``pidfile``
  181. The location in which supervisord keeps its pid file. This option
  182. can include the value ``%(here)s``, which expands to the directory
  183. in which the supervisord configuration file was found.
  184. *Default*: :file:`$CWD/supervisord.pid`
  185. *Required*: No.
  186. *Introduced*: 3.0
  187. ``umask``
  188. The :term:`umask` of the supervisord process.
  189. *Default*: ``022``
  190. *Required*: No.
  191. *Introduced*: 3.0
  192. ``nodaemon``
  193. If true, supervisord will start in the foreground instead of
  194. daemonizing.
  195. *Default*: false
  196. *Required*: No.
  197. *Introduced*: 3.0
  198. ``minfds``
  199. The minimum number of file descriptors that must be available before
  200. supervisord will start successfully. A call to setrlimit will be made
  201. to attempt to raise the soft and hard limits of the supervisord process to
  202. satisfy ``minfds``. The hard limit may only be raised if supervisord
  203. is run as root. supervisord uses file descriptors liberally, and will
  204. enter a failure mode when one cannot be obtained from the OS, so it's
  205. useful to be able to specify a minimum value to ensure it doesn't run out
  206. of them during execution. This option is particularly useful on Solaris,
  207. which has a low per-process fd limit by default.
  208. *Default*: 1024
  209. *Required*: No.
  210. *Introduced*: 3.0
  211. ``minprocs``
  212. The minimum number of process descriptors that must be available
  213. before supervisord will start successfully. A call to setrlimit will be
  214. made to attempt to raise the soft and hard limits of the supervisord process
  215. to satisfy ``minprocs``. The hard limit may only be raised if supervisord
  216. is run as root. supervisord will enter a failure mode when the OS runs out
  217. of process descriptors, so it's useful to ensure that enough process
  218. descriptors are available upon :program:`supervisord` startup.
  219. *Default*: 200
  220. *Required*: No.
  221. *Introduced*: 3.0
  222. ``nocleanup``
  223. Prevent supervisord from clearing any existing ``AUTO``
  224. child log files at startup time. Useful for debugging.
  225. *Default*: false
  226. *Required*: No.
  227. *Introduced*: 3.0
  228. ``childlogdir``
  229. The directory used for ``AUTO`` child log files. This option can
  230. include the value ``%(here)s``, which expands to the directory in
  231. which the :program:`supervisord` configuration file was found.
  232. *Default*: value of Python's :func:`tempfile.get_tempdir`
  233. *Required*: No.
  234. *Introduced*: 3.0
  235. ``user``
  236. If :program:`supervisord` is run as the root user, switch users to
  237. this UNIX user account before doing any meaningful processing. This
  238. value has no effect if :program:`supervisord` is not run as root.
  239. *Default*: do not switch users
  240. *Required*: No.
  241. *Introduced*: 3.0
  242. ``directory``
  243. When :program:`supervisord` daemonizes, switch to this directory.
  244. This option can include the value ``%(here)s``, which expands to the
  245. directory in which the :program:`supervisord` configuration file was
  246. found.
  247. *Default*: do not cd
  248. *Required*: No.
  249. *Introduced*: 3.0
  250. ``strip_ansi``
  251. Strip all ANSI escape sequences from child log files.
  252. *Default*: false
  253. *Required*: No.
  254. *Introduced*: 3.0
  255. ``environment``
  256. A list of key/value pairs in the form ``KEY="val",KEY2="val2"`` that
  257. will be placed in the :program:`supervisord` process' environment
  258. (and as a result in all of its child process' environments). This
  259. option can include the value ``%(here)s``, which expands to the
  260. directory in which the supervisord configuration file was found.
  261. Values containing non-alphanumeric characters should be quoted
  262. (e.g. ``KEY="val:123",KEY2="val,456"``). Otherwise, quoting the
  263. values is optional but recommended. To escape percent characters,
  264. simply use two. (e.g. ``URI="/first%%20name"``) **Note** that
  265. subprocesses will inherit the environment variables of the shell
  266. used to start :program:`supervisord` except for the ones overridden
  267. here and within the program's ``environment`` option. See
  268. :ref:`subprocess_environment`.
  269. *Default*: no values
  270. *Required*: No.
  271. *Introduced*: 3.0
  272. ``identifier``
  273. The identifier string for this supervisor process, used by the RPC
  274. interface.
  275. *Default*: supervisor
  276. *Required*: No.
  277. *Introduced*: 3.0
  278. ``[supervisord]`` Section Example
  279. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  280. .. code-block:: ini
  281. [supervisord]
  282. logfile = /tmp/supervisord.log
  283. logfile_maxbytes = 50MB
  284. logfile_backups=10
  285. loglevel = info
  286. pidfile = /tmp/supervisord.pid
  287. nodaemon = false
  288. minfds = 1024
  289. minprocs = 200
  290. umask = 022
  291. user = chrism
  292. identifier = supervisor
  293. directory = /tmp
  294. nocleanup = true
  295. childlogdir = /tmp
  296. strip_ansi = false
  297. environment = KEY1="value1",KEY2="value2"
  298. ``[supervisorctl]`` Section Settings
  299. ------------------------------------
  300. The configuration file may contain settings for the
  301. :program:`supervisorctl` interactive shell program. These options
  302. are listed below.
  303. ``[supervisorctl]`` Section Values
  304. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  305. ``serverurl``
  306. The URL that should be used to access the supervisord server,
  307. e.g. ``http://localhost:9001``. For UNIX domain sockets, use
  308. ``unix:///absolute/path/to/file.sock``.
  309. *Default*: ``http://localhost:9001``
  310. *Required*: No.
  311. *Introduced*: 3.0
  312. ``username``
  313. The username to pass to the supervisord server for use in
  314. authentication. This should be same as ``username`` from the
  315. supervisord server configuration for the port or UNIX domain socket
  316. you're attempting to access.
  317. *Default*: No username
  318. *Required*: No.
  319. *Introduced*: 3.0
  320. ``password``
  321. The password to pass to the supervisord server for use in
  322. authentication. This should be the cleartext version of ``password``
  323. from the supervisord server configuration for the port or UNIX
  324. domain socket you're attempting to access. This value cannot be
  325. passed as a SHA hash. Unlike other passwords specified in this
  326. file, it must be provided in cleartext.
  327. *Default*: No password
  328. *Required*: No.
  329. *Introduced*: 3.0
  330. ``prompt``
  331. String used as supervisorctl prompt.
  332. *Default*: ``supervisor``
  333. *Required*: No.
  334. *Introduced*: 3.0
  335. ``history_file``
  336. A path to use as the ``readline`` persistent history file. If you
  337. enable this feature by choosing a path, your supervisorctl commands
  338. will be kept in the file, and you can use readline (e.g. arrow-up)
  339. to invoke commands you performed in your last supervisorctl session.
  340. *Default*: No file
  341. *Required*: No.
  342. *Introduced*: 3.0a5
  343. ``[supervisorctl]`` Section Example
  344. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  345. .. code-block:: ini
  346. [supervisorctl]
  347. serverurl = unix:///tmp/supervisor.sock
  348. username = chris
  349. password = 123
  350. prompt = mysupervisor
  351. .. _programx_section:
  352. ``[program:x]`` Section Settings
  353. --------------------------------
  354. The configuration file must contain one or more ``program`` sections
  355. in order for supervisord to know which programs it should start and
  356. control. The header value is composite value. It is the word
  357. "program", followed directly by a colon, then the program name. A
  358. header value of ``[program:foo]`` describes a program with the name of
  359. "foo". The name is used within client applications that control the
  360. processes that are created as a result of this configuration. It is
  361. an error to create a ``program`` section that does not have a name.
  362. The name must not include a colon character or a bracket character.
  363. The value of the name is used as the value for the
  364. ``%(program_name)s`` string expression expansion within other values
  365. where specified.
  366. .. note::
  367. A ``[program:x]`` section actually represents a "homogeneous
  368. process group" to supervisor (as of 3.0). The members of the group
  369. are defined by the combination of the ``numprocs`` and
  370. ``process_name`` parameters in the configuration. By default, if
  371. numprocs and process_name are left unchanged from their defaults,
  372. the group represented by ``[program:x]`` will be named ``x`` and
  373. will have a single process named ``x`` in it. This provides a
  374. modicum of backwards compatibility with older supervisor releases,
  375. which did not treat program sections as homogeneous process group
  376. definitions.
  377. But for instance, if you have a ``[program:foo]`` section with a
  378. ``numprocs`` of 3 and a ``process_name`` expression of
  379. ``%(program_name)s_%(process_num)02d``, the "foo" group will
  380. contain three processes, named ``foo_00``, ``foo_01``, and
  381. ``foo_02``. This makes it possible to start a number of very
  382. similar processes using a single ``[program:x]`` section. All
  383. logfile names, all environment strings, and the command of programs
  384. can also contain similar Python string expressions, to pass
  385. slightly different parameters to each process.
  386. ``[program:x]`` Section Values
  387. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  388. ``command``
  389. The command that will be run when this program is started. The
  390. command can be either absolute (e.g. ``/path/to/programname``) or
  391. relative (e.g. ``programname``). If it is relative, the
  392. supervisord's environment ``$PATH`` will be searched for the
  393. executable. Programs can accept arguments, e.g. ``/path/to/program
  394. foo bar``. The command line can use double quotes to group
  395. arguments with spaces in them to pass to the program,
  396. e.g. ``/path/to/program/name -p "foo bar"``. Note that the value of
  397. ``command`` may include Python string expressions,
  398. e.g. ``/path/to/programname --port=80%(process_num)02d`` might
  399. expand to ``/path/to/programname --port=8000`` at runtime. String
  400. expressions are evaluated against a dictionary containing the keys
  401. ``group_name``, ``host_node_name``, ``process_num``, ``program_name``,
  402. ``here`` (the directory of the supervisord config file), and all
  403. supervisord's environment variables prefixed with ``ENV_``. Controlled
  404. programs should themselves not be daemons, as supervisord assumes it is
  405. responsible for daemonizing its subprocesses (see
  406. :ref:`nondaemonizing_of_subprocesses`).
  407. *Default*: No default.
  408. *Required*: Yes.
  409. *Introduced*: 3.0
  410. ``process_name``
  411. A Python string expression that is used to compose the supervisor
  412. process name for this process. You usually don't need to worry
  413. about setting this unless you change ``numprocs``. The string
  414. expression is evaluated against a dictionary that includes
  415. ``group_name``, ``host_node_name``, ``process_num``, ``program_name``,
  416. and ``here`` (the directory of the supervisord config file).
  417. *Default*: ``%(program_name)s``
  418. *Required*: No.
  419. *Introduced*: 3.0
  420. ``numprocs``
  421. Supervisor will start as many instances of this program as named by
  422. numprocs. Note that if numprocs > 1, the ``process_name``
  423. expression must include ``%(process_num)s`` (or any other
  424. valid Python string expression that includes ``process_num``) within
  425. it.
  426. *Default*: 1
  427. *Required*: No.
  428. *Introduced*: 3.0
  429. ``numprocs_start``
  430. An integer offset that is used to compute the number at which
  431. ``numprocs`` starts.
  432. *Default*: 0
  433. *Required*: No.
  434. *Introduced*: 3.0
  435. ``priority``
  436. The relative priority of the program in the start and shutdown
  437. ordering. Lower priorities indicate programs that start first and
  438. shut down last at startup and when aggregate commands are used in
  439. various clients (e.g. "start all"/"stop all"). Higher priorities
  440. indicate programs that start last and shut down first.
  441. *Default*: 999
  442. *Required*: No.
  443. *Introduced*: 3.0
  444. ``autostart``
  445. If true, this program will start automatically when supervisord is
  446. started.
  447. *Default*: true
  448. *Required*: No.
  449. *Introduced*: 3.0
  450. ``startsecs``
  451. The total number of seconds which the program needs to stay running
  452. after a startup to consider the start successful (moving the process
  453. from the ``STARTING`` state to the ``RUNNING`` state). Set to ``0``
  454. to indicate that the program needn't stay running for any particular
  455. amount of time.
  456. .. note::
  457. Even if a process exits with an "expected" exit code (see
  458. ``exitcodes``), the start will still be considered a failure
  459. if the process exits quicker than ``startsecs``.
  460. *Default*: 1
  461. *Required*: No.
  462. *Introduced*: 3.0
  463. ``startretries``
  464. The number of serial failure attempts that :program:`supervisord`
  465. will allow when attempting to start the program before giving up and
  466. putting the process into an ``FATAL`` state. See
  467. :ref:`process_states` for explanation of the ``FATAL`` state.
  468. *Default*: 3
  469. *Required*: No.
  470. *Introduced*: 3.0
  471. ``autorestart``
  472. Specifies if :program:`supervisord` should automatically restart a
  473. process if it exits when it is in the ``RUNNING`` state. May be
  474. one of ``false``, ``unexpected``, or ``true``. If ``false``, the
  475. process will not be autorestarted. If ``unexpected``, the process
  476. will be restarted when the program exits with an exit code that is
  477. not one of the exit codes associated with this process' configuration
  478. (see ``exitcodes``). If ``true``, the process will be unconditionally
  479. restarted when it exits, without regard to its exit code.
  480. .. note::
  481. ``autorestart`` controls whether :program:`supervisord` will
  482. autorestart a program if it exits after it has successfully started
  483. up (the process is in the ``RUNNING`` state).
  484. :program:`supervisord` has a different restart mechanism for when the
  485. process is starting up (the process is in the ``STARTING`` state).
  486. Retries during process startup are controlled by ``startsecs``
  487. and ``startretries``.
  488. *Default*: unexpected
  489. *Required*: No.
  490. *Introduced*: 3.0
  491. ``exitcodes``
  492. The list of "expected" exit codes for this program used with ``autorestart``.
  493. If the ``autorestart`` parameter is set to ``unexpected``, and the process
  494. exits in any other way than as a result of a supervisor stop
  495. request, :program:`supervisord` will restart the process if it exits
  496. with an exit code that is not defined in this list.
  497. *Default*: 0,2
  498. *Required*: No.
  499. *Introduced*: 3.0
  500. ``stopsignal``
  501. The signal used to kill the program when a stop is requested. This
  502. can be any of TERM, HUP, INT, QUIT, KILL, USR1, or USR2.
  503. *Default*: TERM
  504. *Required*: No.
  505. *Introduced*: 3.0
  506. ``stopwaitsecs``
  507. The number of seconds to wait for the OS to return a SIGCHILD to
  508. :program:`supervisord` after the program has been sent a stopsignal.
  509. If this number of seconds elapses before :program:`supervisord`
  510. receives a SIGCHILD from the process, :program:`supervisord` will
  511. attempt to kill it with a final SIGKILL.
  512. *Default*: 10
  513. *Required*: No.
  514. *Introduced*: 3.0
  515. ``stopasgroup``
  516. If true, the flag causes supervisor to send the stop signal to the
  517. whole process group and implies ``killasgroup`` is true. This is useful
  518. for programs, such as Flask in debug mode, that do not propagate
  519. stop signals to their children, leaving them orphaned.
  520. *Default*: false
  521. *Required*: No.
  522. *Introduced*: 3.0b1
  523. ``killasgroup``
  524. If true, when resorting to send SIGKILL to the program to terminate
  525. it send it to its whole process group instead, taking care of its
  526. children as well, useful e.g with Python programs using
  527. :mod:`multiprocessing`.
  528. *Default*: false
  529. *Required*: No.
  530. *Introduced*: 3.0a11
  531. ``user``
  532. If :program:`supervisord` runs as root, this UNIX user account will
  533. be used as the account which runs the program. If :program:`supervisord`
  534. can't switch to the specified user, the program will not be started.
  535. .. note::
  536. The user will be changed using ``setuid`` only. This does not start
  537. a login shell and does not change environment variables like
  538. ``USER`` or ``HOME``. See :ref:`subprocess_environment` for details.
  539. *Default*: Do not switch users
  540. *Required*: No.
  541. *Introduced*: 3.0
  542. ``redirect_stderr``
  543. If true, cause the process' stderr output to be sent back to
  544. :program:`supervisord` on its stdout file descriptor (in UNIX shell
  545. terms, this is the equivalent of executing ``/the/program 2>&1``).
  546. .. note::
  547. Do not set ``redirect_stderr=true`` in an ``[eventlistener:x]`` section.
  548. Eventlisteners use ``stdout`` and ``stdin`` to communicate with
  549. ``supervisord``. If ``stderr`` is redirected, output from
  550. ``stderr`` will interfere with the eventlistener protocol.
  551. *Default*: false
  552. *Required*: No.
  553. *Introduced*: 3.0, replaces 2.0's ``log_stdout`` and ``log_stderr``
  554. ``stdout_logfile``
  555. Put process stdout output in this file (and if redirect_stderr is
  556. true, also place stderr output in this file). If ``stdout_logfile``
  557. is unset or set to ``AUTO``, supervisor will automatically choose a
  558. file location. If this is set to ``NONE``, supervisord will create
  559. no log file. ``AUTO`` log files and their backups will be deleted
  560. when :program:`supervisord` restarts. The ``stdout_logfile`` value
  561. can contain Python string expressions that will evaluated against a
  562. dictionary that contains the keys ``group_name``, ``host_node_name``,
  563. ``process_num``, ``program_name``, and ``here`` (the directory of the
  564. supervisord config file).
  565. .. note::
  566. It is not possible for two processes to share a single log file
  567. (``stdout_logfile``) when rotation (``stdout_logfile_maxbytes``)
  568. is enabled. This will result in the file being corrupted.
  569. *Default*: ``AUTO``
  570. *Required*: No.
  571. *Introduced*: 3.0, replaces 2.0's ``logfile``
  572. ``stdout_logfile_maxbytes``
  573. The maximum number of bytes that may be consumed by
  574. ``stdout_logfile`` before it is rotated (suffix multipliers like
  575. "KB", "MB", and "GB" can be used in the value). Set this value to 0
  576. to indicate an unlimited log size.
  577. *Default*: 50MB
  578. *Required*: No.
  579. *Introduced*: 3.0, replaces 2.0's ``logfile_maxbytes``
  580. ``stdout_logfile_backups``
  581. The number of ``stdout_logfile`` backups to keep around resulting
  582. from process stdout log file rotation. If set to 0, no backups
  583. will be kept.
  584. *Default*: 10
  585. *Required*: No.
  586. *Introduced*: 3.0, replaces 2.0's ``logfile_backups``
  587. ``stdout_capture_maxbytes``
  588. Max number of bytes written to capture FIFO when process is in
  589. "stdout capture mode" (see :ref:`capture_mode`). Should be an
  590. integer (suffix multipliers like "KB", "MB" and "GB" can used in the
  591. value). If this value is 0, process capture mode will be off.
  592. *Default*: 0
  593. *Required*: No.
  594. *Introduced*: 3.0, replaces 2.0's ``logfile_backups``
  595. ``stdout_events_enabled``
  596. If true, PROCESS_LOG_STDOUT events will be emitted when the process
  597. writes to its stdout file descriptor. The events will only be
  598. emitted if the file descriptor is not in capture mode at the time
  599. the data is received (see :ref:`capture_mode`).
  600. *Default*: 0
  601. *Required*: No.
  602. *Introduced*: 3.0a7
  603. ``stdout_syslog``
  604. If true, stdout will be directed to syslog along with the process name.
  605. *Default*: False
  606. *Required*: No.
  607. *Introduced*: 4.0.0
  608. ``stderr_logfile``
  609. Put process stderr output in this file unless ``redirect_stderr`` is
  610. true. Accepts the same value types as ``stdout_logfile`` and may
  611. contain the same Python string expressions.
  612. .. note::
  613. It is not possible for two processes to share a single log file
  614. (``stderr_logfile``) when rotation (``stderr_logfile_maxbytes``)
  615. is enabled. This will result in the file being corrupted.
  616. *Default*: ``AUTO``
  617. *Required*: No.
  618. *Introduced*: 3.0
  619. ``stderr_logfile_maxbytes``
  620. The maximum number of bytes before logfile rotation for
  621. ``stderr_logfile``. Accepts the same value types as
  622. ``stdout_logfile_maxbytes``.
  623. *Default*: 50MB
  624. *Required*: No.
  625. *Introduced*: 3.0
  626. ``stderr_logfile_backups``
  627. The number of backups to keep around resulting from process stderr
  628. log file rotation. If set to 0, no backups will be kept.
  629. *Default*: 10
  630. *Required*: No.
  631. *Introduced*: 3.0
  632. ``stderr_capture_maxbytes``
  633. Max number of bytes written to capture FIFO when process is in
  634. "stderr capture mode" (see :ref:`capture_mode`). Should be an
  635. integer (suffix multipliers like "KB", "MB" and "GB" can used in the
  636. value). If this value is 0, process capture mode will be off.
  637. *Default*: 0
  638. *Required*: No.
  639. *Introduced*: 3.0
  640. ``stderr_events_enabled``
  641. If true, PROCESS_LOG_STDERR events will be emitted when the process
  642. writes to its stderr file descriptor. The events will only be
  643. emitted if the file descriptor is not in capture mode at the time
  644. the data is received (see :ref:`capture_mode`).
  645. *Default*: false
  646. *Required*: No.
  647. *Introduced*: 3.0a7
  648. ``stderr_syslog``
  649. If true, stderr will be directed to syslog along with the process name.
  650. *Default*: False
  651. *Required*: No.
  652. *Introduced*: 4.0.0
  653. ``environment``
  654. A list of key/value pairs in the form ``KEY="val",KEY2="val2"`` that
  655. will be placed in the child process' environment. The environment
  656. string may contain Python string expressions that will be evaluated
  657. against a dictionary containing ``group_name``, ``host_node_name``,
  658. ``process_num``, ``program_name``, and ``here`` (the directory of the
  659. supervisord config file). Values containing non-alphanumeric characters
  660. should be quoted (e.g. ``KEY="val:123",KEY2="val,456"``). Otherwise,
  661. quoting the values is optional but recommended. **Note** that the
  662. subprocess will inherit the environment variables of the shell used to
  663. start "supervisord" except for the ones overridden here. See
  664. :ref:`subprocess_environment`.
  665. *Default*: No extra environment
  666. *Required*: No.
  667. *Introduced*: 3.0
  668. ``directory``
  669. A file path representing a directory to which :program:`supervisord`
  670. should temporarily chdir before exec'ing the child.
  671. *Default*: No chdir (inherit supervisor's)
  672. *Required*: No.
  673. *Introduced*: 3.0
  674. ``umask``
  675. An octal number (e.g. 002, 022) representing the umask of the
  676. process.
  677. *Default*: No special umask (inherit supervisor's)
  678. *Required*: No.
  679. *Introduced*: 3.0
  680. ``serverurl``
  681. The URL passed in the environment to the subprocess process as
  682. ``SUPERVISOR_SERVER_URL`` (see :mod:`supervisor.childutils`) to
  683. allow the subprocess to easily communicate with the internal HTTP
  684. server. If provided, it should have the same syntax and structure
  685. as the ``[supervisorctl]`` section option of the same name. If this
  686. is set to AUTO, or is unset, supervisor will automatically construct
  687. a server URL, giving preference to a server that listens on UNIX
  688. domain sockets over one that listens on an internet socket.
  689. *Default*: AUTO
  690. *Required*: No.
  691. *Introduced*: 3.0
  692. ``[program:x]`` Section Example
  693. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  694. .. code-block:: ini
  695. [program:cat]
  696. command=/bin/cat
  697. process_name=%(program_name)s
  698. numprocs=1
  699. directory=/tmp
  700. umask=022
  701. priority=999
  702. autostart=true
  703. autorestart=unexpected
  704. startsecs=10
  705. startretries=3
  706. exitcodes=0,2
  707. stopsignal=TERM
  708. stopwaitsecs=10
  709. stopasgroup=false
  710. killasgroup=false
  711. user=chrism
  712. redirect_stderr=false
  713. stdout_logfile=/a/path
  714. stdout_logfile_maxbytes=1MB
  715. stdout_logfile_backups=10
  716. stdout_capture_maxbytes=1MB
  717. stdout_events_enabled=false
  718. stderr_logfile=/a/path
  719. stderr_logfile_maxbytes=1MB
  720. stderr_logfile_backups=10
  721. stderr_capture_maxbytes=1MB
  722. stderr_events_enabled=false
  723. environment=A="1",B="2"
  724. serverurl=AUTO
  725. ``[include]`` Section Settings
  726. ------------------------------
  727. The :file:`supervisord.conf` file may contain a section named
  728. ``[include]``. If the configuration file contains an ``[include]``
  729. section, it must contain a single key named "files". The values in
  730. this key specify other configuration files to be included within the
  731. configuration.
  732. ``[include]`` Section Values
  733. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  734. ``files``
  735. A space-separated sequence of file globs. Each file glob may be
  736. absolute or relative. If the file glob is relative, it is
  737. considered relative to the location of the configuration file which
  738. includes it. A "glob" is a file pattern which matches a specified
  739. pattern according to the rules used by the Unix shell. No tilde
  740. expansion is done, but ``*``, ``?``, and character ranges expressed
  741. with ``[]`` will be correctly matched. Recursive includes from
  742. included files are not supported.
  743. *Default*: No default (required)
  744. *Required*: Yes.
  745. *Introduced*: 3.0
  746. ``[include]`` Section Example
  747. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  748. .. code-block:: ini
  749. [include]
  750. files = /an/absolute/filename.conf /an/absolute/*.conf foo.conf config??.conf
  751. ``[group:x]`` Section Settings
  752. ------------------------------
  753. It is often useful to group "homogeneous" process groups (aka
  754. "programs") together into a "heterogeneous" process group so they can
  755. be controlled as a unit from Supervisor's various controller
  756. interfaces.
  757. To place programs into a group so you can treat them as a unit, define
  758. a ``[group:x]`` section in your configuration file. The group header
  759. value is a composite. It is the word "group", followed directly by a
  760. colon, then the group name. A header value of ``[group:foo]``
  761. describes a group with the name of "foo". The name is used within
  762. client applications that control the processes that are created as a
  763. result of this configuration. It is an error to create a ``group``
  764. section that does not have a name. The name must not include a colon
  765. character or a bracket character.
  766. For a ``[group:x]``, there must be one or more ``[program:x]``
  767. sections elsewhere in your configuration file, and the group must
  768. refer to them by name in the ``programs`` value.
  769. If "homogeneous" process groups (represented by program sections) are
  770. placed into a "heterogeneous" group via ``[group:x]`` section's
  771. ``programs`` line, the homogeneous groups that are implied by the
  772. program section will not exist at runtime in supervisor. Instead, all
  773. processes belonging to each of the homogeneous groups will be placed
  774. into the heterogeneous group. For example, given the following group
  775. configuration:
  776. .. code-block:: ini
  777. [group:foo]
  778. programs=bar,baz
  779. priority=999
  780. Given the above, at supervisord startup, the ``bar`` and ``baz``
  781. homogeneous groups will not exist, and the processes that would have
  782. been under them will now be moved into the ``foo`` group.
  783. ``[group:x]`` Section Values
  784. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  785. ``programs``
  786. A comma-separated list of program names. The programs which are
  787. listed become members of the group.
  788. *Default*: No default (required)
  789. *Required*: Yes.
  790. *Introduced*: 3.0
  791. ``priority``
  792. A priority number analogous to a ``[program:x]`` priority value
  793. assigned to the group.
  794. *Default*: 999
  795. *Required*: No.
  796. *Introduced*: 3.0
  797. ``[group:x]`` Section Example
  798. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  799. .. code-block:: ini
  800. [group:foo]
  801. programs=bar,baz
  802. priority=999
  803. ``[fcgi-program:x]`` Section Settings
  804. -------------------------------------
  805. Supervisor can manage groups of `FastCGI <http://www.fastcgi.com>`_
  806. processes that all listen on the same socket. Until now, deployment
  807. flexibility for FastCGI was limited. To get full process management,
  808. you could use mod_fastcgi under Apache but then you were stuck with
  809. Apache's inefficient concurrency model of one process or thread per
  810. connection. In addition to requiring more CPU and memory resources,
  811. the process/thread per connection model can be quickly saturated by a
  812. slow resource, preventing other resources from being served. In order
  813. to take advantage of newer event-driven web servers such as lighttpd
  814. or nginx which don't include a built-in process manager, you had to
  815. use scripts like cgi-fcgi or spawn-fcgi. These can be used in
  816. conjunction with a process manager such as supervisord or daemontools
  817. but require each FastCGI child process to bind to its own socket.
  818. The disadvantages of this are: unnecessarily complicated web server
  819. configuration, ungraceful restarts, and reduced fault tolerance. With
  820. fewer sockets to configure, web server configurations are much smaller
  821. if groups of FastCGI processes can share sockets. Shared sockets
  822. allow for graceful restarts because the socket remains bound by the
  823. parent process while any of the child processes are being restarted.
  824. Finally, shared sockets are more fault tolerant because if a given
  825. process fails, other processes can continue to serve inbound
  826. connections.
  827. With integrated FastCGI spawning support, Supervisor gives you the
  828. best of both worlds. You get full-featured process management with
  829. groups of FastCGI processes sharing sockets without being tied to a
  830. particular web server. It's a clean separation of concerns, allowing
  831. the web server and the process manager to each do what they do best.
  832. .. note::
  833. The socket manager in Supervisor was originally developed to support
  834. FastCGI processes but it is not limited to FastCGI. Other protocols may
  835. be used as well with no special configuration. Any program that can
  836. access an open socket from a file descriptor (e.g. with
  837. `socket.fromfd <http://docs.python.org/library/socket.html#socket.fromfd>`_
  838. in Python) can use the socket manager. Supervisor will automatically
  839. create the socket, bind, and listen before forking the first child in a
  840. group. The socket will be passed to each child on file descriptor
  841. number ``0`` (zero). When the last child in the group exits,
  842. Supervisor will close the socket.
  843. All the options available to ``[program:x]`` sections are
  844. also respected by ``fcgi-program`` sections.
  845. ``[fcgi-program:x]`` Section Values
  846. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  847. ``[fcgi-program:x]`` sections have a single key which ``[program:x]``
  848. sections do not have.
  849. ``socket``
  850. The FastCGI socket for this program, either TCP or UNIX domain
  851. socket. For TCP sockets, use this format: ``tcp://localhost:9002``.
  852. For UNIX domain sockets, use ``unix:///absolute/path/to/file.sock``.
  853. String expressions are evaluated against a dictionary containing the
  854. keys "program_name" and "here" (the directory of the supervisord
  855. config file).
  856. *Default*: No default.
  857. *Required*: Yes.
  858. *Introduced*: 3.0
  859. ``socket_owner``
  860. For UNIX domain sockets, this parameter can be used to specify the user
  861. and group for the FastCGI socket. May be a UNIX username (e.g. chrism)
  862. or a UNIX username and group separated by a colon (e.g. chrism:wheel).
  863. *Default*: Uses the user and group set for the fcgi-program
  864. *Required*: No.
  865. *Introduced*: 3.0
  866. ``socket_mode``
  867. For UNIX domain sockets, this parameter can be used to specify the
  868. permission mode.
  869. *Default*: 0700
  870. *Required*: No.
  871. *Introduced*: 3.0
  872. Consult :ref:`programx_section` for other allowable keys, delta the
  873. above constraints and additions.
  874. ``[fcgi-program:x]`` Section Example
  875. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  876. .. code-block:: ini
  877. [fcgi-program:fcgiprogramname]
  878. command=/usr/bin/example.fcgi
  879. socket=unix:///var/run/supervisor/%(program_name)s.sock
  880. socket_owner=chrism
  881. socket_mode=0700
  882. process_name=%(program_name)s_%(process_num)02d
  883. numprocs=5
  884. directory=/tmp
  885. umask=022
  886. priority=999
  887. autostart=true
  888. autorestart=unexpected
  889. startsecs=1
  890. startretries=3
  891. exitcodes=0,2
  892. stopsignal=QUIT
  893. stopasgroup=false
  894. killasgroup=false
  895. stopwaitsecs=10
  896. user=chrism
  897. redirect_stderr=true
  898. stdout_logfile=/a/path
  899. stdout_logfile_maxbytes=1MB
  900. stdout_logfile_backups=10
  901. stdout_events_enabled=false
  902. stderr_logfile=/a/path
  903. stderr_logfile_maxbytes=1MB
  904. stderr_logfile_backups=10
  905. stderr_events_enabled=false
  906. environment=A="1",B="2"
  907. serverurl=AUTO
  908. ``[eventlistener:x]`` Section Settings
  909. --------------------------------------
  910. Supervisor allows specialized homogeneous process groups ("event
  911. listener pools") to be defined within the configuration file. These
  912. pools contain processes that are meant to receive and respond to event
  913. notifications from supervisor's event system. See :ref:`events` for
  914. an explanation of how events work and how to implement programs that
  915. can be declared as event listeners.
  916. Note that all the options available to ``[program:x]`` sections are
  917. respected by eventlistener sections *except* for
  918. ``stdout_capture_maxbytes`` and ``stderr_capture_maxbytes`` (event
  919. listeners cannot emit process communication events, see
  920. :ref:`capture_mode`).
  921. ``[eventlistener:x]`` Section Values
  922. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  923. ``[eventlistener:x]`` sections have a few keys which ``[program:x]``
  924. sections do not have.
  925. ``buffer_size``
  926. The event listener pool's event queue buffer size. When a listener
  927. pool's event buffer is overflowed (as can happen when an event
  928. listener pool cannot keep up with all of the events sent to it), the
  929. oldest event in the buffer is discarded.
  930. ``events``
  931. A comma-separated list of event type names that this listener is
  932. "interested" in receiving notifications for (see
  933. :ref:`event_types` for a list of valid event type names).
  934. ``result_handler``
  935. A `pkg_resources entry point string
  936. <http://peak.telecommunity.com/DevCenter/PkgResources>`_ that
  937. resolves to a Python callable. The default value is
  938. ``supervisor.dispatchers:default_handler``. Specifying an alternate
  939. result handler is a very uncommon thing to need to do, and as a
  940. result, how to create one is not documented.
  941. Consult :ref:`programx_section` for other allowable keys, delta the
  942. above constraints and additions.
  943. ``[eventlistener:x]`` Section Example
  944. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  945. .. code-block:: ini
  946. [eventlistener:theeventlistenername]
  947. command=/bin/eventlistener
  948. process_name=%(program_name)s_%(process_num)02d
  949. numprocs=5
  950. events=PROCESS_STATE
  951. buffer_size=10
  952. directory=/tmp
  953. umask=022
  954. priority=-1
  955. autostart=true
  956. autorestart=unexpected
  957. startsecs=1
  958. startretries=3
  959. exitcodes=0,2
  960. stopsignal=QUIT
  961. stopwaitsecs=10
  962. stopasgroup=false
  963. killasgroup=false
  964. user=chrism
  965. redirect_stderr=false
  966. stdout_logfile=/a/path
  967. stdout_logfile_maxbytes=1MB
  968. stdout_logfile_backups=10
  969. stdout_events_enabled=false
  970. stderr_logfile=/a/path
  971. stderr_logfile_maxbytes=1MB
  972. stderr_logfile_backups=10
  973. stderr_events_enabled=false
  974. environment=A="1",B="2"
  975. serverurl=AUTO
  976. ``[rpcinterface:x]`` Section Settings
  977. -------------------------------------
  978. Adding ``rpcinterface:x`` settings in the configuration file is only
  979. useful for people who wish to extend supervisor with additional custom
  980. behavior.
  981. In the sample config file, there is a section which is named
  982. ``[rpcinterface:supervisor]``. By default it looks like the
  983. following.
  984. .. code-block:: ini
  985. [rpcinterface:supervisor]
  986. supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
  987. The ``[rpcinterface:supervisor]`` section *must* remain in the
  988. configuration for the standard setup of supervisor to work properly.
  989. If you don't want supervisor to do anything it doesn't already do out
  990. of the box, this is all you need to know about this type of section.
  991. However, if you wish to add rpc interface namespaces in order to
  992. customize supervisor, you may add additional ``[rpcinterface:foo]``
  993. sections, where "foo" represents the namespace of the interface (from
  994. the web root), and the value named by
  995. ``supervisor.rpcinterface_factory`` is a factory callable which should
  996. have a function signature that accepts a single positional argument
  997. ``supervisord`` and as many keyword arguments as required to perform
  998. configuration. Any extra key/value pairs defined within the
  999. ``[rpcinterface:x]`` section will be passed as keyword arguments to
  1000. the factory.
  1001. Here's an example of a factory function, created in the
  1002. ``__init__.py`` file of the Python package ``my.package``.
  1003. .. code-block:: python
  1004. from my.package.rpcinterface import AnotherRPCInterface
  1005. def make_another_rpcinterface(supervisord, **config):
  1006. retries = int(config.get('retries', 0))
  1007. another_rpc_interface = AnotherRPCInterface(supervisord, retries)
  1008. return another_rpc_interface
  1009. And a section in the config file meant to configure it.
  1010. .. code-block:: ini
  1011. [rpcinterface:another]
  1012. supervisor.rpcinterface_factory = my.package:make_another_rpcinterface
  1013. retries = 1
  1014. ``[rpcinterface:x]`` Section Values
  1015. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1016. ``supervisor.rpcinterface_factory``
  1017. ``pkg_resources`` "entry point" dotted name to your RPC interface's
  1018. factory function.
  1019. *Default*: N/A
  1020. *Required*: No.
  1021. *Introduced*: 3.0
  1022. ``[rpcinterface:x]`` Section Example
  1023. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1024. .. code-block:: ini
  1025. [rpcinterface:another]
  1026. supervisor.rpcinterface_factory = my.package:make_another_rpcinterface
  1027. retries = 1