diff -Nru supervisor-4.1.0/CHANGES.rst supervisor-4.2.0/CHANGES.rst --- supervisor-4.1.0/CHANGES.rst 2019-10-19 17:26:10.000000000 +0000 +++ supervisor-4.2.0/CHANGES.rst 2020-04-30 19:27:26.000000000 +0000 @@ -1,3 +1,30 @@ +4.2.0 (2020-04-30) +------------------ + +- When ``supervisord`` is run in the foreground, a new ``--silent`` option + suppresses the main log from being echoed to ``stdout`` as it normally + would. Patch by Trevor Foster. + +- Parsing ``command=`` now supports a new expansion, ``%(numprocs)d``, that + expands to the value of ``numprocs=`` in the same section. Patch by + Santjago Corkez. + +- Web UI buttons no longer use background images. Patch by Dmytro Karpovych. + +- The Web UI now has a link to view ``tail -f stderr`` for a process in + addition to the existing ``tail -f stdout`` link. Based on a + patch by OuroborosCoding. + +- The HTTP server will now send an ``X-Accel-Buffering: no`` header in + logtail responses to fix Nginx proxy buffering. Patch by Weizhao Li. + +- When ``supervisord`` reaps an unknown PID, it will now log a description + of the ``waitpid`` status. Patch by Andrey Zelenchuk. + +- Fixed a bug introduced in 4.0.3 where ``supervisorctl tail -f foo | grep bar`` + would fail with the error ``NoneType object has no attribute 'lower'``. This + only occurred on Python 2.7 and only when piped. Patch by Slawa Pidgorny. + 4.1.0 (2019-10-19) ------------------ diff -Nru supervisor-4.1.0/debian/changelog supervisor-4.2.0/debian/changelog --- supervisor-4.1.0/debian/changelog 2019-11-01 05:32:49.000000000 +0000 +++ supervisor-4.2.0/debian/changelog 2020-05-04 17:46:58.000000000 +0000 @@ -1,3 +1,27 @@ +supervisor (4.2.0-1ubuntu1) groovy; urgency=low + + * Merge from Debian unstable. Remaining changes: + - Only build-depend on python3, not python3-all. + + -- Steve Langasek Mon, 04 May 2020 10:46:58 -0700 + +supervisor (4.2.0-1) unstable; urgency=medium + + [ Ondřej Nový ] + * Bump Standards-Version to 4.4.1. + + [ Debian Janitor ] + * Set upstream metadata fields: Repository. + + [ Samuel Henrique ] + * New upstream version 4.2.0 + * Bump DH to 13 + * Bump Standards Version to 4.5.0 + * d/control: Add Rules-Requires-Root: no + * Add gbp.conf + + -- Samuel Henrique Mon, 04 May 2020 11:59:15 +0100 + supervisor (4.1.0-1ubuntu1) focal; urgency=medium * Only build-depend on python3, not python3-all. @@ -173,3 +197,4 @@ * Initial release (Closes: #491665). -- Anders Hammarquist Thu, 30 Jul 2009 11:29:24 +0200 + diff -Nru supervisor-4.1.0/debian/control supervisor-4.2.0/debian/control --- supervisor-4.1.0/debian/control 2019-11-01 05:32:49.000000000 +0000 +++ supervisor-4.2.0/debian/control 2020-05-04 15:18:20.000000000 +0000 @@ -5,7 +5,7 @@ XSBC-Original-Maintainer: Python Applications Packaging Team Uploaders: Samuel Henrique , Stéphane Blondon Build-Depends: - debhelper-compat (= 12), + debhelper-compat (= 13), dh-python, python3, python3-pkg-resources, @@ -13,7 +13,8 @@ python3-sphinx, VCS-Git: https://salsa.debian.org/python-team/applications/supervisor.git VCS-Browser: https://salsa.debian.org/python-team/applications/supervisor -Standards-Version: 4.4.0 +Standards-Version: 4.5.0 +Rules-Requires-Root: no Homepage: http://supervisord.org/ Package: supervisor diff -Nru supervisor-4.1.0/debian/gbp.conf supervisor-4.2.0/debian/gbp.conf --- supervisor-4.1.0/debian/gbp.conf 1970-01-01 00:00:00.000000000 +0000 +++ supervisor-4.2.0/debian/gbp.conf 2020-05-04 10:59:15.000000000 +0000 @@ -0,0 +1,15 @@ +[DEFAULT] +debian-branch = debian/master +pristine-tar = True + +[buildpackage] +sign-tags = True + +[import-orig] +filter-pristine-tar = True + +[pq] +patch-numbers = False + +[dch] +multimaint-merge = True diff -Nru supervisor-4.1.0/debian/upstream/metadata supervisor-4.2.0/debian/upstream/metadata --- supervisor-4.1.0/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 +++ supervisor-4.2.0/debian/upstream/metadata 2020-05-04 10:59:15.000000000 +0000 @@ -0,0 +1 @@ +Repository: http://svn.supervisord.org/supervisor/trunk diff -Nru supervisor-4.1.0/docs/api.rst supervisor-4.2.0/docs/api.rst --- supervisor-4.1.0/docs/api.rst 2019-06-16 19:06:54.000000000 +0000 +++ supervisor-4.2.0/docs/api.rst 2020-04-09 21:06:47.000000000 +0000 @@ -225,6 +225,7 @@ --------------- .. autoclass:: SupervisorNamespaceRPCInterface + :noindex: .. automethod:: getProcessInfo @@ -352,6 +353,7 @@ --------------- .. autoclass:: SupervisorNamespaceRPCInterface + :noindex: .. automethod:: readProcessStdoutLog diff -Nru supervisor-4.1.0/docs/configuration.rst supervisor-4.2.0/docs/configuration.rst --- supervisor-4.1.0/docs/configuration.rst 2019-06-16 19:06:54.000000000 +0000 +++ supervisor-4.2.0/docs/configuration.rst 2020-04-09 20:49:10.000000000 +0000 @@ -10,6 +10,10 @@ following locations, in the specified order. It will use the first file it finds. +#. :file:`../etc/supervisord.conf` (Relative to the executable) + +#. :file:`../supervisord.conf` (Relative to the executable) + #. :file:`$CWD/supervisord.conf` #. :file:`$CWD/etc/supervisord.conf` @@ -18,10 +22,6 @@ #. :file:`/etc/supervisor/supervisord.conf` (since Supervisor 3.3.0) -#. :file:`../etc/supervisord.conf` (Relative to the executable) - -#. :file:`../supervisord.conf` (Relative to the executable) - .. note:: Many versions of Supervisor packaged for Debian and Ubuntu included a patch @@ -334,6 +334,16 @@ *Introduced*: 3.0 +``silent`` + + If true and not daemonized, logs will not be directed to stdout. + + *Default*: false + + *Required*: No. + + *Introduced*: 4.2.0 + ``minfds`` The minimum number of file descriptors that must be available before @@ -630,11 +640,11 @@ e.g. ``/path/to/programname --port=80%(process_num)02d`` might expand to ``/path/to/programname --port=8000`` at runtime. String expressions are evaluated against a dictionary containing the keys - ``group_name``, ``host_node_name``, ``process_num``, ``program_name``, - ``here`` (the directory of the supervisord config file), and all - supervisord's environment variables prefixed with ``ENV_``. Controlled - programs should themselves not be daemons, as supervisord assumes it is - responsible for daemonizing its subprocesses (see + ``group_name``, ``host_node_name``, ``program_name``, ``process_num``, + ``numprocs``, ``here`` (the directory of the supervisord config file), + and all supervisord's environment variables prefixed with ``ENV_``. + Controlled programs should themselves not be daemons, as supervisord + assumes it is responsible for daemonizing its subprocesses (see :ref:`nondaemonizing_of_subprocesses`). .. note:: @@ -651,6 +661,8 @@ *Introduced*: 3.0 + *Changed*: 4.2.0. Added support for the ``numprocs`` expansion. + ``process_name`` A Python string expression that is used to compose the supervisor diff -Nru supervisor-4.1.0/docs/events.rst supervisor-4.2.0/docs/events.rst --- supervisor-4.1.0/docs/events.rst 2019-06-16 19:06:54.000000000 +0000 +++ supervisor-4.2.0/docs/events.rst 2020-04-28 05:37:03.000000000 +0000 @@ -220,7 +220,7 @@ ============================= ============================================== ACKNOWLEDGED The event listener has acknowledged (accepted or rejected) an event send. -READY Event notificatons may be sent to this event +READY Event notifications may be sent to this event listener BUSY Event notifications may not be sent to this event listener. @@ -323,7 +323,7 @@ if __name__ == '__main__': main() -Other sample event listeners are present within the :term:`superlance` +Other sample event listeners are present within the :term:`Superlance` package, including one which can monitor supervisor subprocesses and restart a process if it is using "too much" memory. diff -Nru supervisor-4.1.0/docs/faq.rst supervisor-4.2.0/docs/faq.rst --- supervisor-4.1.0/docs/faq.rst 2019-06-16 19:06:54.000000000 +0000 +++ supervisor-4.2.0/docs/faq.rst 2020-04-28 05:37:03.000000000 +0000 @@ -4,7 +4,7 @@ Q My program never starts and supervisor doesn't indicate any error? -A +A Make sure the ``x`` bit is set on the executable file you're using in the ``command=`` line of your program section. @@ -34,6 +34,6 @@ memory automatically? A - The :term:`superlance` package contains a console script that can be + The :term:`Superlance` package contains a console script that can be used as a Supervisor event listener named ``memmon`` which helps with this task. It works on Linux and Mac OS X. diff -Nru supervisor-4.1.0/docs/plugins.rst supervisor-4.2.0/docs/plugins.rst --- supervisor-4.1.0/docs/plugins.rst 2019-06-26 17:18:47.000000000 +0000 +++ supervisor-4.2.0/docs/plugins.rst 2019-12-09 17:49:58.000000000 +0000 @@ -44,6 +44,10 @@ web server. It communicates with each supervisor through a specialized supervisor event-listener based on `zerorpc `_. +`Dart `_ + Web-based dashboard and command line tool written in Python using PostgreSQL + with a REST API, event monitoring, and configuration management. + Third Party Plugins and Libraries for Supervisor ------------------------------------------------ diff -Nru supervisor-4.1.0/docs/running.rst supervisor-4.2.0/docs/running.rst --- supervisor-4.1.0/docs/running.rst 2019-06-16 19:06:54.000000000 +0000 +++ supervisor-4.2.0/docs/running.rst 2019-12-09 17:49:58.000000000 +0000 @@ -79,6 +79,10 @@ Run :program:`supervisord` in the foreground. +-s, --silent + + No output directed to stdout. + -h, --help Show :command:`supervisord` command help. diff -Nru supervisor-4.1.0/PKG-INFO supervisor-4.2.0/PKG-INFO --- supervisor-4.1.0/PKG-INFO 2019-10-19 17:30:59.000000000 +0000 +++ supervisor-4.2.0/PKG-INFO 2020-04-30 19:36:51.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: supervisor -Version: 4.1.0 +Version: 4.2.0 Summary: A system for controlling process state under UNIX Home-page: http://supervisord.org/ Author: Chris McDonough @@ -49,6 +49,33 @@ on GitHub. + 4.2.0 (2020-04-30) + ------------------ + + - When ``supervisord`` is run in the foreground, a new ``--silent`` option + suppresses the main log from being echoed to ``stdout`` as it normally + would. Patch by Trevor Foster. + + - Parsing ``command=`` now supports a new expansion, ``%(numprocs)d``, that + expands to the value of ``numprocs=`` in the same section. Patch by + Santjago Corkez. + + - Web UI buttons no longer use background images. Patch by Dmytro Karpovych. + + - The Web UI now has a link to view ``tail -f stderr`` for a process in + addition to the existing ``tail -f stdout`` link. Based on a + patch by OuroborosCoding. + + - The HTTP server will now send an ``X-Accel-Buffering: no`` header in + logtail responses to fix Nginx proxy buffering. Patch by Weizhao Li. + + - When ``supervisord`` reaps an unknown PID, it will now log a description + of the ``waitpid`` status. Patch by Andrey Zelenchuk. + + - Fixed a bug introduced in 4.0.3 where ``supervisorctl tail -f foo | grep bar`` + would fail with the error ``NoneType object has no attribute 'lower'``. This + only occurred on Python 2.7 and only when piped. Patch by Slawa Pidgorny. + 4.1.0 (2019-10-19) ------------------ @@ -1868,4 +1895,5 @@ Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 Provides-Extra: testing diff -Nru supervisor-4.1.0/setup.py supervisor-4.2.0/setup.py --- supervisor-4.1.0/setup.py 2019-09-16 17:23:38.000000000 +0000 +++ supervisor-4.2.0/setup.py 2020-02-09 18:29:11.000000000 +0000 @@ -25,7 +25,7 @@ requires = [] tests_require = [] if py_version < (3, 3): - tests_require.append('mock') + tests_require.append('mock<4.0.0.dev0') testing_extras = tests_require + [ 'pytest', @@ -60,6 +60,7 @@ "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", ] version_txt = os.path.join(here, 'supervisor/version.txt') diff -Nru supervisor-4.1.0/supervisor/http.py supervisor-4.2.0/supervisor/http.py --- supervisor-4.1.0/supervisor/http.py 2019-09-16 17:23:54.000000000 +0000 +++ supervisor-4.2.0/supervisor/http.py 2019-11-27 19:11:56.000000000 +0000 @@ -748,6 +748,9 @@ request['Content-Type'] = 'text/plain;charset=utf-8' # the lack of a Content-Length header makes the outputter # send a 'Transfer-Encoding: chunked' response + request['X-Accel-Buffering'] = 'no' + # tell reverse proxy server (e.g., nginx) to disable proxy buffering + # (see also http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffering) request.push(tail_f_producer(request, logfile, 1024)) diff -Nru supervisor-4.1.0/supervisor/options.py supervisor-4.2.0/supervisor/options.py --- supervisor-4.1.0/supervisor/options.py 2019-06-16 18:41:06.000000000 +0000 +++ supervisor-4.2.0/supervisor/options.py 2020-04-09 20:49:10.000000000 +0000 @@ -403,6 +403,7 @@ pidfile = None passwdfile = None nodaemon = None + silent = None environment = None httpservers = () unlink_pidfile = False @@ -447,6 +448,8 @@ "t", "strip_ansi", flag=1, default=0) self.add("profile_options", "supervisord.profile_options", "", "profile_options=", profile_options, default=None) + self.add("silent", "supervisord.silent", + "s", "silent", flag=1, default=0) self.pidhistory = {} self.process_group_configs = [] self.parse_criticals = [] @@ -638,6 +641,7 @@ section.pidfile = existing_dirpath(get('pidfile', 'supervisord.pid')) section.identifier = get('identifier', 'supervisor') section.nodaemon = boolean(get('nodaemon', 'false')) + section.silent = boolean(get('silent', 'false')) tempdir = tempfile.gettempdir() section.childlogdir = existing_directory(get('childlogdir', tempdir)) @@ -948,7 +952,7 @@ for process_num in range(numprocs_start, numprocs + numprocs_start): expansions = common_expansions - expansions.update({'process_num': process_num}) + expansions.update({'process_num': process_num, 'numprocs': numprocs}) expansions.update(self.environ_expansions) environment = dict_of_key_value_pairs( @@ -1461,7 +1465,7 @@ # must be called after realize() and after supervisor does setuid() format = '%(asctime)s %(levelname)s %(message)s\n' self.logger = loggers.getLogger(self.loglevel) - if self.nodaemon: + if self.nodaemon and not self.silent: loggers.handle_stdout(self.logger, format) loggers.handle_file( self.logger, diff -Nru supervisor-4.1.0/supervisor/skel/sample.conf supervisor-4.2.0/supervisor/skel/sample.conf --- supervisor-4.1.0/supervisor/skel/sample.conf 2019-06-11 03:13:17.000000000 +0000 +++ supervisor-4.2.0/supervisor/skel/sample.conf 2019-12-09 17:49:58.000000000 +0000 @@ -48,6 +48,7 @@ loglevel=info ; log level; default info; others: debug,warn,trace pidfile=/tmp/supervisord.pid ; supervisord pidfile; default supervisord.pid nodaemon=false ; start in foreground if true; default false +silent=false ; no logs to stdout if true; default false minfds=1024 ; min. avail startup file descriptors; default 1024 minprocs=200 ; min. avail process descriptors;default 200 ;umask=022 ; process file creation umask; default 022 diff -Nru supervisor-4.1.0/supervisor/supervisorctl.py supervisor-4.2.0/supervisor/supervisorctl.py --- supervisor-4.1.0/supervisor/supervisorctl.py 2019-06-16 18:41:06.000000000 +0000 +++ supervisor-4.2.0/supervisor/supervisorctl.py 2019-11-27 19:35:06.000000000 +0000 @@ -437,8 +437,8 @@ self.ctl.print_topics(self.doc_header, cmds_doc, 15, 80) def not_all_langs(): - enc = getattr(sys.stdout, 'encoding', '').lower() - return None if enc.startswith('utf') else sys.stdout.encoding + enc = getattr(sys.stdout, 'encoding', None) or '' + return None if enc.lower().startswith('utf') else sys.stdout.encoding def check_encoding(ctl): problematic_enc = not_all_langs() diff -Nru supervisor-4.1.0/supervisor/supervisord.py supervisor-4.2.0/supervisor/supervisord.py --- supervisor-4.1.0/supervisor/supervisord.py 2019-06-16 18:41:06.000000000 +0000 +++ supervisor-4.2.0/supervisor/supervisord.py 2019-12-09 17:49:58.000000000 +0000 @@ -7,6 +7,7 @@ Options: -c/--configuration FILENAME -- configuration file path (searches if not given) -n/--nodaemon -- run in the foreground (same as 'nodaemon=true' in config file) +-s/--silent -- no logs to stdout (maps to 'silent=true' in config file) -h/--help -- print this usage message and exit -v/--version -- print supervisord version number and exit -u/--user USER -- run supervisord as this user (or numeric uid) @@ -38,6 +39,7 @@ from supervisor.compat import as_string from supervisor.options import ServerOptions +from supervisor.options import decode_wait_status from supervisor.options import signame from supervisor import events from supervisor.states import SupervisorStates @@ -275,7 +277,8 @@ if pid: process = self.options.pidhistory.get(pid, None) if process is None: - self.options.logger.info('reaped unknown pid %s' % pid) + _, msg = decode_wait_status(sts) + self.options.logger.info('reaped unknown pid %s (%s)' % (pid, msg)) else: process.finish(pid, sts) del self.options.pidhistory[pid] diff -Nru supervisor-4.1.0/supervisor/tests/base.py supervisor-4.2.0/supervisor/tests/base.py --- supervisor-4.1.0/supervisor/tests/base.py 2019-06-16 18:41:06.000000000 +0000 +++ supervisor-4.2.0/supervisor/tests/base.py 2019-12-09 17:49:58.000000000 +0000 @@ -89,6 +89,7 @@ self.chdir_error = None self.umaskset = None self.poller = DummyPoller(self) + self.silent = False def getLogger(self, *args, **kw): logger = DummyLogger() diff -Nru supervisor-4.1.0/supervisor/tests/fixtures/issue-1231a.conf supervisor-4.2.0/supervisor/tests/fixtures/issue-1231a.conf --- supervisor-4.1.0/supervisor/tests/fixtures/issue-1231a.conf 1970-01-01 00:00:00.000000000 +0000 +++ supervisor-4.2.0/supervisor/tests/fixtures/issue-1231a.conf 2020-02-15 19:41:26.000000000 +0000 @@ -0,0 +1,17 @@ +[supervisord] +loglevel=info ; log level; default info; others: debug,warn,trace +logfile=/tmp/issue-1231.log ; main log file; default $CWD/supervisord.log +pidfile=/tmp/issue-1231.pid ; supervisord pidfile; default supervisord.pid +nodaemon=true ; start in foreground if true; default false + +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + +[unix_http_server] +file=/tmp/issue-1231a.sock ; the path to the socket file + +[supervisorctl] +serverurl=unix:///tmp/issue-1231a.sock ; use a unix:// URL for a unix socket + +[program:hello] +command=python %(here)s/test_1231.py diff -Nru supervisor-4.1.0/supervisor/tests/fixtures/issue-1231b.conf supervisor-4.2.0/supervisor/tests/fixtures/issue-1231b.conf --- supervisor-4.1.0/supervisor/tests/fixtures/issue-1231b.conf 1970-01-01 00:00:00.000000000 +0000 +++ supervisor-4.2.0/supervisor/tests/fixtures/issue-1231b.conf 2020-02-15 19:41:26.000000000 +0000 @@ -0,0 +1,17 @@ +[supervisord] +loglevel=info ; log level; default info; others: debug,warn,trace +logfile=/tmp/issue-1231.log ; main log file; default $CWD/supervisord.log +pidfile=/tmp/issue-1231.pid ; supervisord pidfile; default supervisord.pid +nodaemon=true ; start in foreground if true; default false + +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + +[unix_http_server] +file=/tmp/issue-1231b.sock ; the path to the socket file + +[supervisorctl] +serverurl=unix:///tmp/issue-1231b.sock ; use a unix:// URL for a unix socket + +[program:hello] +command=python %(here)s/test_1231.py diff -Nru supervisor-4.1.0/supervisor/tests/fixtures/issue-1231c.conf supervisor-4.2.0/supervisor/tests/fixtures/issue-1231c.conf --- supervisor-4.1.0/supervisor/tests/fixtures/issue-1231c.conf 1970-01-01 00:00:00.000000000 +0000 +++ supervisor-4.2.0/supervisor/tests/fixtures/issue-1231c.conf 2020-02-15 19:41:26.000000000 +0000 @@ -0,0 +1,17 @@ +[supervisord] +loglevel=info ; log level; default info; others: debug,warn,trace +logfile=/tmp/issue-1231.log ; main log file; default $CWD/supervisord.log +pidfile=/tmp/issue-1231.pid ; supervisord pidfile; default supervisord.pid +nodaemon=true ; start in foreground if true; default false + +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + +[unix_http_server] +file=/tmp/issue-1231c.sock ; the path to the socket file + +[supervisorctl] +serverurl=unix:///tmp/issue-1231c.sock ; use a unix:// URL for a unix socket + +[program:hello] +command=python %(here)s/test_1231.py diff -Nru supervisor-4.1.0/supervisor/tests/fixtures/issue-1231.conf supervisor-4.2.0/supervisor/tests/fixtures/issue-1231.conf --- supervisor-4.1.0/supervisor/tests/fixtures/issue-1231.conf 2019-05-22 18:48:39.000000000 +0000 +++ supervisor-4.2.0/supervisor/tests/fixtures/issue-1231.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -[supervisord] -loglevel=info ; log level; default info; others: debug,warn,trace -logfile=/tmp/issue-1231.log ; main log file; default $CWD/supervisord.log -pidfile=/tmp/issue-1231.pid ; supervisord pidfile; default supervisord.pid -nodaemon=true ; start in foreground if true; default false - -[rpcinterface:supervisor] -supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface - -[unix_http_server] -file=/tmp/issue-1231.sock ; the path to the socket file - -[supervisorctl] -serverurl=unix:///tmp/issue-1231.sock ; use a unix:// URL for a unix socket - -[program:hello] -command=python %(here)s/test_1231.py diff -Nru supervisor-4.1.0/supervisor/tests/fixtures/issue-1298.conf supervisor-4.2.0/supervisor/tests/fixtures/issue-1298.conf --- supervisor-4.1.0/supervisor/tests/fixtures/issue-1298.conf 1970-01-01 00:00:00.000000000 +0000 +++ supervisor-4.2.0/supervisor/tests/fixtures/issue-1298.conf 2019-11-27 19:18:56.000000000 +0000 @@ -0,0 +1,14 @@ +[supervisord] +nodaemon=true ; start in foreground if true; default false + +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + +[unix_http_server] +file=/tmp/issue-1298.sock ; the path to the socket file + +[supervisorctl] +serverurl=unix:///tmp/issue-1298.sock ; use a unix:// URL for a unix socket + +[program:spew] +command=python %(here)s/spew.py diff -Nru supervisor-4.1.0/supervisor/tests/fixtures/spew.py supervisor-4.2.0/supervisor/tests/fixtures/spew.py --- supervisor-4.1.0/supervisor/tests/fixtures/spew.py 2019-04-05 21:19:18.000000000 +0000 +++ supervisor-4.2.0/supervisor/tests/fixtures/spew.py 2019-11-27 19:18:43.000000000 +0000 @@ -1,10 +1,11 @@ #!<> +import sys import time counter = 0 -while 1: - time.sleep(0.01) - print("more spewage %s" % counter) - counter += 1 - +while counter < 30000: + sys.stdout.write("more spewage %d\n" % counter) + sys.stdout.flush() + time.sleep(0.01) + counter += 1 diff -Nru supervisor-4.1.0/supervisor/tests/test_end_to_end.py supervisor-4.2.0/supervisor/tests/test_end_to_end.py --- supervisor-4.1.0/supervisor/tests/test_end_to_end.py 2019-05-28 17:56:42.000000000 +0000 +++ supervisor-4.2.0/supervisor/tests/test_end_to_end.py 2020-02-15 19:41:26.000000000 +0000 @@ -137,7 +137,7 @@ supervisord.expect_exact('cat entered RUNNING state', timeout=60) def test_issue_1231a(self): - filename = pkg_resources.resource_filename(__name__, 'fixtures/issue-1231.conf') + filename = pkg_resources.resource_filename(__name__, 'fixtures/issue-1231a.conf') args = ['-m', 'supervisor.supervisord', '-c', filename] supervisord = pexpect.spawn(sys.executable, args, encoding='utf-8') self.addCleanup(supervisord.kill, signal.SIGINT) @@ -153,7 +153,7 @@ def test_issue_1231b(self): - filename = pkg_resources.resource_filename(__name__, 'fixtures/issue-1231.conf') + filename = pkg_resources.resource_filename(__name__, 'fixtures/issue-1231b.conf') args = ['-m', 'supervisor.supervisord', '-c', filename] supervisord = pexpect.spawn(sys.executable, args, encoding='utf-8') self.addCleanup(supervisord.kill, signal.SIGINT) @@ -185,7 +185,7 @@ break def test_issue_1231c(self): - filename = pkg_resources.resource_filename(__name__, 'fixtures/issue-1231.conf') + filename = pkg_resources.resource_filename(__name__, 'fixtures/issue-1231c.conf') args = ['-m', 'supervisor.supervisord', '-c', filename] supervisord = pexpect.spawn(sys.executable, args, encoding='utf-8') self.addCleanup(supervisord.kill, signal.SIGINT) @@ -206,6 +206,20 @@ timeout=30) supervisorctl.expect('Unicode output may fail.', timeout=30) + def test_issue_1298(self): + filename = pkg_resources.resource_filename(__name__, 'fixtures/issue-1298.conf') + args = ['-m', 'supervisor.supervisord', '-c', filename] + supervisord = pexpect.spawn(sys.executable, args, encoding='utf-8') + self.addCleanup(supervisord.kill, signal.SIGINT) + supervisord.expect_exact('success: spew entered RUNNING state') + + cmd = "'%s' -m supervisor.supervisorctl -c '%s' tail -f spew | /bin/cat -u" % ( + sys.executable, filename + ) + bash = pexpect.spawn('/bin/sh', ['-c', cmd], encoding='utf-8') + self.addCleanup(bash.kill, signal.SIGINT) + bash.expect('spewage 2', timeout=30) + def test_suite(): return unittest.findTestCases(sys.modules[__name__]) diff -Nru supervisor-4.1.0/supervisor/tests/test_http.py supervisor-4.2.0/supervisor/tests/test_http.py --- supervisor-4.1.0/supervisor/tests/test_http.py 2019-04-05 21:19:18.000000000 +0000 +++ supervisor-4.2.0/supervisor/tests/test_http.py 2019-11-27 19:11:56.000000000 +0000 @@ -70,6 +70,7 @@ self.assertEqual(request.headers['Last-Modified'], http_date.build_http_date(os.stat(t)[stat.ST_MTIME])) self.assertEqual(request.headers['Content-Type'], 'text/plain;charset=utf-8') + self.assertEqual(request.headers['X-Accel-Buffering'], 'no') self.assertEqual(len(request.producers), 1) self.assertEqual(request._done, True) diff -Nru supervisor-4.1.0/supervisor/tests/test_options.py supervisor-4.2.0/supervisor/tests/test_options.py --- supervisor-4.1.0/supervisor/tests/test_options.py 2019-06-16 18:41:06.000000000 +0000 +++ supervisor-4.2.0/supervisor/tests/test_options.py 2020-04-09 20:49:10.000000000 +0000 @@ -470,6 +470,7 @@ loglevel=error pidfile=supervisord.pid nodaemon=true + silent=true identifier=fleeb childlogdir=%(tempdir)s nocleanup=true @@ -539,6 +540,7 @@ self.assertEqual(options.loglevel, 40) self.assertEqual(options.pidfile, 'supervisord.pid') self.assertEqual(options.nodaemon, True) + self.assertEqual(options.silent, True) self.assertEqual(options.identifier, 'fleeb') self.assertEqual(options.childlogdir, tempfile.gettempdir()) self.assertEqual(len(options.server_configs), 1) @@ -688,6 +690,7 @@ self.assertEqual(instance.loglevel, 40) self.assertEqual(instance.pidfile, os.path.join(here,'supervisord.pid')) self.assertEqual(instance.nodaemon, True) + self.assertEqual(instance.silent, True) self.assertEqual(instance.passwdfile, None) self.assertEqual(instance.identifier, 'fleeb') self.assertEqual(instance.childlogdir, tempfile.gettempdir()) @@ -1671,12 +1674,12 @@ instance = self._makeOne() text = lstrip("""\ [program:foo] + process_name = foo_%(process_num)d command = /bin/foo --num=%(process_num)d directory = /tmp/foo_%(process_num)d stderr_logfile = /tmp/foo_%(process_num)d_stderr stdout_logfile = /tmp/foo_%(process_num)d_stdout environment = NUM=%(process_num)d - process_name = foo_%(process_num)d numprocs = 2 """) from supervisor.options import UnhosedConfigParser @@ -1694,6 +1697,23 @@ '/tmp/foo_%d_stdout' % num) self.assertEqual(pconfigs[num].environment, {'NUM': '%d' % num}) + def test_processes_from_section_numprocs_expansion(self): + instance = self._makeOne() + text = lstrip("""\ + [program:foo] + process_name = foo_%(process_num)d + command = /bin/foo --numprocs=%(numprocs)d + numprocs = 2 + """) + from supervisor.options import UnhosedConfigParser + config = UnhosedConfigParser() + config.read_string(text) + pconfigs = instance.processes_from_section(config, 'program:foo', 'bar') + self.assertEqual(len(pconfigs), 2) + for num in (0, 1): + self.assertEqual(pconfigs[num].name, 'foo_%d' % num) + self.assertEqual(pconfigs[num].command, "/bin/foo --numprocs=%d" % 2) + def test_processes_from_section_expands_directory(self): instance = self._makeOne() text = lstrip("""\ @@ -1817,6 +1837,7 @@ 'ENV_SUPD_LOGFILE_BACKUPS': '10', 'ENV_SUPD_LOGLEVEL': 'info', 'ENV_SUPD_NODAEMON': 'false', + 'ENV_SUPD_SILENT': 'false', 'ENV_SUPD_MINFDS': '1024', 'ENV_SUPD_MINPROCS': '200', 'ENV_SUPD_UMASK': '002', @@ -1852,6 +1873,7 @@ self.assertEqual(instance.logfile_backups, 10) self.assertEqual(instance.loglevel, LevelsByName.INFO) self.assertEqual(instance.nodaemon, False) + self.assertEqual(instance.silent, False) self.assertEqual(instance.minfds, 1024) self.assertEqual(instance.minprocs, 200) self.assertEqual(instance.nocleanup, True) diff -Nru supervisor-4.1.0/supervisor/tests/test_supervisord.py supervisor-4.2.0/supervisor/tests/test_supervisord.py --- supervisor-4.1.0/supervisor/tests/test_supervisord.py 2019-04-05 21:19:18.000000000 +0000 +++ supervisor-4.2.0/supervisor/tests/test_supervisord.py 2019-12-09 17:49:58.000000000 +0000 @@ -69,6 +69,48 @@ output = new_stdout.getvalue() self.assertTrue('cumulative time, call count' in output, output) + def test_silent_off(self): + from supervisor.supervisord import main + conf = os.path.join( + os.path.abspath(os.path.dirname(__file__)), 'fixtures', + 'donothing.conf') + new_stdout = StringIO() + new_stdout.fileno = lambda: 1 + old_stdout = sys.stdout + + try: + tempdir = tempfile.mkdtemp() + log = os.path.join(tempdir, 'log') + pid = os.path.join(tempdir, 'pid') + sys.stdout = new_stdout + main(args=['-c', conf, '-l', log, '-j', pid, '-n'], test=True) + finally: + sys.stdout = old_stdout + shutil.rmtree(tempdir) + output = new_stdout.getvalue() + self.assertGreater(len(output), 0) + + def test_silent_on(self): + from supervisor.supervisord import main + conf = os.path.join( + os.path.abspath(os.path.dirname(__file__)), 'fixtures', + 'donothing.conf') + new_stdout = StringIO() + new_stdout.fileno = lambda: 1 + old_stdout = sys.stdout + + try: + tempdir = tempfile.mkdtemp() + log = os.path.join(tempdir, 'log') + pid = os.path.join(tempdir, 'pid') + sys.stdout = new_stdout + main(args=['-c', conf, '-l', log, '-j', pid, '-n', '-s'], test=True) + finally: + sys.stdout = old_stdout + shutil.rmtree(tempdir) + output = new_stdout.getvalue() + self.assertEqual(len(output), 0) + class SupervisordTests(unittest.TestCase): def tearDown(self): from supervisor.events import clear @@ -184,7 +226,7 @@ supervisord.reap(once=True) self.assertEqual(process.finished, None) self.assertEqual(options.logger.data[0], - 'reaped unknown pid 2') + 'reaped unknown pid 2 (exit status 0)') def test_handle_sigterm(self): options = DummyOptions() Binary files /tmp/tmp9GXH6N/EoOPW7JtMu/supervisor-4.1.0/supervisor/ui/images/button_refresh.gif and /tmp/tmp9GXH6N/GQRNXefPUU/supervisor-4.2.0/supervisor/ui/images/button_refresh.gif differ Binary files /tmp/tmp9GXH6N/EoOPW7JtMu/supervisor-4.1.0/supervisor/ui/images/button_restart.gif and /tmp/tmp9GXH6N/GQRNXefPUU/supervisor-4.2.0/supervisor/ui/images/button_restart.gif differ Binary files /tmp/tmp9GXH6N/EoOPW7JtMu/supervisor-4.1.0/supervisor/ui/images/button_stop.gif and /tmp/tmp9GXH6N/GQRNXefPUU/supervisor-4.2.0/supervisor/ui/images/button_stop.gif differ diff -Nru supervisor-4.1.0/supervisor/ui/status.html supervisor-4.2.0/supervisor/ui/status.html --- supervisor-4.1.0/supervisor/ui/status.html 2019-09-16 17:23:31.000000000 +0000 +++ supervisor-4.2.0/supervisor/ui/status.html 2020-02-12 16:32:51.000000000 +0000 @@ -19,9 +19,9 @@
diff -Nru supervisor-4.1.0/supervisor/ui/stylesheets/supervisor.css supervisor-4.2.0/supervisor/ui/stylesheets/supervisor.css --- supervisor-4.1.0/supervisor/ui/stylesheets/supervisor.css 2018-02-15 17:36:50.000000000 +0000 +++ supervisor-4.2.0/supervisor/ui/stylesheets/supervisor.css 2020-04-27 19:19:43.000000000 +0000 @@ -17,7 +17,7 @@ font: 12px/1.5em arial, helvetica, verdana, sans-serif; color: #333; } -html, body, form, fieldset, h1, h2, h3, h4, h5, h6, +html, body, form, fieldset, h1, h2, h3, h4, h5, h6, p, pre, blockquote, ul, ol, dl, address { margin: 0; padding: 0; @@ -38,7 +38,7 @@ background-color: #FFFFF3; color: #333; } -a:link, +a:link, a:visited { color: #333; } @@ -57,10 +57,10 @@ } /* clear float */ .clr:after { - content: "."; - display: block; - height: 0; - clear: both; + content: "."; + display: block; + height: 0; + clear: both; visibility: hidden; } .clr {display: inline-block;} @@ -78,10 +78,10 @@ min-height: 100%; height: auto !important; height: 100%; - width: 782px; + width: 850px; margin: 0 auto -31px; } -#footer, +#footer, .push { height: 30px; } @@ -121,26 +121,20 @@ text-decoration: none; } -#refresh a { - width: 62px; - background: url("../images/button_refresh.gif") 0 0 no-repeat; -} -#refresh a:hover { - background-position: -62px; -} -#restart_all a { - width: 84px; - background: url("../images/button_restart.gif") 0 0 no-repeat; -} -#restart_all a:hover { - background-position: -84px; -} -#stop_all a { - width: 65px; - background: url("../images/button_stop.gif") 0 0 no-repeat; +.action-button { + border: 1px solid #919191; + text-transform: uppercase; + padding: 0 5px; + border-radius: 4px; + color: #50504d; + font-size: 12px; + background: #fbfbfb; + font-weight: 600; } -#stop_all a:hover { - background-position: -65px; + +.action-button:hover { + border: 1px solid #88b0f2; + background: #ffffff; } table { @@ -196,10 +190,10 @@ .statusnominal { background-image: url("../images/state0.gif"); } -.statusrunning { +.statusrunning { background-image: url("../images/state2.gif"); } -.statuserror { +.statuserror { background-image: url("../images/state3.gif"); } diff -Nru supervisor-4.1.0/supervisor/version.txt supervisor-4.2.0/supervisor/version.txt --- supervisor-4.1.0/supervisor/version.txt 2019-10-19 17:25:51.000000000 +0000 +++ supervisor-4.2.0/supervisor/version.txt 2020-04-30 19:27:44.000000000 +0000 @@ -1 +1 @@ -4.1.0 +4.2.0 diff -Nru supervisor-4.1.0/supervisor/web.py supervisor-4.2.0/supervisor/web.py --- supervisor-4.1.0/supervisor/web.py 2019-09-16 17:23:31.000000000 +0000 +++ supervisor-4.2.0/supervisor/web.py 2020-04-27 19:19:43.000000000 +0000 @@ -240,37 +240,42 @@ processname = urllib.quote(make_namespec(process.group.config.name, process.config.name)) start = { - 'name':'Start', - 'href':'index.html?processname=%s&action=start' % processname, - 'target':None, + 'name': 'Start', + 'href': 'index.html?processname=%s&action=start' % processname, + 'target': None, } restart = { - 'name':'Restart', - 'href':'index.html?processname=%s&action=restart' % processname, - 'target':None, + 'name': 'Restart', + 'href': 'index.html?processname=%s&action=restart' % processname, + 'target': None, } stop = { - 'name':'Stop', - 'href':'index.html?processname=%s&action=stop' % processname, - 'target':None, + 'name': 'Stop', + 'href': 'index.html?processname=%s&action=stop' % processname, + 'target': None, } clearlog = { - 'name':'Clear Log', - 'href':'index.html?processname=%s&action=clearlog' % processname, - 'target':None, - } - tailf = { - 'name':'Tail -f', - 'href':'logtail/%s' % processname, - 'target':'_blank' + 'name': 'Clear Log', + 'href': 'index.html?processname=%s&action=clearlog' % processname, + 'target': None, + } + tailf_stdout = { + 'name': 'Tail -f Stdout', + 'href': 'logtail/%s' % processname, + 'target': '_blank' + } + tailf_stderr = { + 'name': 'Tail -f Stderr', + 'href': 'logtail/%s/stderr' % processname, + 'target': '_blank' } if state == ProcessStates.RUNNING: - actions = [restart, stop, clearlog, tailf] + actions = [restart, stop, clearlog, tailf_stdout, tailf_stderr] elif state in (ProcessStates.STOPPED, ProcessStates.EXITED, ProcessStates.FATAL): - actions = [start, None, clearlog, tailf] + actions = [start, None, clearlog, tailf_stdout, tailf_stderr] else: - actions = [None, None, clearlog, tailf] + actions = [None, None, clearlog, tailf_stdout, tailf_stderr] return actions def css_class_for_state(self, state): diff -Nru supervisor-4.1.0/supervisor.egg-info/PKG-INFO supervisor-4.2.0/supervisor.egg-info/PKG-INFO --- supervisor-4.1.0/supervisor.egg-info/PKG-INFO 2019-10-19 17:30:59.000000000 +0000 +++ supervisor-4.2.0/supervisor.egg-info/PKG-INFO 2020-04-30 19:36:51.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: supervisor -Version: 4.1.0 +Version: 4.2.0 Summary: A system for controlling process state under UNIX Home-page: http://supervisord.org/ Author: Chris McDonough @@ -49,6 +49,33 @@ on GitHub. + 4.2.0 (2020-04-30) + ------------------ + + - When ``supervisord`` is run in the foreground, a new ``--silent`` option + suppresses the main log from being echoed to ``stdout`` as it normally + would. Patch by Trevor Foster. + + - Parsing ``command=`` now supports a new expansion, ``%(numprocs)d``, that + expands to the value of ``numprocs=`` in the same section. Patch by + Santjago Corkez. + + - Web UI buttons no longer use background images. Patch by Dmytro Karpovych. + + - The Web UI now has a link to view ``tail -f stderr`` for a process in + addition to the existing ``tail -f stdout`` link. Based on a + patch by OuroborosCoding. + + - The HTTP server will now send an ``X-Accel-Buffering: no`` header in + logtail responses to fix Nginx proxy buffering. Patch by Weizhao Li. + + - When ``supervisord`` reaps an unknown PID, it will now log a description + of the ``waitpid`` status. Patch by Andrey Zelenchuk. + + - Fixed a bug introduced in 4.0.3 where ``supervisorctl tail -f foo | grep bar`` + would fail with the error ``NoneType object has no attribute 'lower'``. This + only occurred on Python 2.7 and only when piped. Patch by Slawa Pidgorny. + 4.1.0 (2019-10-19) ------------------ @@ -1868,4 +1895,5 @@ Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 Provides-Extra: testing diff -Nru supervisor-4.1.0/supervisor.egg-info/requires.txt supervisor-4.2.0/supervisor.egg-info/requires.txt --- supervisor-4.1.0/supervisor.egg-info/requires.txt 2019-10-19 17:30:59.000000000 +0000 +++ supervisor-4.2.0/supervisor.egg-info/requires.txt 2020-04-30 19:36:51.000000000 +0000 @@ -1,5 +1,4 @@ [testing] -mock pytest pytest-cov diff -Nru supervisor-4.1.0/supervisor.egg-info/SOURCES.txt supervisor-4.2.0/supervisor.egg-info/SOURCES.txt --- supervisor-4.1.0/supervisor.egg-info/SOURCES.txt 2019-10-19 17:30:59.000000000 +0000 +++ supervisor-4.2.0/supervisor.egg-info/SOURCES.txt 2020-04-30 19:36:51.000000000 +0000 @@ -101,7 +101,10 @@ supervisor/tests/fixtures/include.conf supervisor/tests/fixtures/issue-1054.conf supervisor/tests/fixtures/issue-1224.conf -supervisor/tests/fixtures/issue-1231.conf +supervisor/tests/fixtures/issue-1231a.conf +supervisor/tests/fixtures/issue-1231b.conf +supervisor/tests/fixtures/issue-1231c.conf +supervisor/tests/fixtures/issue-1298.conf supervisor/tests/fixtures/issue-565.conf supervisor/tests/fixtures/issue-638.conf supervisor/tests/fixtures/issue-663.conf @@ -115,9 +118,6 @@ supervisor/tests/fixtures/example/included.conf supervisor/ui/status.html supervisor/ui/tail.html -supervisor/ui/images/button_refresh.gif -supervisor/ui/images/button_restart.gif -supervisor/ui/images/button_stop.gif supervisor/ui/images/icon.png supervisor/ui/images/rule.gif supervisor/ui/images/state0.gif diff -Nru supervisor-4.1.0/tox.ini supervisor-4.2.0/tox.ini --- supervisor-4.1.0/tox.ini 2019-09-16 17:23:31.000000000 +0000 +++ supervisor-4.2.0/tox.ini 2020-02-15 19:26:58.000000000 +0000 @@ -5,7 +5,7 @@ [testenv] deps = pytest - pexpect + pexpect == 4.7.0 # see https://github.com/Supervisor/supervisor/issues/1327 mock >= 0.5.0 passenv = END_TO_END commands =