Skip to content

Commit

Permalink
Merge branch 'master' into feature/int_conversion_check
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalresistor committed Nov 13, 2015
2 parents 203cf3a + a6b316a commit fca5e09
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ Bug Fixes
``timeout``, ``reissue_time``, ``max_age`` that expect an integer value.
See https://github.com/Pylons/pyramid/pull/2050

- Fixed usage of ``pserve --monitor-restart --daemon`` which would fail in
horrible ways. See https://github.com/Pylons/pyramid/pull/2118

Deprecations
------------

Expand Down
14 changes: 10 additions & 4 deletions pyramid/scripts/pserve.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,10 @@ def run(self): # pragma: no cover
raise ValueError(msg)
writeable_pid_file.close()

if getattr(self.options, 'daemon', False):
if (
getattr(self.options, 'daemon', False) and
not os.environ.get(self._monitor_environ_key)
):
self._warn_daemon_deprecated()
try:
self.daemonize()
Expand All @@ -311,15 +314,18 @@ def run(self): # pragma: no cover
self.out(str(ex))
return 2

if (
not os.environ.get(self._monitor_environ_key) and
self.options.pid_file
):
self.record_pid(self.options.pid_file)

if (
self.options.monitor_restart and
not os.environ.get(self._monitor_environ_key)
):
return self.restart_with_monitor()

if self.options.pid_file:
self.record_pid(self.options.pid_file)

if self.options.log_file:
stdout_log = LazyWriter(self.options.log_file, 'a')
sys.stdout = stdout_log
Expand Down

0 comments on commit fca5e09

Please sign in to comment.