From 42dedabba9d961145950d6b0384497c033c27410 Mon Sep 17 00:00:00 2001 From: "kebler.net" Date: Sat, 30 Apr 2022 12:51:56 -0700 Subject: [PATCH] fix: run moves to file directory before executing hugo so git safe errors are not thrown fix: created an .example systemd service. for instance create a copy and modify for that machine, thus removed hugo@.service from repo --- run | 2 ++ systemd/hugo@.service | 18 ------------------ systemd/hugo@.service.example | 22 ++++++++++++++++++++++ themes/uci-hugo-shortcodes | 2 +- 4 files changed, 25 insertions(+), 19 deletions(-) delete mode 100644 systemd/hugo@.service create mode 100644 systemd/hugo@.service.example diff --git a/run b/run index 98f4971..cac46d2 100755 --- a/run +++ b/run @@ -20,6 +20,8 @@ HUGO=${HUGO:-$(command -v hugo)} PORT=${PORT:-8096} echo site files in $DATA_DIR listening on port $PORT # [[ $(netstat -tulpn | grep LISTEN | grep 0.0.0.0:$PORT) ]] && echo tcp port $PORT is busy can not start hugo server && exit +cd $DATA_DIR +ls -la CMD="$HUGO server $([[ $BASE_URL = "https://"* ]] && echo " --liveReloadPort 443") --bind 0.0.0.0 diff --git a/systemd/hugo@.service b/systemd/hugo@.service deleted file mode 100644 index 6e8c6ea..0000000 --- a/systemd/hugo@.service +++ /dev/null @@ -1,18 +0,0 @@ -[Unit] -Description=Live Hugo Server for a Site -After=network-online.target -Requires=opt.mount -After=opt.mount -Requires=mnt-data.mount -After=mnt-data.mount - -[Service] -# User=sysadmin -Group=sysadmin -Type=simple -ExecStart=/bin/bash /opt/hugo/run %i -Restart=on-failure -RestartSec=5 - -[Install] -WantedBy=default.target diff --git a/systemd/hugo@.service.example b/systemd/hugo@.service.example new file mode 100644 index 0000000..50c4470 --- /dev/null +++ b/systemd/hugo@.service.example @@ -0,0 +1,22 @@ +[Unit] +Description=Live Hugo Server for a Site +After=network-online.target +# if opt is mounted you'll need these +#Requires=opt.mount +# After=opt.mount +# Requires=mnt-data.mount +# After=mnt-data.mount + +[Service] +# set the main user for your system +#User=ubuntu +#Group=docker +Type=simple +# run will change into the files directory +# be sure to set the correct absolute directory where run command (hugo repo) is located +ExecStart=/bin/bash /path/to/hugo/repo/run %i +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=default.target diff --git a/themes/uci-hugo-shortcodes b/themes/uci-hugo-shortcodes index 1ad4d92..69c9a47 160000 --- a/themes/uci-hugo-shortcodes +++ b/themes/uci-hugo-shortcodes @@ -1 +1 @@ -Subproject commit 1ad4d928af367cf6695159521383304ee15530e0 +Subproject commit 69c9a476a926cae3ddfba8eaad1e66965cfabc13