diff options
| -rw-r--r-- | CHANGES.txt | 11 | ||||
| -rw-r--r-- | pyramid/scripts/pserve.py | 17 |
2 files changed, 28 insertions, 0 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 98fa7f85a..7c8a9080a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -209,6 +209,17 @@ Bug Fixes Deprecations ------------ +- The ``pserve`` command's daemonization features have been deprecated. This + includes the ``[start,stop,restart,status]`` subcommands as well as the + ``--daemon``, ``--stop-server``, ``--pid-file``, and ``--status`` flags. + + Please use a real process manager in the future instead of relying on the + ``pserve`` to daemonize itself. Many options exist including your Operating + System's services such as systemd or upstart, as well as the excellent + and simple supervisord. + + See https://github.com/Pylons/pyramid/pull/1641 + - Renamed the ``principal`` argument to ``pyramid.security.remember()`` to ``userid`` in order to clarify its intended purpose. See https://github.com/Pylons/pyramid/pull/1399 diff --git a/pyramid/scripts/pserve.py b/pyramid/scripts/pserve.py index e97bdcd48..a30ea5985 100644 --- a/pyramid/scripts/pserve.py +++ b/pyramid/scripts/pserve.py @@ -200,6 +200,7 @@ class PServeCommand(object): def run(self): # pragma: no cover if self.options.stop_daemon: + self._warn_daemon_deprecated() return self.stop_daemon() if not hasattr(self.options, 'set_user'): @@ -239,9 +240,11 @@ class PServeCommand(object): return 2 if cmd == 'status' or self.options.show_status: + self._warn_daemon_deprecated() return self.show_status() if cmd == 'restart' or cmd == 'stop': + self._warn_daemon_deprecated() result = self.stop_daemon() if result: if cmd == 'restart': @@ -271,6 +274,10 @@ class PServeCommand(object): server_spec = app_spec base = os.getcwd() + # warn before setting a default + if self.options.pid_file: + self._warn_daemon_deprecated() + if getattr(self.options, 'daemon', False): if not self.options.pid_file: self.options.pid_file = 'pyramid.pid' @@ -296,6 +303,7 @@ class PServeCommand(object): writeable_pid_file.close() if getattr(self.options, 'daemon', False): + self._warn_daemon_deprecated() try: self.daemonize() except DaemonizeException as ex: @@ -610,6 +618,15 @@ class PServeCommand(object): if uid: os.setuid(uid) + def _warn_daemon_deprecated(self): + self.out('''\ +The daemon options have been deprecated in Pyramid 1.6. They will be removed +in a future release per Pyramid's deprecation policy. Please consider using +a real process manager for handling your processes like supervisord or systemd. + +The following commands are deprecated: + [start,stop,restart,status] --daemon, --stop-server, --status, --pid-file +''') class LazyWriter(object): |
