# Jekyll serve hangs under WSL, requires restart to kill process

**URL:** <https://talk.jekyllrb.com/t/jekyll-serve-hangs-under-wsl-requires-restart-to-kill-process/5424>\
**Category:** Help\
**Created:** [December 30, 2020, 10:14pm UTC](https://talk.jekyllrb.com/t/jekyll-serve-hangs-under-wsl-requires-restart-to-kill-process/5424 "2020-12-30T22:14:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericc](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/ericc/32/2971_2.png) [@ericc](https://talk.jekyllrb.com/u/ericc)\
**Post date:** [December 30, 2020, 10:14pm UTC](https://talk.jekyllrb.com/t/jekyll-serve-hangs-under-wsl-requires-restart-to-kill-process/5424/1 "2020-12-30T22:14:30Z")

</div>

Windows 10 Pro (20H2 update)

Ubuntu 18.04 LTS in WSL  
Jekyll 4.1.1  
Ruby 2.5.1  
Gem 3.1.2  
Bundler 2.2.0

I start the jekyll server inside bash. It serves up pages until the first time it detects the content has changed and it will do the rebuild. After that, replies on localhost:4000 stop. This happens if I start jekyll as `bundle exec jekyll serve` or just `jekyll serve`. It also happens if I start either of these commands in the background.

When I try to stop jekyll with ^C, I never get the prompt back. If I started the process in the background, `kill -9 <pid>` doesn’t work either. The server still shows up with `ps -ef`. Even more maddening, if I quit WSL, the process still lives in Windows space. I can see it in the Task Manager as `bash.exe`. I can’t kill it from Task Manager, either, the process is grayed out. The _only_ thing that will stop the process for me is a reboot.

I have a workaround where I ~~rsync~~ `s3cmd sync` the \_site folder to an S3 bucket that I have set up as a staging site, but that’s a pain to do for hours on end.

I’ve used jekyll serve successfully in the past on a Mac and Linux without any problems. I’m assuming this is some oddity of using WSL, but I haven’t had this type of issue before. Ideas?

Thanks

---

<div class="post-metadata">

**Author:** ![MichaelCurrin](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelcurrin/32/2340_2.png) [@MichaelCurrin](https://talk.jekyllrb.com/u/MichaelCurrin)\
**Post date:** [December 31, 2020, 7:18am UTC](https://talk.jekyllrb.com/t/jekyll-serve-hangs-under-wsl-requires-restart-to-kill-process/5424/2 "2020-12-31T07:18:24Z")

</div>

Try this

```auto
jekyll serve --force-polling

```

Based on 2016 issue which was my first result on “Jekyll subsystem frozen” search

> <https://github.com/jekyll/jekyll/issues/5233>
>
> I believe this to be a bug, not a question about using Jekyll.
> I Updated to the latest Jekyll (or) if...

You can also use `--no-watch` to disable reloading on file change.

---

<div class="post-metadata">

**Author:** ![MichaelCurrin](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelcurrin/32/2340_2.png) [@MichaelCurrin](https://talk.jekyllrb.com/u/MichaelCurrin)\
**Post date:** [December 31, 2020, 7:19am UTC](https://talk.jekyllrb.com/t/jekyll-serve-hangs-under-wsl-requires-restart-to-kill-process/5424/3 "2020-12-31T07:19:56Z")

</div>

Unrelated, when you get this working I would recommend livereload if you don’t use it already. It will refresh your browser tab, in addition to the Jekyll rebuild. And trace flag gives error details which the usual error is too vague

```auto
jekyll serve --trace --livereload

```

---

<div class="post-metadata">

**Author:** ![MichaelCurrin](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelcurrin/32/2340_2.png) [@MichaelCurrin](https://talk.jekyllrb.com/u/MichaelCurrin)\
**Post date:** [December 31, 2020, 7:23am UTC](https://talk.jekyllrb.com/t/jekyll-serve-hangs-under-wsl-requires-restart-to-kill-process/5424/4 "2020-12-31T07:23:31Z")

</div>

See also Windows Auto Regeneration in the docs

> Add the following to the Gemfile for your site if you have issues with auto-regeneration on Windows alone:

```auto
gem 'wdm', '~> 0.1.1', :install_if => Gem.win_platform?

```

> You have to use a Ruby+Devkit version of the RubyInstaller and install the MSYS2 build tools to successfully install the wdm gem.

> **[Jekyll on Windows](https://jekyllrb.com/docs/installation/windows/)**
>
> While Windows is not an officially-supported platform, it can be used to run Jekyll with the proper tweaks.

When I ran `jekyll new` in 2018, my Gemfile ended with

```auto
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]

# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.0" if Gem.win_platform?

```

---

<div class="post-metadata">

**Author:** ![ericc](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/ericc/32/2971_2.png) [@ericc](https://talk.jekyllrb.com/u/ericc)\
**Post date:** [December 31, 2020, 3:48pm UTC](https://talk.jekyllrb.com/t/jekyll-serve-hangs-under-wsl-requires-restart-to-kill-process/5424/5 "2020-12-31T15:48:11Z")

</div>

> [@MichaelCurrin](#):
>
> `--livereload`

The `--force-polling` option seems to have done the trick. I already had the `tzinfo` and `wdm` items in my Gemfile. I’ll keep the `--trace` option in mind for the next time I have issues.

Thanks @MichaelCurrin!
