{"id":413,"date":"2014-03-15T23:15:13","date_gmt":"2014-03-15T14:15:13","guid":{"rendered":"http:\/\/tech.akat.info\/?p=413"},"modified":"2014-09-16T01:13:28","modified_gmt":"2014-09-15T16:13:28","slug":"supervisor","status":"publish","type":"post","link":"https:\/\/tech.akat.info\/?p=413","title":{"rendered":"supervisor"},"content":{"rendered":"<h1>\u8a2d\u5b9a<\/h1>\n<p>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306fsupervisord.conf\u3067\u3042\u308a\u3001\u305d\u306e\u4e2d\u306b\u3044\u304f\u3064\u304b\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u304c\u5b58\u5728\u3059\u308b<\/p>\n<h2>[supervisord]\u30bb\u30af\u30b7\u30e7\u30f3<\/h2>\n<p>supervisord\u30d7\u30ed\u30bb\u30b9\u306e\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u3092\u6c7a\u5b9a\u3059\u308b<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n&#x5B;supervisord]\r\nlogfile = \/tmp\/supervisord.log # supervisord\u30d7\u30ed\u30bb\u30b9\u306e\u30ed\u30b0\u304c\u51fa\u529b\u3055\u308c\u308b\r\nlogfile_maxbytes = 50MB\r\nlogfile_backups=10 # \u30ed\u30b0\u30ed\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u306e\u30ed\u30b0\u306e\u4e16\u4ee3\u3092\u6c7a\u5b9a\u3059\u308b\r\nloglevel = info\r\npidfile = \/tmp\/supervisord.pid\r\nnodaemon = false # true\u306b\u3059\u308b\u3068\u3001\u30c7\u30fc\u30e2\u30f3\u3067\u306a\u304f\u30d5\u30a9\u30a2\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u5b9f\u884c\u3059\u308b\r\nminfds = 1024 # supervisord\u304c\u8d77\u52d5\u3059\u308b\u524d\u306b\u5fc5\u8981\u3068\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u30c7\u30a3\u30b9\u30af\u30ea\u30d7\u30bf\u6570\r\nminprocs = 200\r\numask = 022\r\nuser = chrism\r\nidentifier = supervisor\r\ndirectory = \/tmp\r\nnocleanup = true # true \u306b\u3059\u308b\u3068\u3001\u8d77\u52d5\u6642\u306b\u53e4\u3044\u5b50\u30d7\u30ed\u30bb\u30b9\u30ed\u30b0\u3092\u524a\u9664\u3057\u306a\u3044\r\nchildlogdir = \/tmp\r\nstrip_ansi = false\r\nenvironment = KEY1=&quot;value1&quot;,KEY2=&quot;value2&quot;\r\n<\/pre>\n<h2>[program:x]\u30bb\u30af\u30b7\u30e7\u30f3<\/h2>\n<p>supervisord\u304c\u5b50\u30d7\u30ed\u30bb\u30b9\u3092\u8d77\u52d5\u3057\u305f\u308a\u3001\u5236\u5fa1\u3059\u308b\u305f\u3081\u306b1\u3064\u3082\u3057\u304f\u306f\u8907\u6570\u5fc5\u8981\u306a\u30bb\u30af\u30b7\u30e7\u30f3\u3002program:foo\u306a\u3069\u30d7\u30ed\u30b0\u30e9\u30e0\u540d\u3092\u8a18\u8f09\u3059\u308b<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n&#x5B;program:cat]\r\ncommand=\/bin\/cat # \u30d7\u30ed\u30b0\u30e9\u30e0\u8d77\u52d5\u6642\u306b\u5b9f\u884c\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3002\u7d76\u5bfe\u30d1\u30b9\u3001\u3082\u3057\u304f\u306f\u76f8\u5bfe\u30d1\u30b9\u3092\u5229\u7528\u3059\u308b\r\nprocess_name=%(program_name)s # \u3053\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u52d5\u4f5c\u3059\u308b\u30d7\u30ed\u30bb\u30b9\u540d\u3092\u6c7a\u5b9a\u3059\u308b\u3002numprocs\u3092\u5909\u66f4\u3057\u306a\u3044\u5834\u5408\u306f\u7279\u306b\u6c17\u306b\u3059\u308b\u5fc5\u8981\u306f\u306a\u3044\u304c\u3001\u5909\u66f4\u3059\u308b\u5834\u5408\u306f%(process_num)s\u306a\u3069\u3092\u5165\u308c\u308b\u5fc5\u8981\u304c\u3042\u308b\r\nnumprocs=1 # \u8d77\u52d5\u6642\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u30d7\u30ed\u30bb\u30b9\u3092\u3044\u304f\u3064\u8d77\u52d5\u3055\u305b\u308b\u304b\u3092\u6c7a\u5b9a\u3059\u308b\r\ndirectory=\/tmp\r\numask=022\r\npriority=999 # start\u3068shutdown\u306e\u512a\u5148\u9806\u4f4d\u3092\u6c7a\u5b9a\u3059\u308b\u3002\u4f4e\u3044\u3068\u201cstart all\u201d\u6642\u306f\u6700\u521d\u306b\u8d77\u52d5\u3057\u3001\u201dstop all\u201d\u6642\u306b\u6700\u5f8c\u306b\u8d77\u52d5\u3059\u308b\r\nautostart=true # true\u306e\u5834\u5408\u3001supervisord\u304c\u8d77\u52d5\u3057\u305f\u3068\u304d\u306b\u81ea\u52d5\u3067\u8d77\u52d5\u3055\u308c\u308b\r\nautorestart=true # false, unexpected, true\u3092\u9078\u629e\u53ef\u80fd\u3002false\u3060\u3068\u81ea\u52d5\u3067restart\u3057\u306a\u3044\u3001unexpected\u3060\u3068exitcodes\u304c\u767a\u751f\u3057\u305f\u5834\u5408\u306b\u81ea\u52d5\u3067restart\u3059\u308b\u3001true\u306e\u5834\u5408\u306f\u7121\u6761\u4ef6\u306brestart\u3059\u308b\r\nstartsecs=10 # \u3053\u3053\u306b\u6307\u5b9a\u3057\u305f\u79d2\u6570\u3088\u308a\u65e9\u304f\u7d42\u4e86\u3057\u305f\u3089\u3001\u7d42\u4e86\u30b3\u30fc\u30c9\u306b\u304b\u304b\u308f\u3089\u305a\u8d77\u52d5\u5931\u6557\u3068\u307f\u306a\u3059\uff08\u30c7\u30d5\u30a9\u30eb\u30c8 1\uff09\r\nstartretries=3 # \u8d77\u52d5\u306b\u5931\u6557\u3057\u305f\u5834\u5408\u306b\u30ea\u30c8\u30e9\u30a4\u3059\u308b\u56de\u6570\u3001\u3053\u306e\u56de\u6570\u3092\u8d85\u3048\u308b\u3068\u30b9\u30c6\u30fc\u30bf\u30b9\u304cFATAL\u3068\u306a\u308b\r\nexitcodes=0,2 # \u6b63\u5e38\u7d42\u4e86\u3068\u307f\u306a\u3059\u7d42\u4e86\u30b3\u30fc\u30c9\r\nstopsignal=TERM # \u30d7\u30ed\u30bb\u30b9\u3092\u7d42\u4e86\u3055\u305b\u308b\u305f\u3081\u306b\u4f7f\u3046\u30b7\u30b0\u30ca\u30eb\u3002TERM,HUP,INT,QUIT,KILL,USR1,USR2\u304b\u3089\u9078\u629e\u3067\u304d\u308b\r\nstopwaitsecs=10 # \u3053\u306e\u79d2\u6570\u304c\u7d4c\u3063\u3066\u3082\u30d7\u30ed\u30bb\u30b9\u304c\u7d42\u4e86\u3057\u306a\u3044\u5834\u5408\u3001 SIGKILL \u3092\u9001\u4fe1\u3059\u308b\r\nkillasgroup=false # true \u306a\u3089\u3001 SIGKILL\u3092\u9001\u4fe1\u3059\u308b\u969b\u306b\u30d7\u30ed\u30bb\u30b9\u30b0\u30eb\u30fc\u30d7\u5168\u4f53\u306b\u9001\u4fe1\u3059\u308b\u3002Python programs\u3092\u30de\u30eb\u30c1\u30d7\u30ed\u30bb\u30b9\u3067\u5229\u7528\u3057\u3066\u3044\u308b\u3068\u304d\u306a\u3069\u306b\u5229\u7528\u3059\u308b\r\nuser=chrism # \u30d7\u30ed\u30bb\u30b9\u3092\u5b9f\u884c\u3059\u308b\u30e6\u30fc\u30b6\u30fc\uff08supervisord \u304c root \u3067\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u3068\u304d\u306e\u307f\uff09\r\nredirect_stderr=false # true\u306a\u3089\u3001\u6a19\u6e96\u30a8\u30e9\u30fc\u51fa\u529b\u3092supervisord\u306e\u6a19\u6e96\u51fa\u529b\u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3059\u308b\r\nstdout_logfile=\/a\/path\r\nstdout_logfile_maxbytes=1MB\r\nstdout_logfile_backups=10\r\nstdout_capture_maxbytes=1MB\r\nstderr_logfile=\/a\/path\r\nstderr_logfile_maxbytes=1MB\r\nstderr_logfile_backups=10\r\nstderr_capture_maxbytes=1MB\r\nenvironment=A=&quot;1&quot;,B=&quot;2&quot;\r\nserverurl=AUTO\r\nstdout_events_enabled=false # true \u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u6a19\u6e96\u51fa\u529b\u3078\u306e\u51fa\u529b\u6642\u306bPROCESS_LOG_STDOUT\u30a4\u30d9\u30f3\u30c8\u3092\u767a\u751f\u3055\u305b\u308b\r\nstderr_events_enabled=false # true \u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u6a19\u6e96\u30a8\u30e9\u30fc\u51fa\u529b\u3078\u306e\u51fa\u529b\u6642\u306bPROCESS_LOG_STDERR\u30a4\u30d9\u30f3\u30c8\u3092\u767a\u751f\u3055\u305b\u308b\r\n<\/pre>\n<h2>[group:x]\u30bb\u30af\u30b7\u30e7\u30f3<\/h2>\n<p>[program:x]\u3067\u8a2d\u5b9a\u3057\u305f\u8907\u6570\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u30921\u3064\u306e\u30b0\u30eb\u30fc\u30d7\u3068\u3057\u3066\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n&#x5B;group:foo]\r\nprograms=bar,baz # \u30ab\u30f3\u30de\u3067\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u6307\u5b9a\u3059\u308b\r\npriority=999\r\n<\/pre>\n<h2>[eventlistener:x]\u30bb\u30af\u30b7\u30e7\u30f3<\/h2>\n<p>supervisor\u306b\u306fevent listener\u30d7\u30fc\u30eb\u3068\u3044\u3046\u7279\u5225\u306a\u30d7\u30ed\u30bb\u30b9\u30b0\u30eb\u30fc\u30d7\u304c\u5b58\u5728\u3059\u308b<br \/>\n\u3053\u306e\u30d7\u30fc\u30eb\u306fsupervisor\u304b\u3089\u306e\u30a4\u30d9\u30f3\u30c8\u3092\u53d7\u53d6\u308a\u3001\u5fdc\u7b54\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b<br \/>\n\u307e\u305f[program:x]\u30bb\u30af\u30b7\u30e7\u30f3\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092stdout_capture_maxbytes,stderr_capture_maxbytes\u3092\u9664\u3044\u3066\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n&#x5B;eventlistener:theeventlistenername]\r\ncommand=\/bin\/eventlistener\r\nprocess_name=%(program_name)s_%(process_num)02d\r\nnumprocs=5\r\nevents=PROCESS_STATE # \u30a4\u30d9\u30f3\u30c8\u30bf\u30a4\u30d7\u3092\u6307\u5b9a\u3059\u308b\u3002\u8907\u6570\u6307\u5b9a\u3059\u308b\u5834\u5408\u306f\u30ab\u30f3\u30de\u533a\u5207\u308a\u3068\u3059\u308b\r\n# \u30a4\u30d9\u30f3\u30c8\u30bf\u30a4\u30d7\u306b\u3064\u3044\u3066\r\n# http:\/\/supervisord.org\/events.html#event-types\r\nbuffer_size=10 # event listener\u30d0\u30c3\u30d5\u30a1\u30b5\u30a4\u30ba\u3002\u3082\u3057\u8d85\u3048\u305f\u5834\u5408\u306f\u30d0\u30c3\u30d5\u30a1\u5185\u306e\u53e4\u3044event\u304b\u3089\u524a\u9664\u3055\u308c\u308b\r\npriority=-1\r\nautostart=true\r\nautorestart=unexpected\r\nstartsecs=1\r\nstartretries=3\r\nexitcodes=0,2\r\nstopsignal=QUIT\r\nstopwaitsecs=10\r\nuser=chrism\r\nredirect_stderr=true\r\nstdout_logfile=\/a\/path\r\nstdout_logfile_maxbytes=1MB\r\nstdout_logfile_backups=10\r\nstderr_logfile=\/a\/path\r\nstderr_logfile_maxbytes=1MB\r\nstderr_logfile_backups\r\nenvironment=A=&quot;1&quot;,B=&quot;2&quot;\r\n<\/pre>\n<h1>\u53c2\u8003<\/h1>\n<p>http:\/\/supervisord.org\/configuration.html<br \/>\nhttp:\/\/webos-goodies.jp\/archives\/deploying_tornado_with_supervisord.html<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8a2d\u5b9a \u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306fsupervisord.conf\u3067\u3042\u308a\u3001\u305d\u306e\u4e2d\u306b\u3044\u304f\u3064\u304b\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u304c\u5b58\u5728\u3059\u308b [supervisord]\u30bb\u30af\u30b7\u30e7\u30f3 supervisord\u30d7\u30ed\u30bb\u30b9\u306e\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u3092\u6c7a\u5b9a\u3059\u308b &#x5B;superv [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/413"}],"collection":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=413"}],"version-history":[{"count":10,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/413\/revisions"}],"predecessor-version":[{"id":423,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/413\/revisions\/423"}],"wp:attachment":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=413"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=413"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=413"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}