{"id":5748,"date":"2017-04-24T11:18:33","date_gmt":"2017-04-24T03:18:33","guid":{"rendered":"https:\/\/sdeno.com\/?p=5748"},"modified":"2022-09-08T14:04:02","modified_gmt":"2022-09-08T06:04:02","slug":"centos-6-x%e8%bf%9b%e7%a8%8b%e5%ae%88%e6%8a%a4%e8%80%85supervisor","status":"publish","type":"post","link":"https:\/\/sdeno.com\/?p=5748","title":{"rendered":"centos 6.x\u8fdb\u7a0b\u5b88\u62a4\u8005supervisor"},"content":{"rendered":"<p>1,\u4e0b\u8f7d\u5b89\u88c5<\/p>\n<p><a href=\"https:\/\/pan.baidu.com\/s\/1kVbpHqv\" target=\"_blank\" rel=\"noopener\">supervisor-3.2.0.tar.gz\u4e0b\u8f7d https:\/\/pan.baidu.com\/s\/1kVbpHqv<\/a><\/p>\n<pre>tar zxf supervisor-3.2.0.tar.gz\r\ncd supervisor-3.2.0\r\npython\u00a0setup.py\u00a0install<\/pre>\n<p>&nbsp;<\/p>\n<p><strong style=\"color: #111111;\">\u6d4b\u8bd5\u5b89\u88c5\u662f\u5426\u6210\u529f<\/strong><span style=\"color: #111111;\">\uff1aecho_supervisord_conf\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>\u5982\u679c\u62a5\u7c7b\u4f3c\u8fd9\u6837\u7684\u9519\uff1a<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">No local packages or download links found for meld3&gt;=0.6.5\r\nerror: Could not find suitable distribution for Requirement.parse('meld3&gt;=0.6.5')<\/pre>\n<p>&nbsp;<\/p>\n<p>\u89e3\u51b3\uff1a<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\u4e0b\u8f7dmeld3\u90e8\u7f72\u5305\uff1awget https:\/\/pypi.python.org\/packages\/source\/m\/meld3\/meld3-1.0.2.tar.gz\r\n\u89e3\u538b\uff1atar -xvf meld3-1.0.2.tar.gz\r\n\u8fdb\u5165\u89e3\u538b\u5305\uff1acd meld3-1.0.1.tar.gz\r\n\u5f00\u59cb\u5b89\u88c5\uff1apython setup.py install\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">\u521b\u5efa\u9ed8\u8ba4\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u4e3anginx\u521b\u5efa\u8fdb\u7a0b\u5b88\u62a4\u6848\u4f8b\uff1a<\/span><\/p>\n<pre style=\"color: #000000;\">echo_supervisord_conf &gt;\/etc\/supervisord.conf\r\n<span style=\"color: #0000ff;\">vi<\/span> \/etc\/supervisord.conf<\/pre>\n<pre>; Sample supervisor config file.\r\n;\r\n; For more information on the config file, please see:\r\n; http:\/\/supervisord.org\/configuration.html\r\n;\r\n; Notes:\r\n; - Shell expansion (\"~\" or \"$HOME\") is not supported. Environment\r\n; variables can be expanded using this syntax: \"%(ENV_HOME)s\".\r\n; - Comments must have a leading space: \"a=b ;comment\" not \"a=b;comment\".\r\n\r\n;[unix_http_server]\r\n;file=\/tmp\/supervisor.sock ; (the path to the socket file)\r\n;chmod=0700 ; socket file mode (default 0700)\r\n;chown=nobody:nogroup ; socket file uid:gid owner\r\n;username=user ; (default is no username (open server))\r\n;password=123 ; (default is no password (open server))\r\n\r\n[inet_http_server] ; inet (TCP) server disabled by default\r\nport=127.0.0.1:8888 ; (ip_address:port specifier, *:port for all iface)\r\nusername=user ; (default is no username (open server))\r\npassword=123 ; (default is no password (open server))\r\n\r\n[supervisord]\r\nlogfile=\/tmp\/supervisord.log ; (main log file;default $CWD\/supervisord.log)\r\nlogfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)\r\nlogfile_backups=10 ; (num of main logfile rotation backups;default 10)\r\nloglevel=info ; (log level;default info; others: debug,warn,trace)\r\npidfile=\/tmp\/supervisord.pid ; (supervisord pidfile;default supervisord.pid)\r\nnodaemon=false ; (start in foreground if true;default false)\r\nminfds=1024 ; (min. avail startup file descriptors;default 1024)\r\nminprocs=200 ; (min. avail process descriptors;default 200)\r\n;umask=022 ; (process file creation umask;default 022)\r\n;user=chrism ; (default is current user, required if root)\r\n;identifier=supervisor ; (supervisord identifier, default is 'supervisor')\r\n;directory=\/tmp ; (default is not to cd during start)\r\n;nocleanup=true ; (don't clean up tempfiles at start;default false)\r\n;childlogdir=\/tmp ; ('AUTO' child log dir, default $TEMP)\r\n;environment=KEY=\"value\" ; (key value pairs to add to environment)\r\n;strip_ansi=false ; (strip ansi escape codes in logs; def. false)\r\n\r\n; the below section must remain in the config file for RPC\r\n; (supervisorctl\/web interface) to work, additional interfaces may be\r\n; added by defining them in separate rpcinterface: sections\r\n[rpcinterface:supervisor]\r\nsupervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface\r\n\r\n[supervisorctl]\r\nserverurl=unix:\/\/\/tmp\/supervisor.sock ; use a unix:\/\/ URL for a unix socket\r\n;serverurl=http:\/\/127.0.0.1:9001 ; use an http:\/\/ url to specify an inet socket\r\n;username=chris ; should be same as http_username if set\r\n;password=123 ; should be same as http_password if set\r\n;prompt=mysupervisor ; cmd line prompt (default \"supervisor\")\r\n;history_file=~\/.sc_history ; use readline history if available\r\n\r\n; The below sample program section shows all possible program subsection values,\r\n; create one or more 'real' program: sections to be able to control them under\r\n; supervisor.\r\n\r\n;[program:theprogramname]\r\n;command=\/bin\/cat ; the program (relative uses PATH, can take args)\r\n;process_name=%(program_name)s ; process_name expr (default %(program_name)s)\r\n;numprocs=1 ; number of processes copies to start (def 1)\r\n;directory=\/tmp ; directory to cwd to before exec (def no cwd)\r\n;umask=022 ; umask for process (default None)\r\n;priority=999 ; the relative start priority (default 999)\r\n;autostart=true ; start at supervisord start (default: true)\r\n;startsecs=1 ; # of secs prog must stay up to be running (def. 1)\r\n;startretries=3 ; max # of serial start failures when starting (default 3)\r\n;autorestart=unexpected ; when to restart if exited after running (def: unexpected)\r\n;exitcodes=0,2 ; 'expected' exit codes used with autorestart (default 0,2)\r\n;stopsignal=QUIT ; signal used to kill process (default TERM)\r\n;stopwaitsecs=10 ; max num secs to wait b4 SIGKILL (default 10)\r\n;stopasgroup=false ; send stop signal to the UNIX process group (default false)\r\n;killasgroup=false ; SIGKILL the UNIX process group (def false)\r\n;user=chrism ; setuid to this UNIX account to run the program\r\n;redirect_stderr=true ; redirect proc stderr to stdout (default false)\r\n;stdout_logfile=\/a\/path ; stdout log path, NONE for none; default AUTO\r\n;stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB)\r\n;stdout_logfile_backups=10 ; # of stdout logfile backups (default 10)\r\n;stdout_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0)\r\n;stdout_events_enabled=false ; emit events on stdout writes (default false)\r\n;stderr_logfile=\/a\/path ; stderr log path, NONE for none; default AUTO\r\n;stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB)\r\n;stderr_logfile_backups=10 ; # of stderr logfile backups (default 10)\r\n;stderr_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0)\r\n;stderr_events_enabled=false ; emit events on stderr writes (default false)\r\n;environment=A=\"1\",B=\"2\" ; process environment additions (def no adds)\r\n;serverurl=AUTO ; override serverurl computation (childutils)\r\n\r\n; The below sample eventlistener section shows all possible\r\n; eventlistener subsection values, create one or more 'real'\r\n; eventlistener: sections to be able to handle event notifications\r\n; sent by supervisor.\r\n\r\n;[eventlistener:theeventlistenername]\r\n;command=\/bin\/eventlistener ; the program (relative uses PATH, can take args)\r\n;process_name=%(program_name)s ; process_name expr (default %(program_name)s)\r\n;numprocs=1 ; number of processes copies to start (def 1)\r\n;events=EVENT ; event notif. types to subscribe to (req'd)\r\n;buffer_size=10 ; event buffer queue size (default 10)\r\n;directory=\/tmp ; directory to cwd to before exec (def no cwd)\r\n;umask=022 ; umask for process (default None)\r\n;priority=-1 ; the relative start priority (default -1)\r\n;autostart=true ; start at supervisord start (default: true)\r\n;startsecs=1 ; # of secs prog must stay up to be running (def. 1)\r\n;startretries=3 ; max # of serial start failures when starting (default 3)\r\n;autorestart=unexpected ; autorestart if exited after running (def: unexpected)\r\n;exitcodes=0,2 ; 'expected' exit codes used with autorestart (default 0,2)\r\n;stopsignal=QUIT ; signal used to kill process (default TERM)\r\n;stopwaitsecs=10 ; max num secs to wait b4 SIGKILL (default 10)\r\n;stopasgroup=false ; send stop signal to the UNIX process group (default false)\r\n;killasgroup=false ; SIGKILL the UNIX process group (def false)\r\n;user=chrism ; setuid to this UNIX account to run the program\r\n;redirect_stderr=false ; redirect_stderr=true is not allowed for eventlisteners\r\n;stdout_logfile=\/a\/path ; stdout log path, NONE for none; default AUTO\r\n;stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB)\r\n;stdout_logfile_backups=10 ; # of stdout logfile backups (default 10)\r\n;stdout_events_enabled=false ; emit events on stdout writes (default false)\r\n;stderr_logfile=\/a\/path ; stderr log path, NONE for none; default AUTO\r\n;stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB)\r\n;stderr_logfile_backups=10 ; # of stderr logfile backups (default 10)\r\n;stderr_events_enabled=false ; emit events on stderr writes (default false)\r\n;environment=A=\"1\",B=\"2\" ; process environment additions\r\n;serverurl=AUTO ; override serverurl computation (childutils)\r\n\r\n; The below sample group section shows all possible group values,\r\n; create one or more 'real' group: sections to create \"heterogeneous\"\r\n; process groups.\r\n\r\n;[group:thegroupname]\r\n;programs=progname1,progname2 ; each refers to 'x' in [program:x] definitions\r\n;priority=999 ; the relative start priority (default 999)\r\n\r\n; The [include] section can just contain the \"files\" setting. This\r\n; setting can list multiple files (separated by whitespace or\r\n; newlines). It can also contain wildcards. The filenames are\r\n; interpreted as relative to this file. Included files *cannot*\r\n; include files themselves.\r\n\r\n;[include]\r\n;files = relative\/directory\/*.ini\r\n\r\n\r\n\r\n[program:Nginx]\r\ncommand=\/usr\/local\/nginx\/sbin\/nginx\r\ndirectory=\/usr\/local\/nginx\/\r\nautostart=true\r\nautorestart=true\r\nstderr_logfile=\/usr\/local\/nginx\/logs\/nginx.err.log\r\nstdout_logfile=\/usr\/local\/nginx\/logs\/nginx.out.log\r\nuser=root\r\nstopsignal=INT\r\n\r\n[program:Frps]\r\ncommand=\/etc\/init.d\/frps start\r\ncommand=sleep 3\r\nautostart=true\r\nautorestart=true\r\n\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u542f\u52a8<\/p>\n<pre style=\"color: #000000;\">supervisord -c \/etc\/supervisord.conf<\/pre>\n<p>&nbsp;<\/p>\n<p>\u5173\u95ed\u8fdb\u7a0b<\/p>\n<pre style=\"color: #242729;\"><code>ps -ef | grep supervisord\r\n<\/code><\/pre>\n<pre><code>root   <span style=\"color: #ff0000;\">2503<\/span>  1  0 Nov19 ?  00:03:23 \/usr\/bin\/python \/usr\/bin\/supervisord\r\nroot   21337 2556  0 18:15 pts\/8   00:00:00 grep --color=auto supervisord<\/code><\/pre>\n<pre><code>kill -s SIGTERM <span style=\"color: #ff0000;\">2503  <\/span><\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u67e5\u770b\u72b6\u6001supervisorctl status<\/p>\n<p>\u542f\u52a8\u5168\u90e8supervisorctl start all<\/p>\n<p>\u505c\u6b62\u5168\u90e8supervisorctl stop all<\/p>\n<p>&nbsp;<\/p>\n<p style=\"color: #000000;\">.\u5f00\u542fsupervisord\u670d\u52a1<\/p>\n<p style=\"color: #000000;\">\u3000\u3000# supervisord -c \/etc\/supervisord.conf<\/p>\n<p style=\"color: #000000;\">\u3000\u3000\u66f4\u65b0\u65b0\u7684\u914d\u7f6e\u5230supervisord<\/p>\n<p style=\"color: #000000;\">\u3000\u3000#\u00a0<span class=\"hljs-title\" style=\"color: #a31515;\">supervisorctl update<\/span><\/p>\n<p style=\"color: #000000;\"><span class=\"hljs-title\" style=\"color: #a31515;\">\u3000\u3000<\/span><\/p>\n<p style=\"color: #000000;\">\u3000\u3000\u91cd\u65b0\u542f\u52a8\u914d\u7f6e\u4e2d\u7684\u6240\u6709\u7a0b\u5e8f<\/p>\n<p style=\"color: #000000;\">\u3000\u3000#\u00a0<span class=\"hljs-title\" style=\"color: #a31515;\">supervisorctl reload<\/span><\/p>\n<p style=\"color: #000000;\"><span class=\"hljs-title\" style=\"color: #a31515;\">\u3000\u3000<\/span><\/p>\n<p style=\"color: #000000;\">\u3000\u3000\u542f\u52a8\u67d0\u4e2a\u8fdb\u7a0b(program_name=\u4f60\u914d\u7f6e\u4e2d\u5199\u7684\u7a0b\u5e8f\u540d\u79f0)<\/p>\n<p style=\"color: #000000;\">\u3000\u3000#\u00a0<span class=\"hljs-title\" style=\"color: #a31515;\">supervisorctl start program_name<\/span><\/p>\n<p style=\"color: #000000;\">\u3000\u3000\u67e5\u770b\u6b63\u5728\u5b88\u5019\u7684\u8fdb\u7a0b<\/p>\n<p style=\"color: #000000;\">\u3000\u3000#\u00a0<span class=\"hljs-title\" style=\"color: #a31515;\">supervisorctl<\/span><\/p>\n<p style=\"color: #000000;\">\u3000\u3000\u91cd\u542f\u67d0\u4e00\u8fdb\u7a0b (program_name=\u4f60\u914d\u7f6e\u4e2d\u5199\u7684\u7a0b\u5e8f\u540d\u79f0)<\/p>\n<p style=\"color: #000000;\">\u3000\u3000#\u00a0<span class=\"hljs-title\" style=\"color: #a31515;\">supervisorctl restart program_name<\/span><\/p>\n<p style=\"color: #000000;\">\u3000\u3000\u505c\u6b62\u5168\u90e8\u8fdb\u7a0b<\/p>\n<p style=\"color: #000000;\">\u3000\u3000#\u00a0supervisorctl\u00a0<span class=\"hljs-operator\"><span class=\"hljs-keyword\" style=\"color: #0000ff;\">stop\u00a0<span class=\"hljs-keyword\">all<\/span><\/span><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/www.cnblogs.com\/gsblog\/p\/3730293.html\">http:\/\/www.cnblogs.com\/gsblog\/p\/3730293.html<\/a><\/p>\n<p><a href=\"http:\/\/www.cnblogs.com\/weiweictgu\/p\/5830397.html\" target=\"_blank\" rel=\"noopener\">http:\/\/www.cnblogs.com\/weiweictgu\/p\/5830397.html\u00a0<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u25ca<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1,\u4e0b\u8f7d\u5b89\u88c5 supervisor-3.2.0.tar.gz\u4e0b\u8f7d https:\/\/pan.baidu.com\/ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-5748","post","type-post","status-publish","format-standard","hentry","category-11"],"_links":{"self":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/5748","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5748"}],"version-history":[{"count":0,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/5748\/revisions"}],"wp:attachment":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5748"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5748"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5748"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}