Wednesday, 15 March 2017

Stop jekyll detached server on windows

I'm currently trying to make my own theme based on bootstrap 4. To test my code I use Jekyll which comes with the Bootstrap dependencies. The server is running perfectly without any problem until I want to stop it.

In facts, the problem is not Jekyll itself. The problem comes from me, because I don't know how to stop it. I've read the docs but the only ways they give to stop it is from the command prompt. So I told myself Fine! I'm gonna stop it with the command prompt then But I'm on windows and I realized that all the commands they give are for the UNIX system and not for the windows command prompt or for PowerShell.

I've searched on web for a solution without success. So I decided to look at the processes running using a PowerShell command (get-process) and I didnt find any Jekyll process but I knew Jekyll uses ruby so I tried to kill the Ruby's processes and it worked! Fine but now that I try to restart my Jekyll server it prompts an error. I know I can force it to run but anyway by killing the Ruby processes it doesnt kill only my Jekyll server but also all my processes running on ruby and this is even more problematic.

I dont know if there is a way to name the Jekyll process when I start it or if there's any other way to stop Jekyll. So maybe I'm just too much retarded to search things like this on web but I hope someone can help me.

I am currently using a pre-configured command from bootstrap using grunt / npm to start Jekyll which is grunt jekyll and which refers to the jekyll configs in Gruntfile.js.

The Gruntfile configs are the following:

jekyll: {
      options: {
        bundleExec: true,
        config: '_config.yml',
        incremental: false
      },
      docs: {},
      github: {
        options: {
          raw: 'github: true'
        }
      }
    }

And the following is the content of the _config.yml mentionned in the Gruntfile.js file:

# Dependencies
markdown:         kramdown
highlighter:      rouge

kramdown:
  auto_ids: true

# Permalinks
permalink:        pretty

# Server
source:           docs
destination:      _Generated
host:             0.0.0.0
port:             9001
baseurl:          ""
url:              https://v4-alpha.getbootstrap.com
encoding:         UTF-8
exclude:          [assets/scss/]

gems:
  - jekyll-redirect-from
  - jekyll-sitemap

# Social
title: Bootstrap
description: The most popular HTML, CSS, and JS framework in the world.
twitter: getbootstrap
authors: Mark Otto, Jacob Thornton, and Bootstrap contributors
social_logo_path: /assets/brand/bootstrap-social-logo.png
social_image_path: /assets/brand/bootstrap-social.png

# Custom vars
current_version:  4.0.0-alpha.6
repo:             https://github.com/twbs/bootstrap
slack:            https://bootstrap-slack.herokuapp.com

download:
  source:         https://github.com/twbs/bootstrap/archive/v4.0.0-alpha.6.zip
  dist:           https://github.com/twbs/bootstrap/releases/download/v4.0.0-alpha.6/bootstrap-4.0.0-alpha.6-dist.zip

blog:             https://blog.getbootstrap.com
expo:             https://expo.getbootstrap.com
themes:           https://themes.getbootstrap.com

cdn:
  # See https://www.srihash.org for info on how to generate the hashes
  css:            https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css
  css_hash:       "sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ"
  js:             https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js
  js_hash:        "sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn"
  jquery:         https://code.jquery.com/jquery-3.1.1.slim.min.js
  jquery_hash:    "sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n"
  tether:         https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js
  tether_hash:    "sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb"

Here is the given command to stop Jekyll on UNIX: ps aux | grep jekyll

Here is the command I used to kill the Ruby processes using PS1: kill -name ruby



via DrunkenPoney

No comments:

Post a Comment