Skip to content

Instantly share code, notes, and snippets.

@coletonodonnell
Forked from yuan3y/jekyll.service
Last active June 20, 2021 10:44
Show Gist options
  • Save coletonodonnell/c6b0ac60e2040ac2d94a5544aaffff8b to your computer and use it in GitHub Desktop.
Save coletonodonnell/c6b0ac60e2040ac2d94a5544aaffff8b to your computer and use it in GitHub Desktop.
Makes Jekyll a system service that starts on boot
# Original Author: @yuan3y
# Original Date: 09/20/2017
# Fork: @coletonodonnell
# Fork Date: 14/10/2019
# Description: Makes jekyll a system service that starts on boot
# Usage: update with user details and file structure, then place this file at `/etc/systemd/system/` as jekyll.service
# then run
# sudo systemctl start jekyll.service
# sudo systemctl enable jekyll.service
# Typical systemctl options are avaiable as well, such as status, stop, ect.
# Note: when personalizing, remove the [] when appending anything, eg. user, folder locations, ect.
[Unit]
Description=A Jekyll Service
After=syslog.target network.target
[Service]
# Insert user that will be running this service:
User=[Insert User Here]
Type=simple
# Insert your Jekyll Folder, eg. /home/jekyll/mysite
WorkingDirectory=[Insert Jekyll Folder here]
# Insert your Jekyll Folder here as well
ExecStart=/usr/local/bin/jekyll serve --watch --source [Insert Jekyll Folder here]
ExecStop=/usr/bin/pkill -f jekyll
# If you'd like to not have the service automatically restart and start on boot, comment lines 30-32
Restart=always
TimeoutStartSec=60
RestartSec=60
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=jekyll
[Install]
WantedBy=multi-user.target network-online.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment