Last active
September 8, 2024 13:48
-
-
Save yuan3y/51f6534c9daaa2f64baa64e1a3c361aa to your computer and use it in GitHub Desktop.
to make `jekyll serve` a system service and start on boot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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