mirror of
https://github.com/jekyll/jekyll.git
synced 2026-01-09 15:08:08 -05:00
Fix jekyll serve --detach with jekyll-sass-converter 3.x (#9304)
Merge pull request 9304
This commit is contained in:
@@ -274,12 +274,19 @@ module Jekyll
|
||||
def boot_or_detach(server, opts)
|
||||
if opts["detach"]
|
||||
pid = Process.fork do
|
||||
# Detach the process from controlling terminal
|
||||
$stdin.reopen("/dev/null", "r")
|
||||
$stdout.reopen("/dev/null", "w")
|
||||
$stderr.reopen("/dev/null", "w")
|
||||
server.start
|
||||
end
|
||||
|
||||
Process.detach(pid)
|
||||
Jekyll.logger.info "Server detached with pid '#{pid}'.",
|
||||
"Run `pkill -f jekyll' or `kill -9 #{pid}' to stop the server."
|
||||
|
||||
# Exit without running `at_exit` inherited by the forked process.
|
||||
Process.exit! 0
|
||||
else
|
||||
t = Thread.new { server.start }
|
||||
trap("INT") { server.shutdown }
|
||||
|
||||
Reference in New Issue
Block a user