Skip to content

Instantly share code, notes, and snippets.

@yuan3y
Last active June 5, 2021 12:57
Show Gist options
  • Save yuan3y/51f6534c9daaa2f64baa64e1a3c361aa to your computer and use it in GitHub Desktop.
Save yuan3y/51f6534c9daaa2f64baa64e1a3c361aa to your computer and use it in GitHub Desktop.
to make `jekyll serve` a system service and start on boot
# Author: @yuan3y
# Date: 2017-09-29
# Description: to make `jekyll serve` a system service and start on boot
#
# Usage: place this file at `/etc/systemd/system/jekyll.service`
# then run
# sudo systemctl start jekyll.service
# sudo systemctl enable jekyll.service
[Unit]
Description=Jekyll service
After=syslog.target network.target
[Service]
User=[my user name]
Type=simple
WorkingDirectory=[my jekyll source folder]
ExecStart=/usr/local/bin/jekyll serve --watch --source "[my jekyll source folder]"
ExecStop=/usr/bin/pkill -f jekyll
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