Skip to content
Permalink
Browse files

fix #1913 -- graceful serve -d fallback

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jul 26, 2015
1 parent 92d810f commit 05203d7d313697c837604705561de0abd9e751e4
Showing with 14 additions and 7 deletions.
  1. +3 −2 CHANGES.txt
  2. +11 −5 nikola/plugins/command/serve.py
@@ -12,12 +12,13 @@ Features
Bugfixes
--------

* Don't auto-rebuild on changes to ".foo" or "foo~" or changes in folders.
* Graceful fallback in ``nikola serve --detach`` on Windows (Issue #1913)
* Don't auto-rebuild on changes to ".foo" or "foo~" or changes in folders
* auto should also rebuild in response to move events
* Don’t get metadata from file if compiler-specific metadata exist (Issue #1904)
* Fix PRETTY_URLS prompt for Windows (Issue #1901)
* Fix reST and Markdown title extraction from documents (Issue #1895, #1898)
* Minor improvements in the extending document.
* Minor improvements to the extending document
* Re-add the hack to kill nikola auto on ^C (Issue #1893)

New in v7.6.1
@@ -127,11 +127,17 @@ def _execute(self, options, args):
webbrowser.open(server_url)
if options['detach']:
OurHTTPRequestHandler.quiet = True
pid = os.fork()
if pid == 0:
httpd.serve_forever()
else:
self.logger.info("Detached with PID {0}. Run `kill {0}` to stop the server.".format(pid))
try:
pid = os.fork()
if pid == 0:
httpd.serve_forever()
else:
self.logger.info("Detached with PID {0}. Run `kill {0}` to stop the server.".format(pid))
except AttributeError as e:
if os.name == 'nt':
self.logger.warning("Detaching is not available on Windows, server is running in the foreground.")
else:
raise e
else:
try:
httpd.serve_forever()

0 comments on commit 05203d7

Please sign in to comment.
You can’t perform that action at this time.