File: supervisor.1

package info (click to toggle)
supervisor 3.3.5-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,252 kB
  • sloc: python: 25,045; makefile: 78; sh: 75
file content (3719 lines) | stat: -rw-r--r-- 109,611 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
.\" Man page generated from reStructuredText.
.
.TH "SUPERVISOR" "1" "December 10, 2015" "3.2.0" "Supervisor"
.SH NAME
supervisor \- Supervisor Documentation
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.sp
Supervisor is a client/server system that allows its users to monitor
and control a number of processes on UNIX\-like operating systems.
.sp
It shares some of the same goals of programs like launchd,
daemontools, and runit\&. Unlike some of these programs,
it is not meant to be run as a substitute for \fBinit\fP as "process id
1". Instead it is meant to be used to control processes related to a
project or a customer, and is meant to start like any other program at
boot time.
.SH NARRATIVE DOCUMENTATION
.SS Introduction
.SS Overview
.sp
Supervisor is a client/server system that allows its users to control
a number of processes on UNIX\-like operating systems.  It was inspired
by the following:
.sp
Convenience
.INDENT 0.0
.INDENT 3.5
It is often inconvenient to need to write \fBrc.d\fP scripts for every
single process instance.  \fBrc.d\fP scripts are a great
lowest\-common\-denominator form of process
initialization/autostart/management, but they can be painful to
write and maintain.  Additionally, \fBrc.d\fP scripts cannot
automatically restart a crashed process and many programs do not
restart themselves properly on a crash.  Supervisord starts
processes as its subprocesses, and can be configured to
automatically restart them on a crash.  It can also automatically be
configured to start processes on its own invocation.
.UNINDENT
.UNINDENT
.sp
Accuracy
.INDENT 0.0
.INDENT 3.5
It\(aqs often difficult to get accurate up/down status on processes on
UNIX.  Pidfiles often lie.  Supervisord starts processes as
subprocesses, so it always knows the true up/down status of its
children and can be queried conveniently for this data.
.UNINDENT
.UNINDENT
.sp
Delegation
.INDENT 0.0
.INDENT 3.5
Users who need to control process state often need only to do that.
They don\(aqt want or need full\-blown shell access to the machine on
which the processes are running.  Processes which listen on "low"
TCP ports often need to be started and restarted as the root user (a
UNIX misfeature).  It\(aqs usually the case that it\(aqs perfectly fine to
allow "normal" people to stop or restart such a process, but
providing them with shell access is often impractical, and providing
them with root access or sudo access is often impossible.  It\(aqs also
(rightly) difficult to explain to them why this problem exists.  If
supervisord is started as root, it is possible to allow "normal"
users to control such processes without needing to explain the
intricacies of the problem to them.  Supervisorctl allows a very
limited form of access to the machine, essentially allowing users to
see process status and control supervisord\-controlled subprocesses
by emitting "stop", "start", and "restart" commands from a simple
shell or web UI.
.UNINDENT
.UNINDENT
.sp
Process Groups
.INDENT 0.0
.INDENT 3.5
Processes often need to be started and stopped in groups, sometimes
even in a "priority order".  It\(aqs often difficult to explain to
people how to do this.  Supervisor allows you to assign priorities
to processes, and allows user to emit commands via the supervisorctl
client like "start all", and "restart all", which starts them in the
preassigned priority order.  Additionally, processes can be grouped
into "process groups" and a set of logically related processes can
be stopped and started as a unit.
.UNINDENT
.UNINDENT
.SS Features
.sp
Simple
.INDENT 0.0
.INDENT 3.5
Supervisor is configured through a simple INI\-style config file
that’s easy to learn. It provides many per\-process options that make
your life easier like restarting failed processes and automatic log
rotation.
.UNINDENT
.UNINDENT
.sp
Centralized
.INDENT 0.0
.INDENT 3.5
Supervisor provides you with one place to start, stop, and monitor
your processes. Processes can be controlled individually or in
groups. You can configure Supervisor to provide a local or remote
command line and web interface.
.UNINDENT
.UNINDENT
.sp
Efficient
.INDENT 0.0
.INDENT 3.5
Supervisor starts its subprocesses via fork/exec and subprocesses
don’t daemonize. The operating system signals Supervisor immediately
when a process terminates, unlike some solutions that rely on
troublesome PID files and periodic polling to restart failed
processes.
.UNINDENT
.UNINDENT
.sp
Extensible
.INDENT 0.0
.INDENT 3.5
Supervisor has a simple event notification protocol that programs
written in any language can use to monitor it, and an XML\-RPC
interface for control. It is also built with extension points that
can be leveraged by Python developers.
.UNINDENT
.UNINDENT
.sp
Compatible
.INDENT 0.0
.INDENT 3.5
Supervisor works on just about everything except for Windows. It is
tested and supported on Linux, Mac OS X, Solaris, and FreeBSD. It is
written entirely in Python, so installation does not require a C
compiler.
.UNINDENT
.UNINDENT
.sp
Proven
.INDENT 0.0
.INDENT 3.5
While Supervisor is very actively developed today, it is not new
software. Supervisor has been around for years and is already in use
on many servers.
.UNINDENT
.UNINDENT
.SS Supervisor Components
.sp
\fBsupervisord\fP
.INDENT 0.0
.INDENT 3.5
The server piece of supervisor is named \fBsupervisord\fP\&.  It
is responsible for starting child programs at its own invocation,
responding to commands from clients, restarting crashed or exited
subprocesseses, logging its subprocess \fBstdout\fP and \fBstderr\fP
output, and generating and handling "events" corresponding to points
in subprocess lifetimes.
.sp
The server process uses a configuration file.  This is typically
located in \fB/etc/supervisord.conf\fP\&.  This configuration file
is a "Windows\-INI" style config file.  It is important to keep this
file secure via proper filesystem permissions because it may contain
unencrypted usernames and passwords.
.UNINDENT
.UNINDENT
.sp
\fBsupervisorctl\fP
.INDENT 0.0
.INDENT 3.5
The command\-line client piece of the supervisor is named
\fBsupervisorctl\fP\&.  It provides a shell\-like interface to the
features provided by \fBsupervisord\fP\&.  From
\fBsupervisorctl\fP, a user can connect to different
\fBsupervisord\fP processes, get status on the subprocesses
controlled by, stop and start subprocesses of, and get lists of
running processes of a \fBsupervisord\fP\&.
.sp
The command\-line client talks to the server across a UNIX domain
socket or an internet (TCP) socket.  The server can assert that the
user of a client should present authentication credentials before it
allows him to perform commands.  The client process typically uses
the same configuration file as the server but any configuration file
with a \fB[supervisorctl]\fP section in it will work.
.UNINDENT
.UNINDENT
.sp
Web Server
.INDENT 0.0
.INDENT 3.5
A (sparse) web user interface with functionality comparable to
\fBsupervisorctl\fP may be accessed via a browser if you start
\fBsupervisord\fP against an internet socket.  Visit the server
URL (e.g. \fBhttp://localhost:9001/\fP) to view and control process
status through the web interface after activating the configuration
file\(aqs \fB[inet_http_server]\fP section.
.UNINDENT
.UNINDENT
.sp
XML\-RPC Interface
.INDENT 0.0
.INDENT 3.5
The same HTTP server which serves the web UI serves up an XML\-RPC
interface that can be used to interrogate and control supervisor and
the programs it runs.  See xml_rpc\&.
.UNINDENT
.UNINDENT
.SS Platform Requirements
.sp
Supervisor has been tested and is known to run on Linux (Ubuntu 9.10),
Mac OS X (10.4/10.5/10.6), and Solaris (10 for Intel) and FreeBSD 6.1.
It will likely work fine on most UNIX systems.
.sp
Supervisor will \fInot\fP run at all under any version of Windows.
.sp
Supervisor is known to work with Python 2.4 or later but will not work
under any version of Python 3.
.SS Running Supervisor
.sp
This section makes reference to a \fBBINDIR\fP when explaining how
to run the \fBsupervisord\fP and \fBsupervisorctl\fP
commands.  This is the "bindir" directory that your Python
installation has been configured with.  For example, for an
installation of Python installed via \fB\&./configure
\-\-prefix=/usr/local/py; make; make install\fP, \fBBINDIR\fP would
be \fB/usr/local/py/bin\fP\&. Python interpreters on different
platforms use a different \fBBINDIR\fP\&.  Look at the output of
\fBsetup.py install\fP if you can\(aqt figure out where yours is.
.SS Adding a Program
.sp
Before \fBsupervisord\fP will do anything useful for you, you\(aqll
need to add at least one \fBprogram\fP section to its configuration.
The \fBprogram\fP section will define a program that is run and managed
when you invoke the \fBsupervisord\fP command.  To add a program,
you\(aqll need to edit the \fBsupervisord.conf\fP file.
.sp
One of the simplest possible programs to run is the UNIX
\fBcat\fP program.  A \fBprogram\fP section that will run \fBcat\fP
when the \fBsupervisord\fP process starts up is shown below.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
[program:foo]
command=/bin/cat
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This stanza may be cut and pasted into the \fBsupervisord.conf\fP
file.  This is the simplest possible program configuration, because it
only names a command.  Program configuration sections have many other
configuration options which aren\(aqt shown here.  See
programx_section for more information.
.SS Running \fBsupervisord\fP
.sp
To start \fBsupervisord\fP, run \fB$BINDIR/supervisord\fP\&.  The
resulting process will daemonize itself and detach from the terminal.
It keeps an operations log at \fB$CWD/supervisor.log\fP by default.
.sp
You may start the \fBsupervisord\fP executable in the foreground
by passing the \fB\-n\fP flag on its command line.  This is useful to
debug startup problems.
.sp
\fBWARNING:\fP
.INDENT 0.0
.INDENT 3.5
When \fBsupervisord\fP starts up, it will search for its
configuration file in default locations \fIincluding the current working
directory\fP\&.  If you are security\-conscious you will probably want to
specify a "\-c" argument after the \fBsupervisord\fP command
specifying an absolute path to a configuration file to ensure that someone
doesn\(aqt trick you into running supervisor from within a directory that
contains a rogue \fBsupervisord.conf\fP file.  A warning is emitted when
supervisor is started as root without this \fB\-c\fP argument.
.UNINDENT
.UNINDENT
.sp
To change the set of programs controlled by \fBsupervisord\fP,
edit the \fBsupervisord.conf\fP file and \fBkill \-HUP\fP or otherwise
restart the \fBsupervisord\fP process.  This file has several
example program definitions.
.sp
The \fBsupervisord\fP command accepts a number of command\-line
options.  Each of these command line options overrides any equivalent
value in the configuration file.
.SS \fBsupervisord\fP Command\-Line Options
.INDENT 0.0
.TP
.BI \-c \ FILE\fP,\fB \ \-\-configuration\fB= FILE
The path to a \fBsupervisord\fP configuration file.
.TP
.B \-n\fP,\fB  \-\-nodaemon
Run \fBsupervisord\fP in the foreground.
.TP
.B \-h\fP,\fB  \-\-help
Show \fBsupervisord\fP command help.
.TP
.BI \-u \ USER\fP,\fB \ \-\-user\fB= USER
UNIX username or numeric user id.  If \fBsupervisord\fP is
started as the root user, setuid to this user as soon as possible
during startup.
.TP
.BI \-m \ OCTAL\fP,\fB \ \-\-umask\fB= OCTAL
Octal number (e.g. 022) representing the umask that should
be used by \fBsupervisord\fP after it starts.
.TP
.BI \-d \ PATH\fP,\fB \ \-\-directory\fB= PATH
When supervisord is run as a daemon, cd to this directory before
daemonizing.
.TP
.BI \-l \ FILE\fP,\fB \ \-\-logfile\fB= FILE
Filename path to use as the supervisord activity log.
.TP
.BI \-y \ BYTES\fP,\fB \ \-\-logfile_maxbytes\fB= BYTES
Max size of the supervisord activity log file before a rotation
occurs.  The value is suffix\-multiplied, e.g "1" is one byte, "1MB"
is 1 megabyte, "1GB" is 1 gigabyte.
.TP
.BI \-y \ NUM\fP,\fB \ \-\-logfile_backups\fB= NUM
Number of backup copies of the supervisord activity log to keep
around.  Each logfile will be of size \fBlogfile_maxbytes\fP\&.
.TP
.BI \-e \ LEVEL\fP,\fB \ \-\-loglevel\fB= LEVEL
The logging level at which supervisor should write to the activity
log.  Valid levels are \fBtrace\fP, \fBdebug\fP, \fBinfo\fP, \fBwarn\fP,
\fBerror\fP, and \fBcritical\fP\&.
.TP
.BI \-j \ FILE\fP,\fB \ \-\-pidfile\fB= FILE
The filename to which supervisord should write its pid file.
.TP
.BI \-i \ STRING\fP,\fB \ \-\-identifier\fB= STRING
Arbitrary string identifier exposed by various client UIs for this
instance of supervisor.
.TP
.BI \-q \ PATH\fP,\fB \ \-\-childlogdir\fB= PATH
A path to a directory (it must already exist) where supervisor will
write its \fBAUTO\fP \-mode child process logs.
.TP
.B \-k\fP,\fB  \-\-nocleanup
Prevent \fBsupervisord\fP from performing cleanup (removal of
old \fBAUTO\fP process log files) at startup.
.TP
.BI \-a \ NUM\fP,\fB \ \-\-minfds\fB= NUM
The minimum number of file descriptors that must be available to
the supervisord process before it will start successfully.
.TP
.B \-t\fP,\fB  \-\-strip_ansi
Strip ANSI escape sequences from all child log process.
.TP
.B \-v\fP,\fB  \-\-version
Print the supervisord version number out to stdout and exit.
.TP
.BI \-\-profile_options\fB= LIST
Comma\-separated options list for profiling.  Causes
\fBsupervisord\fP to run under a profiler, and output results
based on the options, which is a comma\-separated list of the
following: \fBcumulative\fP, \fBcalls\fP, \fBcallers\fP\&.
E.g. \fBcumulative,callers\fP\&.
.TP
.BI \-\-minprocs\fB= NUM
The minimum number of OS process slots that must be available to
the supervisord process before it will start successfully.
.UNINDENT
.SS \fBsupervisorctl\fP Command\-Line Options
.INDENT 0.0
.TP
.B \-c\fP,\fB  \-\-configuration
Configuration file path (default /etc/supervisord.conf)
.TP
.B \-h\fP,\fB  \-\-help
Print usage message and exit
.TP
.B \-i\fP,\fB  \-\-interactive
Start an interactive shell after executing commands
.TP
.BI \-s\fP,\fB  \-\-serverurl \ URL
URL on which supervisord server is listening (default "\fI\%http://localhost:9001\fP").
.TP
.B \-u\fP,\fB  \-\-username
Username to use for authentication with server
.TP
.B \-p\fP,\fB  \-\-password
Password to use for authentication with server
.TP
.B \-r\fP,\fB  \-\-history\-file
Keep a readline history (if readline is available)
.UNINDENT
.sp
\fIaction [arguments]\fP
.sp
Actions are commands like "tail" or "stop".  If \-i is specified or no action is
specified on the command line, a "shell" interpreting actions typed
interactively is started.  Use the action "help" to find out about available
actions.
.SS Running \fBsupervisorctl\fP
.sp
To start \fBsupervisorctl\fP, run \fB$BINDIR/supervisorctl\fP\&.  A
shell will be presented that will allow you to control the processes
that are currently managed by \fBsupervisord\fP\&.  Type "help" at
the prompt to get information about the supported commands.
.sp
The \fBsupervisorctl\fP executable may be invoked with "one time"
commands when invoked with arguments from a command line.  An example:
\fBsupervisorctl stop all\fP\&.  If arguments are present on the
command\-line, it will prevent the interactive shell from being
invoked.  Instead, the command will be executed and
\fBsupervisorctl\fP will exit.
.sp
If \fBsupervisorctl\fP is invoked in interactive mode against a
\fBsupervisord\fP that requires authentication, you will be asked
for authentication credentials.
.SS Signals
.sp
The \fBsupervisord\fP program may be sent signals which cause it
to perform certain actions while it\(aqs running.
.sp
You can send any of these signals to the single \fBsupervisord\fP
process id.  This process id can be found in the file represented by
the \fBpidfile\fP parameter in the \fB[supervisord]\fP section of the
configuration file (by default it\(aqs \fB$CWD/supervisord.pid\fP).
.SS Signal Handlers
.sp
\fBSIGTERM\fP
.INDENT 0.0
.INDENT 3.5
\fBsupervisord\fP and all its subprocesses will shut down.
This may take several seconds.
.UNINDENT
.UNINDENT
.sp
\fBSIGINT\fP
.INDENT 0.0
.INDENT 3.5
\fBsupervisord\fP and all its subprocesses will shut down.
This may take several seconds.
.UNINDENT
.UNINDENT
.sp
\fBSIGQUIT\fP
.INDENT 0.0
.INDENT 3.5
\fBsupervisord\fP and all its subprocesses will shut down.
This may take several seconds.
.UNINDENT
.UNINDENT
.sp
\fBSIGHUP\fP
.INDENT 0.0
.INDENT 3.5
\fBsupervisord\fP will stop all processes, reload the
configuration from the first config file it finds, and restart all
processes.
.UNINDENT
.UNINDENT
.sp
\fBSIGUSR2\fP
.INDENT 0.0
.INDENT 3.5
\fBsupervisord\fP will close and reopen the main activity log
and all child log files.
.UNINDENT
.UNINDENT
.SS Runtime Security
.sp
The developers have done their best to assure that use of a
\fBsupervisord\fP process running as root cannot lead to
unintended privilege escalation.  But \fBcaveat emptor\fP\&.  Supervisor
is not as paranoid as something like DJ Bernstein\(aqs
daemontools, inasmuch as \fBsupervisord\fP allows for
arbitrary path specifications in its configuration file to which data
may be written.  Allowing arbitrary path selections can create
vulnerabilities from symlink attacks.  Be careful when specifying
paths in your configuration.  Ensure that the \fBsupervisord\fP
configuration file cannot be read from or written to by unprivileged
users and that all files installed by the supervisor package have
"sane" file permission protection settings.  Additionally, ensure that
your \fBPYTHONPATH\fP is sane and that all Python standard
library files have adequate file permission protections.
.SS Running \fBsupervisord\fP automatically on startup
.sp
If you are using a distribution\-packaged version of Supervisor, it should
already be integrated into the service management infrastructure of your
distribution.
.sp
There are user\-contributed scripts for various operating systems at:
\fI\%https://github.com/Supervisor/initscripts\fP
.sp
There are some answers at Serverfault in case you get stuck:
\fI\%How to automatically start supervisord on Linux (Ubuntu)\fP
.SS Configuration File
.sp
The Supervisor configuration file is conventionally named
\fBsupervisord.conf\fP\&.  It is used by both \fBsupervisord\fP
and \fBsupervisorctl\fP\&.  If either application is started
without the \fB\-c\fP option (the option which is used to tell the
application the configuration filename explicitly), the application
will look for a file named \fBsupervisord.conf\fP within the
following locations, in the specified order.  It will use the first
file it finds.
.INDENT 0.0
.IP 1. 3
\fB$CWD/supervisord.conf\fP
.IP 2. 3
\fB$CWD/etc/supervisord.conf\fP
.IP 3. 3
\fB/etc/supervisord.conf\fP
.IP 4. 3
\fB\&../etc/supervisord.conf\fP (Relative to the executable)
.IP 5. 3
\fB\&../supervisord.conf\fP (Relative to the executable)
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
Some distributions have packaged Supervisor with their own
customizations.  These modified versions of Supervisor may load the
configuration file from locations other than those described here.
Notably, Ubuntu packages have been found that use
\fB/etc/supervisor/supervisord.conf\fP\&.
.UNINDENT
.UNINDENT
.SS File Format
.sp
\fBsupervisord.conf\fP is a Windows\-INI\-style (Python ConfigParser)
file.  It has sections (each denoted by a \fB[header]\fP) and key / value
pairs within the sections.  The sections and their allowable values
are described below.
.SS Environment Variables
.sp
Environment variables that are present in the environment at the time that
\fBsupervisord\fP is started can be used in the configuration file
using the Python string expression syntax \fB%(ENV_X)s\fP:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
[program:example]
command=/usr/bin/example \-\-loglevel=%(ENV_LOGLEVEL)s
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
In the example above, the expression \fB%(ENV_LOGLEVEL)s\fP would be expanded
to the value of the environment variable \fBLOGLEVEL\fP\&.
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
In Supervisor 3.2 and later, \fB%(ENV_X)s\fP expressions are supported in
all options.  In prior versions, some options support them, but most
do not.  See the documentation for each option below.
.UNINDENT
.UNINDENT
.SS \fB[unix_http_server]\fP Section Settings
.sp
The \fBsupervisord.conf\fP file contains a section named
\fB[unix_http_server]\fP under which configuration parameters for an
HTTP server that listens on a UNIX domain socket should be inserted.
If the configuration file has no \fB[unix_http_server]\fP section, a
UNIX domain socket HTTP server will not be started.  The allowable
configuration values are as follows.
.SS \fB[unix_http_server]\fP Section Values
.sp
\fBfile\fP
.INDENT 0.0
.INDENT 3.5
A path to a UNIX domain socket (e.g. \fB/tmp/supervisord.sock\fP)
on which supervisor will listen for HTTP/XML\-RPC requests.
\fBsupervisorctl\fP uses XML\-RPC to communicate with
\fBsupervisord\fP over this port.  This option can include the
value \fB%(here)s\fP, which expands to the directory in which the
\fBsupervisord\fP configuration file was found.
.sp
\fIDefault\fP:  None.
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBchmod\fP
.INDENT 0.0
.INDENT 3.5
Change the UNIX permission mode bits of the UNIX domain socket to
this value at startup.
.sp
\fIDefault\fP: \fB0700\fP
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBchown\fP
.INDENT 0.0
.INDENT 3.5
Change the user and group of the socket file to this value.  May be
a UNIX username (e.g. \fBchrism\fP) or a UNIX username and group
separated by a colon (e.g. \fBchrism:wheel\fP).
.sp
\fIDefault\fP:  Use the username and group of the user who starts supervisord.
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBusername\fP
.INDENT 0.0
.INDENT 3.5
The username required for authentication to this HTTP server.
.sp
\fIDefault\fP:  No username required.
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBpassword\fP
.INDENT 0.0
.INDENT 3.5
The password required for authentication to this HTTP server.  This
can be a cleartext password, or can be specified as a SHA\-1 hash if
prefixed by the string \fB{SHA}\fP\&.  For example,
\fB{SHA}82ab876d1387bfafe46cc1c8a2ef074eae50cb1d\fP is the SHA\-stored
version of the password "thepassword".
.sp
Note that hashed password must be in hex format.
.sp
\fIDefault\fP:  No password required.
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.SS \fB[unix_http_server]\fP Section Example
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
[unix_http_server]
file = /tmp/supervisor.sock
chmod = 0777
chown= nobody:nogroup
username = user
password = 123
.ft P
.fi
.UNINDENT
.UNINDENT
.SS \fB[inet_http_server]\fP Section Settings
.sp
The \fBsupervisord.conf\fP file contains a section named
\fB[inet_http_server]\fP under which configuration parameters for an
HTTP server that listens on a TCP (internet) socket should be
inserted.  If the configuration file has no \fB[inet_http_server]\fP
section, an inet HTTP server will not be started.  The allowable
configuration values are as follows.
.SS \fB[inet_http_server]\fP Section Values
.sp
\fBport\fP
.INDENT 0.0
.INDENT 3.5
A TCP host:port value or (e.g. \fB127.0.0.1:9001\fP) on which
supervisor will listen for HTTP/XML\-RPC requests.
\fBsupervisorctl\fP will use XML\-RPC to communicate with
\fBsupervisord\fP over this port.  To listen on all interfaces
in the machine, use \fB:9001\fP or \fB*:9001\fP\&.
.sp
\fIDefault\fP:  No default.
.sp
\fIRequired\fP:  Yes.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBusername\fP
.INDENT 0.0
.INDENT 3.5
The username required for authentication to this HTTP server.
.sp
\fIDefault\fP:  No username required.
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBpassword\fP
.INDENT 0.0
.INDENT 3.5
The password required for authentication to this HTTP server.  This
can be a cleartext password, or can be specified as a SHA\-1 hash if
prefixed by the string \fB{SHA}\fP\&.  For example,
\fB{SHA}82ab876d1387bfafe46cc1c8a2ef074eae50cb1d\fP is the SHA\-stored
version of the password "thepassword".
.sp
Note that hashed password must be in hex format.
.sp
\fIDefault\fP:  No password required.
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.SS \fB[inet_http_server]\fP Section Example
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
[inet_http_server]
port = 127.0.0.1:9001
username = user
password = 123
.ft P
.fi
.UNINDENT
.UNINDENT
.SS \fB[supervisord]\fP Section Settings
.sp
The \fBsupervisord.conf\fP file contains a section named
\fB[supervisord]\fP in which global settings related to the
\fBsupervisord\fP process should be inserted.  These are as
follows.
.SS \fB[supervisord]\fP Section Values
.sp
\fBlogfile\fP
.INDENT 0.0
.INDENT 3.5
The path to the activity log of the supervisord process.  This
option can include the value \fB%(here)s\fP, which expands to the
directory in which the supervisord configuration file was found.
.sp
\fIDefault\fP:  \fB$CWD/supervisord.log\fP
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBlogfile_maxbytes\fP
.INDENT 0.0
.INDENT 3.5
The maximum number of bytes that may be consumed by the activity log
file before it is rotated (suffix multipliers like "KB", "MB", and
"GB" can be used in the value).  Set this value to 0 to indicate an
unlimited log size.
.sp
\fIDefault\fP:  50MB
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBlogfile_backups\fP
.INDENT 0.0
.INDENT 3.5
The number of backups to keep around resulting from activity log
file rotation.  If set to 0, no backups will be kept.
.sp
\fIDefault\fP:  10
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBloglevel\fP
.INDENT 0.0
.INDENT 3.5
The logging level, dictating what is written to the supervisord
activity log.  One of \fBcritical\fP, \fBerror\fP, \fBwarn\fP, \fBinfo\fP,
\fBdebug\fP, \fBtrace\fP, or \fBblather\fP\&.  Note that at log level
\fBdebug\fP, the supervisord log file will record the stderr/stdout
output of its child processes and extended info info about process
state changes, which is useful for debugging a process which isn\(aqt
starting properly.  See also: activity_log_levels\&.
.sp
\fIDefault\fP:  info
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBpidfile\fP
.INDENT 0.0
.INDENT 3.5
The location in which supervisord keeps its pid file.  This option
can include the value \fB%(here)s\fP, which expands to the directory
in which the supervisord configuration file was found.
.sp
\fIDefault\fP:  \fB$CWD/supervisord.pid\fP
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBumask\fP
.INDENT 0.0
.INDENT 3.5
The umask of the supervisord process.
.sp
\fIDefault\fP:  \fB022\fP
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBnodaemon\fP
.INDENT 0.0
.INDENT 3.5
If true, supervisord will start in the foreground instead of
daemonizing.
.sp
\fIDefault\fP:  false
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBminfds\fP
.INDENT 0.0
.INDENT 3.5
The minimum number of file descriptors that must be available before
supervisord will start successfully.  A call to setrlimit will be made
to attempt to raise the soft and hard limits of the supervisord process to
satisfy \fBminfds\fP\&.  The hard limit may only be raised if supervisord
is run as root.  supervisord uses file descriptors liberally, and will
enter a failure mode when one cannot be obtained from the OS, so it\(aqs
useful to be able to specify a minimum value to ensure it doesn\(aqt run out
of them during execution. This option is particularly useful on Solaris,
which has a low per\-process fd limit by default.
.sp
\fIDefault\fP:  1024
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBminprocs\fP
.INDENT 0.0
.INDENT 3.5
The minimum number of process descriptors that must be available
before supervisord will start successfully.  A call to setrlimit will be
made to attempt to raise the soft and hard limits of the supervisord process
to satisfy \fBminprocs\fP\&.  The hard limit may only be raised if supervisord
is run as root.  supervisord will enter a failure mode when the OS runs out
of process descriptors, so it\(aqs useful to ensure that enough process
descriptors are available upon \fBsupervisord\fP startup.
.sp
\fIDefault\fP:  200
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBnocleanup\fP
.INDENT 0.0
.INDENT 3.5
Prevent supervisord from clearing any existing \fBAUTO\fP
child log files at startup time.  Useful for debugging.
.sp
\fIDefault\fP:  false
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBchildlogdir\fP
.INDENT 0.0
.INDENT 3.5
The directory used for \fBAUTO\fP child log files.  This option can
include the value \fB%(here)s\fP, which expands to the directory in
which the \fBsupervisord\fP configuration file was found.
.sp
\fIDefault\fP: value of Python\(aqs \fBtempfile.get_tempdir()\fP
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBuser\fP
.INDENT 0.0
.INDENT 3.5
Instruct \fBsupervisord\fP to switch users to this UNIX user
account before doing any meaningful processing.  The user can only
be switched if \fBsupervisord\fP is started as the root user.
If \fBsupervisord\fP can\(aqt switch users, it will still continue
but will write a log message at the \fBcritical\fP level saying that it
can\(aqt drop privileges.
.sp
\fIDefault\fP: do not switch users
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBdirectory\fP
.INDENT 0.0
.INDENT 3.5
When \fBsupervisord\fP daemonizes, switch to this directory.
This option can include the value \fB%(here)s\fP, which expands to the
directory in which the \fBsupervisord\fP configuration file was
found.
.sp
\fIDefault\fP: do not cd
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBstrip_ansi\fP
.INDENT 0.0
.INDENT 3.5
Strip all ANSI escape sequences from child log files.
.sp
\fIDefault\fP: false
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBenvironment\fP
.INDENT 0.0
.INDENT 3.5
A list of key/value pairs in the form \fBKEY="val",KEY2="val2"\fP that
will be placed in the \fBsupervisord\fP process\(aq environment
(and as a result in all of its child process\(aq environments).  This
option can include the value \fB%(here)s\fP, which expands to the
directory in which the supervisord configuration file was found.
Values containing non\-alphanumeric characters should be quoted
(e.g. \fBKEY="val:123",KEY2="val,456"\fP).  Otherwise, quoting the
values is optional but recommended.  To escape percent characters,
simply use two. (e.g. \fBURI="/first%%20name"\fP) \fBNote\fP that
subprocesses will inherit the environment variables of the shell
used to start \fBsupervisord\fP except for the ones overridden
here and within the program\(aqs \fBenvironment\fP option.  See
subprocess_environment\&.
.sp
\fIDefault\fP: no values
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBidentifier\fP
.INDENT 0.0
.INDENT 3.5
The identifier string for this supervisor process, used by the RPC
interface.
.sp
\fIDefault\fP: supervisor
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.SS \fB[supervisord]\fP Section Example
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
[supervisord]
logfile = /tmp/supervisord.log
logfile_maxbytes = 50MB
logfile_backups=10
loglevel = info
pidfile = /tmp/supervisord.pid
nodaemon = false
minfds = 1024
minprocs = 200
umask = 022
user = chrism
identifier = supervisor
directory = /tmp
nocleanup = true
childlogdir = /tmp
strip_ansi = false
environment = KEY1="value1",KEY2="value2"
.ft P
.fi
.UNINDENT
.UNINDENT
.SS \fB[supervisorctl]\fP Section Settings
.INDENT 0.0
.INDENT 3.5
The configuration file may contain settings for the
\fBsupervisorctl\fP interactive shell program.  These options
are listed below.
.UNINDENT
.UNINDENT
.SS \fB[supervisorctl]\fP Section Values
.sp
\fBserverurl\fP
.INDENT 0.0
.INDENT 3.5
The URL that should be used to access the supervisord server,
e.g. \fBhttp://localhost:9001\fP\&.  For UNIX domain sockets, use
\fBunix:///absolute/path/to/file.sock\fP\&.
.sp
\fIDefault\fP: \fBhttp://localhost:9001\fP
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBusername\fP
.INDENT 0.0
.INDENT 3.5
The username to pass to the supervisord server for use in
authentication.  This should be same as \fBusername\fP from the
supervisord server configuration for the port or UNIX domain socket
you\(aqre attempting to access.
.sp
\fIDefault\fP: No username
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBpassword\fP
.INDENT 0.0
.INDENT 3.5
The password to pass to the supervisord server for use in
authentication. This should be the cleartext version of \fBpassword\fP
from the supervisord server configuration for the port or UNIX
domain socket you\(aqre attempting to access.  This value cannot be
passed as a SHA hash.  Unlike other passwords specified in this
file, it must be provided in cleartext.
.sp
\fIDefault\fP: No password
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBprompt\fP
.INDENT 0.0
.INDENT 3.5
String used as supervisorctl prompt.
.sp
\fIDefault\fP: \fBsupervisor\fP
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBhistory_file\fP
.INDENT 0.0
.INDENT 3.5
A path to use as the \fBreadline\fP persistent history file.  If you
enable this feature by choosing a path, your supervisorctl commands
will be kept in the file, and you can use readline (e.g. arrow\-up)
to invoke commands you performed in your last supervisorctl session.
.sp
\fIDefault\fP: No file
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0a5
.UNINDENT
.UNINDENT
.SS \fB[supervisorctl]\fP Section Example
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
[supervisorctl]
serverurl = unix:///tmp/supervisor.sock
username = chris
password = 123
prompt = mysupervisor
.ft P
.fi
.UNINDENT
.UNINDENT
.SS \fB[program:x]\fP Section Settings
.sp
The configuration file must contain one or more \fBprogram\fP sections
in order for supervisord to know which programs it should start and
control.  The header value is composite value.  It is the word
"program", followed directly by a colon, then the program name.  A
header value of \fB[program:foo]\fP describes a program with the name of
"foo".  The name is used within client applications that control the
processes that are created as a result of this configuration.  It is
an error to create a \fBprogram\fP section that does not have a name.
The name must not include a colon character or a bracket character.
The value of the name is used as the value for the
\fB%(program_name)s\fP string expression expansion within other values
where specified.
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
A \fB[program:x]\fP section actually represents a "homogeneous
process group" to supervisor (as of 3.0).  The members of the group
are defined by the combination of the \fBnumprocs\fP and
\fBprocess_name\fP parameters in the configuration.  By default, if
numprocs and process_name are left unchanged from their defaults,
the group represented by \fB[program:x]\fP will be named \fBx\fP and
will have a single process named \fBx\fP in it.  This provides a
modicum of backwards compatibility with older supervisor releases,
which did not treat program sections as homogeneous process group
definitions.
.sp
But for instance, if you have a \fB[program:foo]\fP section with a
\fBnumprocs\fP of 3 and a \fBprocess_name\fP expression of
\fB%(program_name)s_%(process_num)02d\fP, the "foo" group will
contain three processes, named \fBfoo_00\fP, \fBfoo_01\fP, and
\fBfoo_02\fP\&.  This makes it possible to start a number of very
similar processes using a single \fB[program:x]\fP section.  All
logfile names, all environment strings, and the command of programs
can also contain similar Python string expressions, to pass
slightly different parameters to each process.
.UNINDENT
.UNINDENT
.SS \fB[program:x]\fP Section Values
.sp
\fBcommand\fP
.INDENT 0.0
.INDENT 3.5
The command that will be run when this program is started.  The
command can be either absolute (e.g. \fB/path/to/programname\fP) or
relative (e.g. \fBprogramname\fP).  If it is relative, the
supervisord\(aqs environment \fB$PATH\fP will be searched for the
executable.  Programs can accept arguments, e.g. \fB/path/to/program
foo bar\fP\&.  The command line can use double quotes to group
arguments with spaces in them to pass to the program,
e.g. \fB/path/to/program/name \-p "foo bar"\fP\&.  Note that the value of
\fBcommand\fP may include Python string expressions,
e.g. \fB/path/to/programname \-\-port=80%(process_num)02d\fP might
expand to \fB/path/to/programname \-\-port=8000\fP at runtime.  String
expressions are evaluated against a dictionary containing the keys
\fBgroup_name\fP, \fBhost_node_name\fP, \fBprocess_num\fP, \fBprogram_name\fP,
\fBhere\fP (the directory of the supervisord config file), and all
supervisord\(aqs environment variables prefixed with \fBENV_\fP\&.  Controlled
programs should themselves not be daemons, as supervisord assumes it is
responsible for daemonizing its subprocesses (see
nondaemonizing_of_subprocesses).
.sp
\fIDefault\fP: No default.
.sp
\fIRequired\fP:  Yes.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBprocess_name\fP
.INDENT 0.0
.INDENT 3.5
A Python string expression that is used to compose the supervisor
process name for this process.  You usually don\(aqt need to worry
about setting this unless you change \fBnumprocs\fP\&.  The string
expression is evaluated against a dictionary that includes
\fBgroup_name\fP, \fBhost_node_name\fP, \fBprocess_num\fP, \fBprogram_name\fP,
and \fBhere\fP (the directory of the supervisord config file).
.sp
\fIDefault\fP: \fB%(program_name)s\fP
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBnumprocs\fP
.INDENT 0.0
.INDENT 3.5
Supervisor will start as many instances of this program as named by
numprocs.  Note that if numprocs > 1, the \fBprocess_name\fP
expression must include \fB%(process_num)s\fP (or any other
valid Python string expression that includes \fBprocess_num\fP) within
it.
.sp
\fIDefault\fP: 1
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBnumprocs_start\fP
.INDENT 0.0
.INDENT 3.5
An integer offset that is used to compute the number at which
\fBnumprocs\fP starts.
.sp
\fIDefault\fP: 0
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBpriority\fP
.INDENT 0.0
.INDENT 3.5
The relative priority of the program in the start and shutdown
ordering.  Lower priorities indicate programs that start first and
shut down last at startup and when aggregate commands are used in
various clients (e.g. "start all"/"stop all").  Higher priorities
indicate programs that start last and shut down first.
.sp
\fIDefault\fP: 999
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBautostart\fP
.INDENT 0.0
.INDENT 3.5
If true, this program will start automatically when supervisord is
started.
.sp
\fIDefault\fP: true
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBstartsecs\fP
.INDENT 0.0
.INDENT 3.5
The total number of seconds which the program needs to stay running
after a startup to consider the start successful (moving the process
from the \fBSTARTING\fP state to the \fBRUNNING\fP state).  Set to \fB0\fP
to indicate that the program needn\(aqt stay running for any particular
amount of time.
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
Even if a process exits with an "expected" exit code (see
\fBexitcodes\fP), the start will still be considered a failure
if the process exits quicker than \fBstartsecs\fP\&.
.UNINDENT
.UNINDENT
.sp
\fIDefault\fP: 1
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBstartretries\fP
.INDENT 0.0
.INDENT 3.5
The number of serial failure attempts that \fBsupervisord\fP
will allow when attempting to start the program before giving up and
putting the process into an \fBFATAL\fP state.  See
process_states for explanation of the \fBFATAL\fP state.
.sp
\fIDefault\fP: 3
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBautorestart\fP
.INDENT 0.0
.INDENT 3.5
Specifies if \fBsupervisord\fP should automatically restart a
process if it exits when it is in the \fBRUNNING\fP state.  May be
one of \fBfalse\fP, \fBunexpected\fP, or \fBtrue\fP\&.  If \fBfalse\fP, the
process will not be autorestarted.  If \fBunexpected\fP, the process
will be restarted when the program exits with an exit code that is
not one of the exit codes associated with this process\(aq configuration
(see \fBexitcodes\fP).  If \fBtrue\fP, the process will be unconditionally
restarted when it exits, without regard to its exit code.
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
\fBautorestart\fP controls whether \fBsupervisord\fP will
autorestart a program if it exits after it has successfully started
up (the process is in the \fBRUNNING\fP state).
.sp
\fBsupervisord\fP has a different restart mechanism for when the
process is starting up (the process is in the \fBSTARTING\fP state).
Retries during process startup are controlled by \fBstartsecs\fP
and \fBstartretries\fP\&.
.UNINDENT
.UNINDENT
.sp
\fIDefault\fP: unexpected
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBexitcodes\fP
.INDENT 0.0
.INDENT 3.5
The list of "expected" exit codes for this program used with \fBautorestart\fP\&.
If the \fBautorestart\fP parameter is set to \fBunexpected\fP, and the process
exits in any other way than as a result of a supervisor stop
request, \fBsupervisord\fP will restart the process if it exits
with an exit code that is not defined in this list.
.sp
\fIDefault\fP: 0,2
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBstopsignal\fP
.INDENT 0.0
.INDENT 3.5
The signal used to kill the program when a stop is requested.  This
can be any of TERM, HUP, INT, QUIT, KILL, USR1, or USR2.
.sp
\fIDefault\fP: TERM
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBstopwaitsecs\fP
.INDENT 0.0
.INDENT 3.5
The number of seconds to wait for the OS to return a SIGCHILD to
\fBsupervisord\fP after the program has been sent a stopsignal.
If this number of seconds elapses before \fBsupervisord\fP
receives a SIGCHILD from the process, \fBsupervisord\fP will
attempt to kill it with a final SIGKILL.
.sp
\fIDefault\fP: 10
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBstopasgroup\fP
.INDENT 0.0
.INDENT 3.5
If true, the flag causes supervisor to send the stop signal to the
whole process group and implies \fBkillasgroup\fP is true.  This is useful
for programs, such as Flask in debug mode, that do not propagate
stop signals to their children, leaving them orphaned.
.sp
\fIDefault\fP: false
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0b1
.UNINDENT
.UNINDENT
.sp
\fBkillasgroup\fP
.INDENT 0.0
.INDENT 3.5
If true, when resorting to send SIGKILL to the program to terminate
it send it to its whole process group instead, taking care of its
children as well, useful e.g with Python programs using
\fBmultiprocessing\fP\&.
.sp
\fIDefault\fP: false
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0a11
.UNINDENT
.UNINDENT
.sp
\fBuser\fP
.INDENT 0.0
.INDENT 3.5
Instruct \fBsupervisord\fP to use this UNIX user account as the
account which runs the program.  The user can only be switched if
\fBsupervisord\fP is run as the root user.  If \fBsupervisord\fP
can\(aqt switch to the specified user, the program will not be started.
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
The user will be changed using \fBsetuid\fP only.  This does not start
a login shell and does not change environment variables like
\fBUSER\fP or \fBHOME\fP\&.  See subprocess_environment for details.
.UNINDENT
.UNINDENT
.sp
\fIDefault\fP: Do not switch users
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBredirect_stderr\fP
.INDENT 0.0
.INDENT 3.5
If true, cause the process\(aq stderr output to be sent back to
\fBsupervisord\fP on its stdout file descriptor (in UNIX shell
terms, this is the equivalent of executing \fB/the/program 2>&1\fP).
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
Do not set \fBredirect_stderr=true\fP in an \fB[eventlistener:x]\fP section.
Eventlisteners use \fBstdout\fP and \fBstdin\fP to communicate with
\fBsupervisord\fP\&.  If \fBstderr\fP is redirected, output from
\fBstderr\fP will interfere with the eventlistener protocol.
.UNINDENT
.UNINDENT
.sp
\fIDefault\fP: false
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0, replaces 2.0\(aqs \fBlog_stdout\fP and \fBlog_stderr\fP
.UNINDENT
.UNINDENT
.sp
\fBstdout_logfile\fP
.INDENT 0.0
.INDENT 3.5
Put process stdout output in this file (and if redirect_stderr is
true, also place stderr output in this file).  If \fBstdout_logfile\fP
is unset or set to \fBAUTO\fP, supervisor will automatically choose a
file location.  If this is set to \fBNONE\fP, supervisord will create
no log file.  \fBAUTO\fP log files and their backups will be deleted
when \fBsupervisord\fP restarts.  The \fBstdout_logfile\fP value
can contain Python string expressions that will evaluated against a
dictionary that contains the keys \fBgroup_name\fP, \fBhost_node_name\fP,
\fBprocess_num\fP, \fBprogram_name\fP, and \fBhere\fP (the directory of the
supervisord config file).
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
It is not possible for two processes to share a single log file
(\fBstdout_logfile\fP) when rotation (\fBstdout_logfile_maxbytes\fP)
is enabled.  This will result in the file being corrupted.
.UNINDENT
.UNINDENT
.sp
\fIDefault\fP: \fBAUTO\fP
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0, replaces 2.0\(aqs \fBlogfile\fP
.UNINDENT
.UNINDENT
.sp
\fBstdout_logfile_maxbytes\fP
.INDENT 0.0
.INDENT 3.5
The maximum number of bytes that may be consumed by
\fBstdout_logfile\fP before it is rotated (suffix multipliers like
"KB", "MB", and "GB" can be used in the value).  Set this value to 0
to indicate an unlimited log size.
.sp
\fIDefault\fP: 50MB
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0, replaces 2.0\(aqs \fBlogfile_maxbytes\fP
.UNINDENT
.UNINDENT
.sp
\fBstdout_logfile_backups\fP
.INDENT 0.0
.INDENT 3.5
The number of \fBstdout_logfile\fP backups to keep around resulting
from process stdout log file rotation.  If set to 0, no backups
will be kept.
.sp
\fIDefault\fP: 10
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0, replaces 2.0\(aqs \fBlogfile_backups\fP
.UNINDENT
.UNINDENT
.sp
\fBstdout_capture_maxbytes\fP
.INDENT 0.0
.INDENT 3.5
Max number of bytes written to capture FIFO when process is in
"stdout capture mode" (see capture_mode).  Should be an
integer (suffix multipliers like "KB", "MB" and "GB" can used in the
value).  If this value is 0, process capture mode will be off.
.sp
\fIDefault\fP: 0
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0, replaces 2.0\(aqs \fBlogfile_backups\fP
.UNINDENT
.UNINDENT
.sp
\fBstdout_events_enabled\fP
.INDENT 0.0
.INDENT 3.5
If true, PROCESS_LOG_STDOUT events will be emitted when the process
writes to its stdout file descriptor.  The events will only be
emitted if the file descriptor is not in capture mode at the time
the data is received (see capture_mode).
.sp
\fIDefault\fP: 0
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0a7
.UNINDENT
.UNINDENT
.sp
\fBstderr_logfile\fP
.INDENT 0.0
.INDENT 3.5
Put process stderr output in this file unless \fBredirect_stderr\fP is
true.  Accepts the same value types as \fBstdout_logfile\fP and may
contain the same Python string expressions.
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
It is not possible for two processes to share a single log file
(\fBstderr_logfile\fP) when rotation (\fBstderr_logfile_maxbytes\fP)
is enabled.  This will result in the file being corrupted.
.UNINDENT
.UNINDENT
.sp
\fIDefault\fP: \fBAUTO\fP
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBstderr_logfile_maxbytes\fP
.INDENT 0.0
.INDENT 3.5
The maximum number of bytes before logfile rotation for
\fBstderr_logfile\fP\&.  Accepts the same value types as
\fBstdout_logfile_maxbytes\fP\&.
.sp
\fIDefault\fP: 50MB
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBstderr_logfile_backups\fP
.INDENT 0.0
.INDENT 3.5
The number of backups to keep around resulting from process stderr
log file rotation.  If set to 0, no backups will be kept.
.sp
\fIDefault\fP: 10
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBstderr_capture_maxbytes\fP
.INDENT 0.0
.INDENT 3.5
Max number of bytes written to capture FIFO when process is in
"stderr capture mode" (see capture_mode).  Should be an
integer (suffix multipliers like "KB", "MB" and "GB" can used in the
value).  If this value is 0, process capture mode will be off.
.sp
\fIDefault\fP: 0
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBstderr_events_enabled\fP
.INDENT 0.0
.INDENT 3.5
If true, PROCESS_LOG_STDERR events will be emitted when the process
writes to its stderr file descriptor.  The events will only be
emitted if the file descriptor is not in capture mode at the time
the data is received (see capture_mode).
.sp
\fIDefault\fP: false
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0a7
.UNINDENT
.UNINDENT
.sp
\fBenvironment\fP
.INDENT 0.0
.INDENT 3.5
A list of key/value pairs in the form \fBKEY="val",KEY2="val2"\fP that
will be placed in the child process\(aq environment.  The environment
string may contain Python string expressions that will be evaluated
against a dictionary containing \fBgroup_name\fP, \fBhost_node_name\fP,
\fBprocess_num\fP, \fBprogram_name\fP, and \fBhere\fP (the directory of the
supervisord config file).  Values containing non\-alphanumeric characters
should be quoted (e.g. \fBKEY="val:123",KEY2="val,456"\fP).  Otherwise,
quoting the values is optional but recommended.  \fBNote\fP that the
subprocess will inherit the environment variables of the shell used to
start "supervisord" except for the ones overridden here.  See
subprocess_environment\&.
.sp
\fIDefault\fP: No extra environment
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBdirectory\fP
.INDENT 0.0
.INDENT 3.5
A file path representing a directory to which \fBsupervisord\fP
should temporarily chdir before exec\(aqing the child.
.sp
\fIDefault\fP: No chdir (inherit supervisor\(aqs)
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBumask\fP
.INDENT 0.0
.INDENT 3.5
An octal number (e.g. 002, 022) representing the umask of the
process.
.sp
\fIDefault\fP: No special umask (inherit supervisor\(aqs)
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBserverurl\fP
.INDENT 0.0
.INDENT 3.5
The URL passed in the environment to the subprocess process as
\fBSUPERVISOR_SERVER_URL\fP (see \fBsupervisor.childutils\fP) to
allow the subprocess to easily communicate with the internal HTTP
server.  If provided, it should have the same syntax and structure
as the \fB[supervisorctl]\fP section option of the same name.  If this
is set to AUTO, or is unset, supervisor will automatically construct
a server URL, giving preference to a server that listens on UNIX
domain sockets over one that listens on an internet socket.
.sp
\fIDefault\fP: AUTO
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.SS \fB[program:x]\fP Section Example
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
[program:cat]
command=/bin/cat
process_name=%(program_name)s
numprocs=1
directory=/tmp
umask=022
priority=999
autostart=true
autorestart=unexpected
startsecs=10
startretries=3
exitcodes=0,2
stopsignal=TERM
stopwaitsecs=10
stopasgroup=false
killasgroup=false
user=chrism
redirect_stderr=false
stdout_logfile=/a/path
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
stdout_capture_maxbytes=1MB
stdout_events_enabled=false
stderr_logfile=/a/path
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10
stderr_capture_maxbytes=1MB
stderr_events_enabled=false
environment=A="1",B="2"
serverurl=AUTO
.ft P
.fi
.UNINDENT
.UNINDENT
.SS \fB[include]\fP Section Settings
.sp
The \fBsupervisord.conf\fP file may contain a section named
\fB[include]\fP\&.  If the configuration file contains an \fB[include]\fP
section, it must contain a single key named "files".  The values in
this key specify other configuration files to be included within the
configuration.
.SS \fB[include]\fP Section Values
.sp
\fBfiles\fP
.INDENT 0.0
.INDENT 3.5
A space\-separated sequence of file globs.  Each file glob may be
absolute or relative.  If the file glob is relative, it is
considered relative to the location of the configuration file which
includes it.  A "glob" is a file pattern which matches a specified
pattern according to the rules used by the Unix shell. No tilde
expansion is done, but \fB*\fP, \fB?\fP, and character ranges expressed
with \fB[]\fP will be correctly matched.  Recursive includes from
included files are not supported.
.sp
\fIDefault\fP: No default (required)
.sp
\fIRequired\fP:  Yes.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.SS \fB[include]\fP Section Example
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
[include]
files = /an/absolute/filename.conf /an/absolute/*.conf foo.conf config??.conf
.ft P
.fi
.UNINDENT
.UNINDENT
.SS \fB[group:x]\fP Section Settings
.sp
It is often useful to group "homogeneous" process groups (aka
"programs") together into a "heterogeneous" process group so they can
be controlled as a unit from Supervisor\(aqs various controller
interfaces.
.sp
To place programs into a group so you can treat them as a unit, define
a \fB[group:x]\fP section in your configuration file.  The group header
value is a composite.  It is the word "group", followed directly by a
colon, then the group name.  A header value of \fB[group:foo]\fP
describes a group with the name of "foo".  The name is used within
client applications that control the processes that are created as a
result of this configuration.  It is an error to create a \fBgroup\fP
section that does not have a name.  The name must not include a colon
character or a bracket character.
.sp
For a \fB[group:x]\fP, there must be one or more \fB[program:x]\fP
sections elsewhere in your configuration file, and the group must
refer to them by name in the \fBprograms\fP value.
.sp
If "homogeneous" process groups (represented by program sections) are
placed into a "heterogeneous" group via \fB[group:x]\fP section\(aqs
\fBprograms\fP line, the homogeneous groups that are implied by the
program section will not exist at runtime in supervisor.  Instead, all
processes belonging to each of the homogeneous groups will be placed
into the heterogeneous group.  For example, given the following group
configuration:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
[group:foo]
programs=bar,baz
priority=999
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Given the above, at supervisord startup, the \fBbar\fP and \fBbaz\fP
homogeneous groups will not exist, and the processes that would have
been under them will now be moved into the \fBfoo\fP group.
.SS \fB[group:x]\fP Section Values
.sp
\fBprograms\fP
.INDENT 0.0
.INDENT 3.5
A comma\-separated list of program names.  The programs which are
listed become members of the group.
.sp
\fIDefault\fP: No default (required)
.sp
\fIRequired\fP:  Yes.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBpriority\fP
.INDENT 0.0
.INDENT 3.5
A priority number analogous to a \fB[program:x]\fP priority value
assigned to the group.
.sp
\fIDefault\fP: 999
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.SS \fB[group:x]\fP Section Example
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
[group:foo]
programs=bar,baz
priority=999
.ft P
.fi
.UNINDENT
.UNINDENT
.SS \fB[fcgi\-program:x]\fP Section Settings
.sp
Supervisor can manage groups of \fI\%FastCGI\fP
processes that all listen on the same socket.  Until now, deployment
flexibility for FastCGI was limited.  To get full process management,
you could use mod_fastcgi under Apache but then you were stuck with
Apache\(aqs inefficient concurrency model of one process or thread per
connection.  In addition to requiring more CPU and memory resources,
the process/thread per connection model can be quickly saturated by a
slow resource, preventing other resources from being served.  In order
to take advantage of newer event\-driven web servers such as lighttpd
or nginx which don\(aqt include a built\-in process manager, you had to
use scripts like cgi\-fcgi or spawn\-fcgi.  These can be used in
conjunction with a process manager such as supervisord or daemontools
but require each FastCGI child process to bind to its own socket.
The disadvantages of this are: unnecessarily complicated web server
configuration, ungraceful restarts, and reduced fault tolerance.  With
fewer sockets to configure, web server configurations are much smaller
if groups of FastCGI processes can share sockets.  Shared sockets
allow for graceful restarts because the socket remains bound by the
parent process while any of the child processes are being restarted.
Finally, shared sockets are more fault tolerant because if a given
process fails, other processes can continue to serve inbound
connections.
.sp
With integrated FastCGI spawning support, Supervisor gives you the
best of both worlds.  You get full\-featured process management with
groups of FastCGI processes sharing sockets without being tied to a
particular web server.  It\(aqs a clean separation of concerns, allowing
the web server and the process manager to each do what they do best.
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
The socket manager in Supervisor was originally developed to support
FastCGI processes but it is not limited to FastCGI.  Other protocols may
be used as well with no special configuration.  Any program that can
access an open socket from a file descriptor (e.g. with
\fI\%socket.fromfd\fP
in Python) can use the socket manager.  Supervisor will automatically
create the socket, bind, and listen before forking the first child in a
group.  The socket will be passed to each child on file descriptor
number \fB0\fP (zero).  When the last child in the group exits,
Supervisor will close the socket.
.UNINDENT
.UNINDENT
.sp
All the options available to \fB[program:x]\fP sections are
also respected by \fBfcgi\-program\fP sections.
.SS \fB[fcgi\-program:x]\fP Section Values
.sp
\fB[fcgi\-program:x]\fP sections have a single key which \fB[program:x]\fP
sections do not have.
.sp
\fBsocket\fP
.INDENT 0.0
.INDENT 3.5
The FastCGI socket for this program, either TCP or UNIX domain
socket. For TCP sockets, use this format: \fBtcp://localhost:9002\fP\&.
For UNIX domain sockets, use \fBunix:///absolute/path/to/file.sock\fP\&.
String expressions are evaluated against a dictionary containing the
keys "program_name" and "here" (the directory of the supervisord
config file).
.sp
\fIDefault\fP: No default.
.sp
\fIRequired\fP:  Yes.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBsocket_owner\fP
.INDENT 0.0
.INDENT 3.5
For UNIX domain sockets, this parameter can be used to specify the user
and group for the FastCGI socket. May be a UNIX username (e.g. chrism)
or a UNIX username and group separated by a colon (e.g. chrism:wheel).
.sp
\fIDefault\fP: Uses the user and group set for the fcgi\-program
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
\fBsocket_mode\fP
.INDENT 0.0
.INDENT 3.5
For UNIX domain sockets, this parameter can be used to specify the
permission mode.
.sp
\fIDefault\fP: 0700
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.sp
Consult \fI\%[program:x] Section Settings\fP for other allowable keys, delta the
above constraints and additions.
.SS \fB[fcgi\-program:x]\fP Section Example
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
[fcgi\-program:fcgiprogramname]
command=/usr/bin/example.fcgi
socket=unix:///var/run/supervisor/%(program_name)s.sock
socket_owner=chrism
socket_mode=0700
process_name=%(program_name)s_%(process_num)02d
numprocs=5
directory=/tmp
umask=022
priority=999
autostart=true
autorestart=unexpected
startsecs=1
startretries=3
exitcodes=0,2
stopsignal=QUIT
stopasgroup=false
killasgroup=false
stopwaitsecs=10
user=chrism
redirect_stderr=true
stdout_logfile=/a/path
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
stdout_events_enabled=false
stderr_logfile=/a/path
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10
stderr_events_enabled=false
environment=A="1",B="2"
serverurl=AUTO
.ft P
.fi
.UNINDENT
.UNINDENT
.SS \fB[eventlistener:x]\fP Section Settings
.sp
Supervisor allows specialized homogeneous process groups ("event
listener pools") to be defined within the configuration file.  These
pools contain processes that are meant to receive and respond to event
notifications from supervisor\(aqs event system.  See events for
an explanation of how events work and how to implement programs that
can be declared as event listeners.
.sp
Note that all the options available to \fB[program:x]\fP sections are
respected by eventlistener sections \fIexcept\fP for
\fBstdout_capture_maxbytes\fP and \fBstderr_capture_maxbytes\fP (event
listeners cannot emit process communication events, see
capture_mode).
.SS \fB[eventlistener:x]\fP Section Values
.sp
\fB[eventlistener:x]\fP sections have a few keys which \fB[program:x]\fP
sections do not have.
.sp
\fBbuffer_size\fP
.INDENT 0.0
.INDENT 3.5
The event listener pool\(aqs event queue buffer size.  When a listener
pool\(aqs event buffer is overflowed (as can happen when an event
listener pool cannot keep up with all of the events sent to it), the
oldest event in the buffer is discarded.
.UNINDENT
.UNINDENT
.sp
\fBevents\fP
.INDENT 0.0
.INDENT 3.5
A comma\-separated list of event type names that this listener is
"interested" in receiving notifications for (see
event_types for a list of valid event type names).
.UNINDENT
.UNINDENT
.sp
\fBresult_handler\fP
.INDENT 0.0
.INDENT 3.5
A \fI\%pkg_resources entry point string\fP that
resolves to a Python callable.  The default value is
\fBsupervisor.dispatchers:default_handler\fP\&.  Specifying an alternate
result handler is a very uncommon thing to need to do, and as a
result, how to create one is not documented.
.UNINDENT
.UNINDENT
.sp
Consult \fI\%[program:x] Section Settings\fP for other allowable keys, delta the
above constraints and additions.
.SS \fB[eventlistener:x]\fP Section Example
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
[eventlistener:theeventlistenername]
command=/bin/eventlistener
process_name=%(program_name)s_%(process_num)02d
numprocs=5
events=PROCESS_STATE
buffer_size=10
directory=/tmp
umask=022
priority=\-1
autostart=true
autorestart=unexpected
startsecs=1
startretries=3
exitcodes=0,2
stopsignal=QUIT
stopwaitsecs=10
stopasgroup=false
killasgroup=false
user=chrism
redirect_stderr=false
stdout_logfile=/a/path
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
stdout_events_enabled=false
stderr_logfile=/a/path
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10
stderr_events_enabled=false
environment=A="1",B="2"
serverurl=AUTO
.ft P
.fi
.UNINDENT
.UNINDENT
.SS \fB[rpcinterface:x]\fP Section Settings
.sp
Adding \fBrpcinterface:x\fP settings in the configuration file is only
useful for people who wish to extend supervisor with additional custom
behavior.
.sp
In the sample config file, there is a section which is named
\fB[rpcinterface:supervisor]\fP\&.  By default it looks like the
following.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The \fB[rpcinterface:supervisor]\fP section \fImust\fP remain in the
configuration for the standard setup of supervisor to work properly.
If you don\(aqt want supervisor to do anything it doesn\(aqt already do out
of the box, this is all you need to know about this type of section.
.sp
However, if you wish to add rpc interface namespaces in order to
customize supervisor, you may add additional \fB[rpcinterface:foo]\fP
sections, where "foo" represents the namespace of the interface (from
the web root), and the value named by
\fBsupervisor.rpcinterface_factory\fP is a factory callable which should
have a function signature that accepts a single positional argument
\fBsupervisord\fP and as many keyword arguments as required to perform
configuration.  Any extra key/value pairs defined within the
\fB[rpcinterface:x]\fP section will be passed as keyword arguments to
the factory.
.sp
Here\(aqs an example of a factory function, created in the
\fB__init__.py\fP file of the Python package \fBmy.package\fP\&.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
from my.package.rpcinterface import AnotherRPCInterface

def make_another_rpcinterface(supervisord, **config):
    retries = int(config.get(\(aqretries\(aq, 0))
    another_rpc_interface = AnotherRPCInterface(supervisord, retries)
    return another_rpc_interface
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
And a section in the config file meant to configure it.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
[rpcinterface:another]
supervisor.rpcinterface_factory = my.package:make_another_rpcinterface
retries = 1
.ft P
.fi
.UNINDENT
.UNINDENT
.SS \fB[rpcinterface:x]\fP Section Values
.sp
\fBsupervisor.rpcinterface_factory\fP
.INDENT 0.0
.INDENT 3.5
\fBpkg_resources\fP "entry point" dotted name to your RPC interface\(aqs
factory function.
.sp
\fIDefault\fP: N/A
.sp
\fIRequired\fP:  No.
.sp
\fIIntroduced\fP: 3.0
.UNINDENT
.UNINDENT
.SS \fB[rpcinterface:x]\fP Section Example
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
[rpcinterface:another]
supervisor.rpcinterface_factory = my.package:make_another_rpcinterface
retries = 1
.ft P
.fi
.UNINDENT
.UNINDENT
.SS Subprocesses
.sp
\fBsupervisord\fP\(aqs primary purpose is to create and manage
processes based on data in its configuration file.  It does this by
creating subprocesses.  Each subprocess spawned by supervisor is
managed for the entirety of its lifetime by supervisord
(\fBsupervisord\fP is the parent process of each process it
creates).  When a child dies, supervisor is notified of its death via
the \fBSIGCHLD\fP signal, and it performs the appropriate operation.
.SS Nondaemonizing of Subprocesses
.sp
Programs meant to be run under supervisor should not daemonize
themselves.  Instead, they should run in the foreground.  They should
not detach from the terminal from which they are started.
.sp
The easiest way to tell if a program will run in the foreground is to
run the command that invokes the program from a shell prompt.  If it
gives you control of the terminal back, but continues running, it\(aqs
daemonizing itself and that will almost certainly be the wrong way to
run it under supervisor.  You want to run a command that essentially
requires you to press \fBCtrl\-C\fP to get control of the terminal
back.  If it gives you a shell prompt back after running it without
needing to press \fBCtrl\-C\fP, it\(aqs not useful under supervisor.  All
programs have options to be run in the foreground but there\(aqs no
"standard way" to do it; you\(aqll need to read the documentation for
each program.
.sp
Below are configuration file examples that are known to start
common programs in "foreground" mode under Supervisor.
.SS Examples of Program Configurations
.sp
Here are some "real world" program configuration examples:
.SS Apache 2.2.6
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
[program:apache2]
command=/path/to/httpd \-c "ErrorLog /dev/stdout" \-DFOREGROUND
redirect_stderr=true
.ft P
.fi
.UNINDENT
.UNINDENT
.SS Two Zope 2.X instances and one ZEO server
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
[program:zeo]
command=/path/to/runzeo
priority=1

[program:zope1]
command=/path/to/instance/home/bin/runzope
priority=2
redirect_stderr=true

[program:zope2]
command=/path/to/another/instance/home/bin/runzope
priority=2
redirect_stderr=true
.ft P
.fi
.UNINDENT
.UNINDENT
.SS Postgres 8.X
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
[program:postgres]
command=/path/to/postmaster
; we use the "fast" shutdown signal SIGINT
stopsignal=INT
redirect_stderr=true
.ft P
.fi
.UNINDENT
.UNINDENT
.SS OpenLDAP \fBslapd\fP
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
[program:slapd]
command=/path/to/slapd \-f /path/to/slapd.conf \-h ldap://0.0.0.0:8888
redirect_stderr=true
.ft P
.fi
.UNINDENT
.UNINDENT
.SS Other Examples
.sp
Other examples of shell scripts that could be used to start services
under \fBsupervisord\fP can be found at
\fI\%http://thedjbway.b0llix.net/services.html\fP\&.  These examples are
actually for \fBdaemontools\fP but the premise is the same for
supervisor.
.sp
Another collection of recipes for starting various programs in the
foreground is available from \fI\%http://smarden.org/runit/runscripts.html\fP\&.
.SS \fBpidproxy\fP Program
.sp
Some processes (like \fBmysqld\fP) ignore signals sent to the
actual process which is spawned by \fBsupervisord\fP\&.  Instead, a
"special" thread/process is created by these kinds of programs which
is responsible for handling signals.  This is problematic because
\fBsupervisord\fP can only kill a process which it creates
itself.  If a process created by \fBsupervisord\fP creates its
own child processes, \fBsupervisord\fP cannot kill them.
.sp
Fortunately, these types of programs typically write a "pidfile" which
contains the "special" process\(aq PID, and is meant to be read and used
in order to kill the process.  As a workaround for this case, a
special \fBpidproxy\fP program can handle startup of these kinds
of processes.  The \fBpidproxy\fP program is a small shim that
starts a process, and upon the receipt of a signal, sends the signal
to the pid provided in a pidfile.  A sample configuration program
entry for a pidproxy\-enabled program is provided below.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
[program:mysql]
command=/path/to/pidproxy /path/to/pidfile /path/to/mysqld_safe
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The \fBpidproxy\fP program is put into your configuration\(aqs
\fB$BINDIR\fP when supervisor is installed (it is a "console script").
.SS Subprocess Environment
.sp
Subprocesses will inherit the environment of the shell used to start
the \fBsupervisord\fP program.  Several environment variables
will be set by \fBsupervisord\fP itself in the child\(aqs
environment also, including \fBSUPERVISOR_ENABLED\fP (a flag
indicating the process is under supervisor control),
\fBSUPERVISOR_PROCESS_NAME\fP (the config\-file\-specified process
name for this process) and \fBSUPERVISOR_GROUP_NAME\fP (the
config\-file\-specified process group name for the child process).
.sp
These environment variables may be overridden within the
\fB[supervisord]\fP section config option named \fBenvironment\fP (applies
to all subprocesses) or within the per\- \fB[program:x]\fP section
\fBenvironment\fP config option (applies only to the subprocess
specified within the \fB[program:x]\fP section).  These "environment"
settings are additive.  In other words, each subprocess\(aq environment
will consist of:
.INDENT 0.0
.INDENT 3.5
The environment variables set within the shell used to start
supervisord...
.sp
\&... added\-to/overridden\-by ...
.INDENT 0.0
.TP
.B \&... the environment variables set within the "environment" global
.INDENT 7.0
.INDENT 3.5
config option ...
.UNINDENT
.UNINDENT
.sp
\&... added\-to/overridden\-by ...
.INDENT 7.0
.TP
.B \&... supervisor\-specific environment variables
(\fBSUPERVISOR_ENABLED\fP,
\fBSUPERVISOR_PROCESS_NAME\fP,
\fBSUPERVISOR_GROUP_NAME\fP) ..
.UNINDENT
.sp
\&... added\-to/overridden\-by ...
.INDENT 7.0
.TP
.B \&... the environment variables set within the per\-process
"environment" config option.
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.sp
No shell is executed by \fBsupervisord\fP when it runs a
subprocess, so environment variables such as \fBUSER\fP,
\fBPATH\fP, \fBHOME\fP, \fBSHELL\fP, \fBLOGNAME\fP,
etc. are not changed from their defaults or otherwise reassigned.
This is particularly important to note when you are running a program
from a \fBsupervisord\fP run as root with a \fBuser=\fP stanza in
the configuration.  Unlike \fBcron\fP, \fBsupervisord\fP
does not attempt to divine and override "fundamental" environment
variables like \fBUSER\fP, \fBPATH\fP, \fBHOME\fP, and
\fBLOGNAME\fP when it performs a setuid to the user defined within
the \fBuser=\fP program config option.  If you need to set environment
variables for a particular program that might otherwise be set by a
shell invocation for a particular user, you must do it explicitly
within the \fBenvironment=\fP program config option.  An
example of setting these environment variables is as below.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
[program:apache2]
command=/home/chrism/bin/httpd \-c "ErrorLog /dev/stdout" \-DFOREGROUND
user=chrism
environment=HOME="/home/chrism",USER="chrism"
.ft P
.fi
.UNINDENT
.UNINDENT
.SS Process States
.sp
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.
.sp
\fBSTOPPED\fP (0)
.INDENT 0.0
.INDENT 3.5
The process has been stopped due to a stop request or
has never been started.
.UNINDENT
.UNINDENT
.sp
\fBSTARTING\fP (10)
.INDENT 0.0
.INDENT 3.5
The process is starting due to a start request.
.UNINDENT
.UNINDENT
.sp
\fBRUNNING\fP (20)
.INDENT 0.0
.INDENT 3.5
The process is running.
.UNINDENT
.UNINDENT
.sp
\fBBACKOFF\fP (30)
.INDENT 0.0
.INDENT 3.5
The process entered the \fBSTARTING\fP state but subsequently exited
too quickly to move to the \fBRUNNING\fP state.
.UNINDENT
.UNINDENT
.sp
\fBSTOPPING\fP (40)
.INDENT 0.0
.INDENT 3.5
The process is stopping due to a stop request.
.UNINDENT
.UNINDENT
.sp
\fBEXITED\fP (100)
.INDENT 0.0
.INDENT 3.5
The process exited from the \fBRUNNING\fP state (expectedly or
unexpectedly).
.UNINDENT
.UNINDENT
.sp
\fBFATAL\fP (200)
.INDENT 0.0
.INDENT 3.5
The process could not be started successfully.
.UNINDENT
.UNINDENT
.sp
\fBUNKNOWN\fP (1000)
.INDENT 0.0
.INDENT 3.5
The process is in an unknown state (\fBsupervisord\fP
programming error).
.UNINDENT
.UNINDENT
.sp
Each process run under supervisor progresses through these states as
per the following directed graph.
.INDENT 0.0
.INDENT 2.5
[image: Subprocess State Transition Graph]
[image]
Subprocess State Transition Graph.UNINDENT
.UNINDENT
.sp
A process is in the \fBSTOPPED\fP state if it has been stopped
adminstratively or if it has never been started.
.sp
When an autorestarting process is in the \fBBACKOFF\fP state, it will be
automatically restarted by \fBsupervisord\fP\&.  It will switch
between \fBSTARTING\fP and \fBBACKOFF\fP states until it becomes evident
that it cannot be started because the number of \fBstartretries\fP has
exceeded the maximum, at which point it will transition to the
\fBFATAL\fP state.  Each start retry will take progressively
more time.
.sp
When a process is in the \fBEXITED\fP state, it will
automatically restart:
.INDENT 0.0
.IP \(bu 2
never if its \fBautorestart\fP parameter is set to \fBfalse\fP\&.
.IP \(bu 2
unconditionally if its \fBautorestart\fP parameter is set to \fBtrue\fP\&.
.IP \(bu 2
conditionally if its \fBautorestart\fP parameter is set to
\fBunexpected\fP\&.  If it exited with an exit code that doesn\(aqt match
one of the exit codes defined in the \fBexitcodes\fP configuration
parameter for the process, it will be restarted.
.UNINDENT
.sp
A process automatically transitions from \fBEXITED\fP to \fBRUNNING\fP as
a result of being configured to autorestart conditionally or
unconditionally.  The number of transitions between \fBRUNNING\fP and
\fBEXITED\fP 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.
.sp
An autorestarted process will never be automatically restarted if it
ends up in the \fBFATAL\fP state (it must be manually restarted from
this state).
.sp
A process transitions into the \fBSTOPPING\fP state via an
administrative stop request, and will then end up in the
\fBSTOPPED\fP state.
.sp
A process that cannot be stopped successfully will stay in the
\fBSTOPPING\fP state forever.  This situation should never be reached
during normal operations as it implies that the process did not
respond to a final \fBSIGKILL\fP signal sent to it by supervisor, which
is "impossible" under UNIX.
.sp
State transitions which always require user action to invoke are
these:
.sp
\fBFATAL\fP   \-> \fBSTARTING\fP
.sp
\fBRUNNING\fP \-> \fBSTOPPING\fP
.sp
State transitions which typically, but not always, require user
action to invoke are these, with exceptions noted:
.sp
\fBSTOPPED\fP \-> \fBSTARTING\fP (except at supervisord startup if process
is configured to autostart)
.sp
\fBEXITED\fP \-> \fBSTARTING\fP (except if process is configured to
autorestart)
.sp
All other state transitions are managed by supervisord automatically.
.SS Logging
.sp
One of the main tasks that \fBsupervisord\fP performs is logging.
\fBsupervisord\fP logs an activity log detailing what it\(aqs doing
as it runs.  It also logs child process stdout and stderr output to
other files if configured to do so.
.SS Activity Log
.sp
The activity log is the place where \fBsupervisord\fP logs
messages about its own health, its subprocess\(aq state changes, any
messages that result from events, and debug and informational
messages.  The path to the activity log is configured via the
\fBlogfile\fP parameter in the \fB[supervisord]\fP section of the
configuration file, defaulting to \fB$CWD/supervisord.log\fP\&.
Sample activity log traffic is shown in the example below.  Some lines
have been broken to better fit the screen.
.SS Sample Activity Log Output
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
2007\-09\-08 14:43:22,886 DEBG 127.0.0.1:Medusa (V1.11) started at Sat Sep  8 14:43:22 2007
        Hostname: kingfish
        Port:9001
2007\-09\-08 14:43:22,961 INFO RPC interface \(aqsupervisor\(aq initialized
2007\-09\-08 14:43:22,961 CRIT Running without any HTTP authentication checking
2007\-09\-08 14:43:22,962 INFO supervisord started with pid 27347
2007\-09\-08 14:43:23,965 INFO spawned: \(aqlistener_00\(aq with pid 27349
2007\-09\-08 14:43:23,970 INFO spawned: \(aqeventgen\(aq with pid 27350
2007\-09\-08 14:43:23,990 INFO spawned: \(aqgrower\(aq with pid 27351
2007\-09\-08 14:43:24,059 DEBG \(aqlistener_00\(aq stderr output:
 /Users/chrism/projects/supervisor/supervisor2/dev\-sandbox/bin/python:
 can\(aqt open file \(aq/Users/chrism/projects/supervisor/supervisor2/src/supervisor/scripts/osx_eventgen_listener.py\(aq:
 [Errno 2] No such file or directory
2007\-09\-08 14:43:24,060 DEBG fd 7 closed, stopped monitoring <PEventListenerDispatcher at 19910168 for
 <Subprocess at 18892960 with name listener_00 in state STARTING> (stdout)>
2007\-09\-08 14:43:24,060 INFO exited: listener_00 (exit status 2; not expected)
2007\-09\-08 14:43:24,061 DEBG received SIGCHLD indicating a child quit
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The activity log "level" is configured in the config file via the
\fBloglevel\fP parameter in the \fB[supervisord]\fP ini file section.
When \fBloglevel\fP is set, messages of the specified priority, plus
those with any higher priority are logged to the activity log.  For
example, if \fBloglevel\fP is \fBerror\fP, messages of \fBerror\fP and
\fBcritical\fP priority will be logged.  However, if loglevel is
\fBwarn\fP, messages of \fBwarn\fP, \fBerror\fP, and \fBcritical\fP will be
logged.
.SS Activity Log Levels
.sp
The below table describes the logging levels in more detail, ordered
in highest priority to lowest.  The "Config File Value" is the string
provided to the \fBloglevel\fP parameter in the \fB[supervisord]\fP
section of configuration file and the "Output Code" is the code that
shows up in activity log output lines.
.TS
center;
|l|l|l|.
_
T{
Config File Value
T}	T{
Output Code
T}	T{
Description
T}
_
T{
critical
T}	T{
CRIT
T}	T{
Messages that indicate a condition that
requires immediate user attention, a
supervisor state change, or an error in
supervisor itself.
T}
_
T{
error
T}	T{
ERRO
T}	T{
Messages that indicate a potentially
ignorable error condition (e.g. unable to
clear a log directory).
T}
_
T{
warn
T}	T{
WARN
T}	T{
Messages that indicate an anomalous
condition which isn\(aqt an error.
T}
_
T{
info
T}	T{
INFO
T}	T{
Normal informational output.  This is the
default log level if none is explicitly
configured.
T}
_
T{
debug
T}	T{
DEBG
T}	T{
Messages useful for users trying to debug
process configuration and communications
behavior (process output, listener state
changes, event notifications).
T}
_
T{
trace
T}	T{
TRAC
T}	T{
Messages useful for developers trying to
debug supervisor plugins, and information
about HTTP and RPC requests and responses.
T}
_
T{
blather
T}	T{
BLAT
T}	T{
Messages useful for developers trying to
debug supervisor itself.
T}
_
.TE
.SS Activity Log Rotation
.sp
The activity log is "rotated" by \fBsupervisord\fP based on the
combination of the \fBlogfile_maxbytes\fP and the \fBlogfile_backups\fP
parameters in the \fB[supervisord]\fP section of the configuration file.
When the activity log reaches \fBlogfile_maxbytes\fP bytes, the current
log file is moved to a backup file and a new activity log file is
created.  When this happens, if the number of existing backup files is
greater than or equal to \fBlogfile_backups\fP, the oldest backup file
is removed and the backup files are renamed accordingly.  If the file
being written to is named \fBsupervisord.log\fP, when it exceeds
\fBlogfile_maxbytes\fP, it is closed and renamed to
\fBsupervisord.log.1\fP, and if files \fBsupervisord.log.1\fP,
\fBsupervisord.log.2\fP etc. exist, then they are renamed to
\fBsupervisord.log.2\fP, \fBsupervisord.log.3\fP etc.
respectively.  If \fBlogfile_maxbytes\fP is 0, the logfile is never
rotated (and thus backups are never made).  If \fBlogfile_backups\fP is
0, no backups will be kept.
.SS Child Process Logs
.sp
The stdout of child processes spawned by supervisor, by default, is
captured for redisplay to users of \fBsupervisorctl\fP and other
clients.  If no specific logfile\-related configuration is performed in
a \fB[program:x]\fP, \fB[fcgi\-program:x]\fP, or \fB[eventlistener:x]\fP
section in the configuration file, the following is true:
.INDENT 0.0
.IP \(bu 2
\fBsupervisord\fP will capture the child process\(aq stdout and
stderr output into temporary files.  Each stream is captured to a
separate file.  This is known as \fBAUTO\fP log mode.
.IP \(bu 2
\fBAUTO\fP log files are named automatically and placed in the
directory configured as \fBchildlogdir\fP of the \fB[supervisord]\fP
section of the config file.
.IP \(bu 2
The size of each \fBAUTO\fP log file is bounded by the
\fB{streamname}_logfile_maxbytes\fP value of the program section
(where {streamname} is "stdout" or "stderr").  When it reaches that
number, it is rotated (like the activity log), based on the
\fB{streamname}_logfile_backups\fP\&.
.UNINDENT
.sp
The configuration keys that influence child process logging in
\fB[program:x]\fP and \fB[fcgi\-program:x]\fP sections are these:
.sp
\fBredirect_stderr\fP, \fBstdout_logfile\fP, \fBstdout_logfile_maxbytes\fP,
\fBstdout_logfile_backups\fP, \fBstdout_capture_maxbytes\fP,
\fBstderr_logfile\fP, \fBstderr_logfile_maxbytes\fP,
\fBstderr_logfile_backups\fP and \fBstderr_capture_maxbytes\fP\&.
.sp
One may set \fBstdout_logfile\fP or \fBstderr_logfile\fP to the
special string "syslog". In this case, logs will be routed to the
syslog service instead of being saved to files.
.sp
\fB[eventlistener:x]\fP sections may not specify
\fBredirect_stderr\fP, \fBstdout_capture_maxbytes\fP, or
\fBstderr_capture_maxbytes\fP, but otherwise they accept the same values.
.sp
The configuration keys that influence child process logging in the
\fB[supervisord]\fP config file section are these:
\fBchildlogdir\fP, and \fBnocleanup\fP\&.
.SS Capture Mode
.sp
Capture mode is an advanced feature of Supervisor.  You needn\(aqt
understand capture mode unless you want to take actions based on data
parsed from subprocess output.
.sp
If a \fB[program:x]\fP section in the configuration file defines a
non\-zero \fBstdout_capture_maxbytes\fP or \fBstderr_capture_maxbytes\fP
parameter, each process represented by the program section may emit
special tokens on its stdout or stderr stream (respectively) which
will effectively cause supervisor to emit a \fBPROCESS_COMMUNICATION\fP
event (see events for a description of events).
.sp
The process communications protocol relies on two tags, one which
commands supervisor to enter "capture mode" for the stream and one
which commands it to exit.  When a process stream enters "capture
mode", data sent to the stream will be sent to a separate buffer in
memory, the "capture buffer", which is allowed to contain a maximum of
\fBcapture_maxbytes\fP bytes.  During capture mode, when the buffer\(aqs
length exceeds \fBcapture_maxbytes\fP bytes, the earliest data in the
buffer is discarded to make room for new data.  When a process stream
exits capture mode, a \fBPROCESS_COMMUNICATION\fP event subtype is
emitted by supervisor, which may be intercepted by event listeners.
.sp
The tag to begin "capture mode" in a process stream is
\fB<!\-\-XSUPERVISOR:BEGIN\-\->\fP\&.  The tag to exit capture mode is
\fB<!\-\-XSUPERVISOR:END\-\->\fP\&.  The data between these tags may be
arbitrary, and forms the payload of the \fBPROCESS_COMMUNICATION\fP
event.  For example, if a program is set up with a
\fBstdout_capture_maxbytes\fP of "1MB", and it emits the following on
its stdout stream:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
<!\-\-XSUPERVISOR:BEGIN\-\->Hello!<!\-\-XSUPERVISOR:END\-\->
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
In this circumstance, \fBsupervisord\fP will emit a
\fBPROCESS_COMMUNICATIONS_STDOUT\fP event with data in the payload of
"Hello!".
.sp
An example of a script (written in Python) which emits a process
communication event is in the \fBscripts\fP directory of the
supervisor package, named \fBsample_commevent.py\fP\&.
.sp
The output of processes specified as "event listeners"
(\fB[eventlistener:x]\fP sections) is not processed this way.
Output from these processes cannot enter capture mode.
.SS Extending Supervisor\(aqs XML\-RPC API
.sp
Supervisor can be extended with new XML\-RPC APIs.  Several third\-party
plugins already exist that can be wired into your Supervisor
configuration.  You may additionally write your own.  Extensible
XML\-RPC interfaces is an advanced feature, introduced in version 3.0.
You needn\(aqt understand it unless you wish to use an existing
third\-party RPC interface plugin or if you wish to write your own RPC
interface plugin.
.SS Configuring XML\-RPC Interface Factories
.sp
An additional RPC interface is configured into a supervisor
installation by adding a \fB[rpcinterface:x]\fP section in the
Supervisor configuration file.
.sp
In the sample config file, there is a section which is named
\fB[rpcinterface:supervisor]\fP\&.  By default it looks like this:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This section \fImust\fP remain in the configuration for the standard setup
of supervisor to work properly.  If you don\(aqt want supervisor to do
anything it doesn\(aqt already do out of the box, this is all you need to
know about this type of section.
.sp
However, if you wish to add additional XML\-RPC interface namespaces to
a configuration of supervisor, you may add additional
\fB[rpcinterface:foo]\fP sections, where "foo" represents the namespace
of the interface (from the web root), and the value named by
\fBsupervisor.rpcinterface_factory\fP is a factory callable written in
Python which should have a function signature that accepts a single
positional argument \fBsupervisord\fP and as many keyword arguments as
required to perform configuration.  Any key/value pairs defined within
the \fBrpcinterface:foo\fP section will be passed as keyword arguments
to the factory.  Here\(aqs an example of a factory function, created in
the package \fBmy.package\fP\&.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
def make_another_rpcinterface(supervisord, **config):
    retries = int(config.get(\(aqretries\(aq, 0))
    another_rpc_interface = AnotherRPCInterface(supervisord, retries)
    return another_rpc_interface
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
And a section in the config file meant to configure it.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
[rpcinterface:another]
supervisor.rpcinterface_factory = my.package:make_another_rpcinterface
retries = 1
.ft P
.fi
.UNINDENT
.UNINDENT
.SS Glossary
.INDENT 0.0
.TP
.B daemontools
A \fI\%process control system by D.J. Bernstein\fP\&.
.TP
.B launchd
A \fI\%process control system used by Apple\fP as process 1 under Mac
OS X.
.TP
.B runit
A \fI\%process control system\fP\&.
.TP
.B Superlance
A package which provides various event listener implementations
that plug into Supervisor which can help monitor process memory
usage and crash status: \fI\%http://pypi.python.org/pypi/superlance\fP\&.
.TP
.B umask
Abbreviation of \fIuser mask\fP: sets the file mode creation mask of
the current process.  See \fI\%http://en.wikipedia.org/wiki/Umask\fP\&.
.UNINDENT
.SH API DOCUMENTATION
.SS XML\-RPC API Documentation
.sp
To use the XML\-RPC interface, connect to supervisor\(aqs HTTP port
with any XML\-RPC client library and run commands against it.  An
example of doing this using Python\(aqs \fBxmlrpclib\fP client library
is as follows.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
import xmlrpclib
server = xmlrpclib.Server(\(aqhttp://localhost:9001/RPC2\(aq)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
You may call methods against \fBsupervisord\fP and its
subprocesses by using the \fBsupervisor\fP namespace.  An example is
provided below.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
server.supervisor.getState()
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
You can get a list of methods supported by the
\fBsupervisord\fP XML\-RPC interface by using the XML\-RPC
\fBsystem.listMethods\fP API:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
server.system.listMethods()
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
You can see help on a method by using the \fBsystem.methodHelp\fP API
against the method:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
server.system.methodHelp(\(aqsupervisor.shutdown\(aq)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The \fBsupervisord\fP XML\-RPC interface also supports the
\fI\%XML\-RPC multicall API\fP\&.
.sp
You can extend \fBsupervisord\fP functionality with new XML\-RPC
API methods by adding new top\-level RPC interfaces as necessary.
See rpcinterface_factories\&.
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
Any XML\-RPC method call may result in a fault response.  This includes errors caused
by the client such as bad arguments, and any errors that make \fBsupervisord\fP
unable to fulfill the request.  Many XML\-RPC client programs will raise an exception
when a fault response is encountered.
.UNINDENT
.UNINDENT
.SS Status and Control
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.TP
.B class supervisor.rpcinterface.SupervisorNamespaceRPCInterface(supervisord)
.INDENT 7.0
.TP
.B getAPIVersion()
Return the version of the RPC API used by supervisord
.sp
@return string version version id
.sp
This API is versioned separately from Supervisor itself. The API version
returned by \fBgetAPIVersion\fP only changes when the API changes. Its purpose
is to help the client identify with which version of the Supervisor API it
is communicating.
.sp
When writing software that communicates with this API, it is highly
recommended that you first test the API version for compatibility before
making method calls.
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
The \fBgetAPIVersion\fP method replaces \fBgetVersion\fP found in Supervisor
versions prior to 3.0a1. It is aliased for compatibility but getVersion()
is deprecated and support will be dropped from Supervisor in a future
version.
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 7.0
.TP
.B getSupervisorVersion()
Return the version of the supervisor package in use by supervisord
.sp
@return string version version id
.UNINDENT
.INDENT 7.0
.TP
.B getIdentification()
Return identifiying string of supervisord
.sp
@return string identifier identifying string
.sp
This method allows the client to identify with which Supervisor
instance it is communicating in the case of environments where
multiple Supervisors may be running.
.sp
The identification is a string that must be set in Supervisor’s
configuration file. This method simply returns that value back to the
client.
.UNINDENT
.INDENT 7.0
.TP
.B getState()
Return current state of supervisord as a struct
.sp
@return struct A struct with keys int statecode, string statename
.sp
This is an internal value maintained by Supervisor that determines what
Supervisor believes to be its current operational state.
.sp
Some method calls can alter the current state of the Supervisor. For
example, calling the method supervisor.shutdown() while the station is
in the RUNNING state places the Supervisor in the SHUTDOWN state while
it is shutting down.
.sp
The supervisor.getState() method provides a means for the client to check
Supervisor\(aqs state, both for informational purposes and to ensure that the
methods it intends to call will be permitted.
.sp
The return value is a struct:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
{\(aqstatecode\(aq: 1,
 \(aqstatename\(aq: \(aqRUNNING\(aq}
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The possible return values are:
.TS
center;
|l|l|l|.
_
T{
statecode
T}	T{
statename
T}	T{
Description
T}
_
T{
2
T}	T{
FATAL
T}	T{
Supervisor has experienced a serious error.
T}
_
T{
1
T}	T{
RUNNING
T}	T{
Supervisor is working normally.
T}
_
T{
0
T}	T{
RESTARTING
T}	T{
Supervisor is in the process of restarting.
T}
_
T{
\-1
T}	T{
SHUTDOWN
T}	T{
Supervisor is in the process of shutting down.
T}
_
.TE
.sp
The \fBFATAL\fP state reports unrecoverable errors, such as internal
errors inside Supervisor or system runaway conditions. Once set to
\fBFATAL\fP, the Supervisor can never return to any other state without
being restarted.
.sp
In the \fBFATAL\fP state, all future methods except
supervisor.shutdown() and supervisor.restart() will automatically fail
without being called and the fault \fBFATAL_STATE\fP will be raised.
.sp
In the \fBSHUTDOWN\fP or \fBRESTARTING\fP states, all method calls are
ignored and their possible return values are undefined.
.UNINDENT
.INDENT 7.0
.TP
.B getPID()
Return the PID of supervisord
.sp
@return int PID
.UNINDENT
.INDENT 7.0
.TP
.B readLog(offset, length)
Read length bytes from the main log starting at offset
.sp
@param int offset         offset to start reading from.
@param int length         number of bytes to read from the log.
@return string result     Bytes of log
.sp
It can either return the entire log, a number of characters from the
tail of the log, or a slice of the log specified by the offset and
length parameters:
.TS
center;
|l|l|l|.
_
T{
Offset
T}	T{
Length
T}	T{
Behavior of \fBreadProcessLog\fP
T}
_
T{
Negative
T}	T{
Not Zero
T}	T{
Bad arguments. This will raise the fault
\fBBAD_ARGUMENTS\fP\&.
T}
_
T{
Negative
T}	T{
Zero
T}	T{
This will return the tail of the log, or offset
number of characters from the end of the log.
For example, if \fBoffset\fP = \-4 and \fBlength\fP
= 0, then the last four characters will be
returned from the end of the log.
T}
_
T{
Zero or
Positive
T}	T{
Negative
T}	T{
Bad arguments. This will raise the fault
\fBBAD_ARGUMENTS\fP\&.
T}
_
T{
Zero or
Positive
T}	T{
Zero
T}	T{
All characters will be returned from the
\fBoffset\fP specified.
T}
_
T{
Zero or
Positive
T}	T{
Positive
T}	T{
A number of characters length will be returned
from the \fBoffset\fP\&.
T}
_
.TE
.sp
If the log is empty and the entire log is requested, an empty string
is returned.
.sp
If either offset or length is out of range, the fault
\fBBAD_ARGUMENTS\fP will be returned.
.sp
If the log cannot be read, this method will raise either the
\fBNO_FILE\fP error if the file does not exist or the \fBFAILED\fP error
if any other problem was encountered.
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
The readLog() method replaces readMainLog() found in Supervisor
versions prior to 2.1. It is aliased for compatibility but
readMainLog() is deprecated and support will be dropped from
Supervisor in a future version.
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 7.0
.TP
.B clearLog()
Clear the main log.
.sp
@return boolean result always returns True unless error
.sp
If the log cannot be cleared because the log file does not exist, the
fault \fBNO_FILE\fP will be raised. If the log cannot be cleared for any
other reason, the fault \fBFAILED\fP will be raised.
.UNINDENT
.INDENT 7.0
.TP
.B shutdown()
Shut down the supervisor process
.sp
@return boolean result always returns True unless error
.sp
This method shuts down the Supervisor daemon. If any processes are running,
they are automatically killed without warning.
.sp
Unlike most other methods, if Supervisor is in the \fBFATAL\fP state,
this method will still function.
.UNINDENT
.INDENT 7.0
.TP
.B restart()
Restart the supervisor process
.sp
@return boolean result  always return True unless error
.sp
This method soft restarts the Supervisor daemon. If any processes are
running, they are automatically killed without warning. Note that the
actual UNIX process for Supervisor cannot restart; only Supervisor’s
main program loop. This has the effect of resetting the internal
states of Supervisor.
.sp
Unlike most other methods, if Supervisor is in the \fBFATAL\fP state,
this method will still function.
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.SS Process Control
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.TP
.B class supervisor.rpcinterface.SupervisorNamespaceRPCInterface(supervisord)
.INDENT 7.0
.TP
.B getProcessInfo(name)
Get info about a process named name
.sp
@param string name The name of the process (or \(aqgroup:name\(aq)
@return struct result     A structure containing data about the process
.sp
The return value is a struct:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
{\(aqname\(aq:           \(aqprocess name\(aq,
 \(aqgroup\(aq:          \(aqgroup name\(aq,
 \(aqdescription\(aq:    \(aqpid 18806, uptime 0:03:12\(aq
 \(aqstart\(aq:          1200361776,
 \(aqstop\(aq:           0,
 \(aqnow\(aq:            1200361812,
 \(aqstate\(aq:          1,
 \(aqstatename\(aq:      \(aqRUNNING\(aq,
 \(aqspawnerr\(aq:       \(aq\(aq,
 \(aqexitstatus\(aq:     0,
 \(aqlogfile\(aq:        \(aq/path/to/stdout\-log\(aq, # deprecated, b/c only
 \(aqstdout_logfile\(aq: \(aq/path/to/stdout\-log\(aq,
 \(aqstderr_logfile\(aq: \(aq/path/to/stderr\-log\(aq,
 \(aqpid\(aq:            1}
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 7.0
.TP
.B name
Name of the process
.UNINDENT
.INDENT 7.0
.TP
.B group
Name of the process\(aq group
.UNINDENT
.INDENT 7.0
.TP
.B description
If process state is running description\(aqs value is process_id
and uptime. Example "pid 18806, uptime 0:03:12 ".
If process state is stopped description\(aqs value is stop time.
Example:"Jun 5 03:16 PM ".
.UNINDENT
.INDENT 7.0
.TP
.B start
UNIX timestamp of when the process was started
.UNINDENT
.INDENT 7.0
.TP
.B stop
UNIX timestamp of when the process last ended, or 0 if the process
has never been stopped.
.UNINDENT
.INDENT 7.0
.TP
.B now
UNIX timestamp of the current time, which can be used to calculate
process up\-time.
.UNINDENT
.INDENT 7.0
.TP
.B state
State code, see process_states\&.
.UNINDENT
.INDENT 7.0
.TP
.B statename
String description of \fIstate\fP, see process_states\&.
.UNINDENT
.INDENT 7.0
.TP
.B logfile
Deprecated alias for \fBstdout_logfile\fP\&.  This is provided only
for compatibility with clients written for Supervisor 2.x and
may be removed in the future.  Use \fBstdout_logfile\fP instead.
.UNINDENT
.INDENT 7.0
.TP
.B stdout_logfile
Absolute path and filename to the STDOUT logfile
.UNINDENT
.INDENT 7.0
.TP
.B stderr_logfile
Absolute path and filename to the STDOUT logfile
.UNINDENT
.INDENT 7.0
.TP
.B spawnerr
Description of error that occurred during spawn, or empty string
if none.
.UNINDENT
.INDENT 7.0
.TP
.B exitstatus
Exit status (errorlevel) of process, or 0 if the process is still
running.
.UNINDENT
.INDENT 7.0
.TP
.B pid
UNIX process ID (PID) of the process, or 0 if the process is not
running.
.UNINDENT
.UNINDENT
.INDENT 7.0
.TP
.B getAllProcessInfo()
Get info about all processes
.sp
@return array result  An array of process status results
.sp
Each element contains a struct, and this struct contains the exact
same elements as the struct returned by \fBgetProcessInfo\fP\&. If the process
table is empty, an empty array is returned.
.UNINDENT
.INDENT 7.0
.TP
.B startProcess(name, wait=True)
Start a process
.sp
@param string name Process name (or \fBgroup:name\fP, or \fBgroup:*\fP)
@param boolean wait Wait for process to be fully started
@return boolean result     Always true unless error
.UNINDENT
.INDENT 7.0
.TP
.B startAllProcesses(wait=True)
Start all processes listed in the configuration file
.sp
@param boolean wait    Wait for each process to be fully started
@return array result   An array of process status info structs
.UNINDENT
.INDENT 7.0
.TP
.B startProcessGroup(name, wait=True)
Start all processes in the group named \(aqname\(aq
.sp
@param string name     The group name
@param boolean wait    Wait for each process to be fully started
@return array result   An array of process status info structs
.UNINDENT
.INDENT 7.0
.TP
.B stopProcess(name, wait=True)
Stop a process named by name
.sp
@param string name  The name of the process to stop (or \(aqgroup:name\(aq)
@param boolean wait        Wait for the process to be fully stopped
@return boolean result     Always return True unless error
.UNINDENT
.INDENT 7.0
.TP
.B stopProcessGroup(name, wait=True)
Stop all processes in the process group named \(aqname\(aq
.sp
@param string name     The group name
@param boolean wait    Wait for each process to be fully stopped
@return array result   An array of process status info structs
.UNINDENT
.INDENT 7.0
.TP
.B stopAllProcesses(wait=True)
Stop all processes in the process list
.sp
@param  boolean wait   Wait for each process to be fully stopped
@return array result   An array of process status info structs
.UNINDENT
.INDENT 7.0
.TP
.B sendProcessStdin(name, chars)
Send a string of chars to the stdin of the process name.
If non\-7\-bit data is sent (unicode), it is encoded to utf\-8
before being sent to the process\(aq stdin.  If chars is not a
string or is not unicode, raise INCORRECT_PARAMETERS.  If the
process is not running, raise NOT_RUNNING.  If the process\(aq
stdin cannot accept input (e.g. it was closed by the child
process), raise NO_FILE.
.sp
@param string name        The process name to send to (or \(aqgroup:name\(aq)
@param string chars       The character data to send to the process
@return boolean result    Always return True unless error
.UNINDENT
.INDENT 7.0
.TP
.B sendRemoteCommEvent(type, data)
Send an event that will be received by event listener
subprocesses subscribing to the RemoteCommunicationEvent.
.sp
@param  string  type  String for the "type" key in the event header
@param  string  data  Data for the event body
@return boolean       Always return True unless error
.UNINDENT
.INDENT 7.0
.TP
.B reloadConfig()
Reload configuration
.sp
@return boolean result  always return True unless error
.UNINDENT
.INDENT 7.0
.TP
.B addProcessGroup(name)
Update the config for a running process from config file.
.sp
@param string name         name of process group to add
@return boolean result     true if successful
.UNINDENT
.INDENT 7.0
.TP
.B removeProcessGroup(name)
Remove a stopped process from the active configuration.
.sp
@param string name         name of process group to remove
@return boolean result     Indicates whether the removal was successful
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.SS Process Logging
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.TP
.B class supervisor.rpcinterface.SupervisorNamespaceRPCInterface(supervisord)
.INDENT 7.0
.TP
.B readProcessStdoutLog(name, offset, length)
Read length bytes from name\(aqs stdout log starting at offset
.sp
@param string name        the name of the process (or \(aqgroup:name\(aq)
@param int offset         offset to start reading from.
@param int length         number of bytes to read from the log.
@return string result     Bytes of log
.UNINDENT
.INDENT 7.0
.TP
.B readProcessStderrLog(name, offset, length)
Read length bytes from name\(aqs stderr log starting at offset
.sp
@param string name        the name of the process (or \(aqgroup:name\(aq)
@param int offset         offset to start reading from.
@param int length         number of bytes to read from the log.
@return string result     Bytes of log
.UNINDENT
.INDENT 7.0
.TP
.B tailProcessStdoutLog(name, offset, length)
Provides a more efficient way to tail the (stdout) log than
readProcessStdoutLog().  Use readProcessStdoutLog() to read
chunks and tailProcessStdoutLog() to tail.
.sp
Requests (length) bytes from the (name)\(aqs log, starting at
(offset).  If the total log size is greater than (offset +
length), the overflow flag is set and the (offset) is
automatically increased to position the buffer at the end of
the log.  If less than (length) bytes are available, the
maximum number of available bytes will be returned.  (offset)
returned is always the last offset in the log +1.
.sp
@param string name         the name of the process (or \(aqgroup:name\(aq)
@param int offset          offset to start reading from
@param int length          maximum number of bytes to return
@return array result       [string bytes, int offset, bool overflow]
.UNINDENT
.INDENT 7.0
.TP
.B tailProcessStderrLog(name, offset, length)
Provides a more efficient way to tail the (stderr) log than
readProcessStderrLog().  Use readProcessStderrLog() to read
chunks and tailProcessStderrLog() to tail.
.sp
Requests (length) bytes from the (name)\(aqs log, starting at
(offset).  If the total log size is greater than (offset +
length), the overflow flag is set and the (offset) is
automatically increased to position the buffer at the end of
the log.  If less than (length) bytes are available, the
maximum number of available bytes will be returned.  (offset)
returned is always the last offset in the log +1.
.sp
@param string name         the name of the process (or \(aqgroup:name\(aq)
@param int offset          offset to start reading from
@param int length          maximum number of bytes to return
@return array result       [string bytes, int offset, bool overflow]
.UNINDENT
.INDENT 7.0
.TP
.B clearProcessLogs(name)
Clear the stdout and stderr logs for the named process and
reopen them.
.sp
@param string name   The name of the process (or \(aqgroup:name\(aq)
@return boolean result      Always True unless error
.UNINDENT
.INDENT 7.0
.TP
.B clearAllProcessLogs()
Clear all process log files
.sp
@return array result   An array of process status info structs
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.SS System Methods
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.TP
.B class supervisor.xmlrpc.SystemNamespaceRPCInterface(namespaces)
.INDENT 7.0
.TP
.B listMethods()
Return an array listing the available method names
.sp
@return array result  An array of method names available (strings).
.UNINDENT
.INDENT 7.0
.TP
.B methodHelp(name)
Return a string showing the method\(aqs documentation
.sp
@param string name   The name of the method.
@return string result The documentation for the method name.
.UNINDENT
.INDENT 7.0
.TP
.B methodSignature(name)
Return an array describing the method signature in the
form [rtype, ptype, ptype...] where rtype is the return data type
of the method, and ptypes are the parameter data types that the
method accepts in method argument order.
.sp
@param string name  The name of the method.
@return array result  The result.
.UNINDENT
.INDENT 7.0
.TP
.B multicall(calls)
Process an array of calls, and return an array of
results. Calls should be structs of the form {\(aqmethodName\(aq:
string, \(aqparams\(aq: array}. Each result will either be a
single\-item array containing the result value, or a struct of
the form {\(aqfaultCode\(aq: int, \(aqfaultString\(aq: string}. This is
useful when you need to make lots of small calls without lots
of round trips.
.sp
@param array calls  An array of call requests
@return array result  An array of results
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.SH PLUGINS
.SH INDICES AND TABLES
.INDENT 0.0
.IP \(bu 2
genindex
.IP \(bu 2
modindex
.IP \(bu 2
search
.UNINDENT
.SH AUTHOR
This man page was created by Orestis Ioannou <orestis@oioannou.com> using the
official documentation.
.SH COPYRIGHT
2004-2015, Agendaless Consulting and Contributors
.\" Generated by docutils manpage writer.
.