#!/usr/bin/bash set -eu cat << EOF > ${pkgbuild_path}/knotserver.service [Unit] Description=tangled knot server After=network.target network-online.target Wants=network-online.target AssertPathExists=${knotserver_path} AssertPathExists=${knotserver_repo_path} [Service] Environment="KNOT_SERVER_LISTEN_ADDR=127.0.0.1:5555" Environment="KNOT_REPO_SCAN_PATH=${knotserver_repo_path}" WorkingDirectory=${knotserver_path} ExecStart=/usr/bin/knot server Restart=always User=${knotserver_user} Group=${knotserver_group} StandardOutput=journal StandardError=journal LimitNOFILE=65536 # Creates /var/log/knotserver with the correct permissions for the repoguard log. LogsDirectory=knotserver [Install] WantedBy=multi-user.target EOF