diff --git a/init/caddy.service b/init/caddy.service index 541d65e..4f594e2 100644 --- a/init/caddy.service +++ b/init/caddy.service @@ -23,6 +23,8 @@ Requires=network-online.target Type=notify User=caddy Group=caddy +RuntimeDirectory=caddy +LogsDirectory=caddy ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddyfile --force TimeoutStopSec=5s diff --git a/scripts/postinstall.sh b/scripts/postinstall.sh index 6c1ada0..3071bcf 100644 --- a/scripts/postinstall.sh +++ b/scripts/postinstall.sh @@ -18,12 +18,6 @@ if [ "$1" = "configure" ]; then if getent group www-data >/dev/null; then usermod -aG www-data caddy fi - - # Add log directory with correct permissions - if [ ! -d /var/log/caddy ]; then - mkdir -p /var/log/caddy - chown -R caddy:caddy /var/log/caddy - fi fi if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then @@ -52,4 +46,4 @@ if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-decon deb-systemd-invoke try-restart caddy-api.service >/dev/null || true fi fi -fi \ No newline at end of file +fi