From eaaa1ec08a6b451c6ef305e51bd93054d638bbd9 Mon Sep 17 00:00:00 2001 From: bakerboy448 <55419169+bakerboy448@users.noreply.github.com> Date: Sun, 29 Nov 2026 15:35:58 -0600 Subject: [PATCH] fix: match modlog@.service to the running hetzner unit Co-Authored-By: Claude Sonnet 5.5 --- README.md | 2 +- systemd/modlog@.service | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 07a0ab6..4396098 100644 --- a/README.md +++ b/README.md @@ -153,7 +153,7 @@ sudo systemctl enable --now modlog@ tail -f /var/log/redditmodlog/.log ``` -`install.sh` creates the `modlogbot` user, `/etc/redditmodlog`, `/var/log/redditmodlog`, `/opt/RedditModLog/data`, and a daily logrotate rule (30 files, 100 MB max). Per-instance credentials can go in `/etc/redditmodlog/.env`. The unit sets `ProtectSystem=strict` and allows writes only to `/opt/RedditModLog/data` and `/var/log/redditmodlog`, so set `DATABASE_PATH=/opt/RedditModLog/data/modlog.db` and `LOGS_DIR=/var/log/redditmodlog` in that env file. Limits: 256 MB memory and 25% CPU. +`install.sh` creates the `modlogbot` user, `/etc/redditmodlog`, `/var/log/redditmodlog`, `/opt/RedditModLog/data`, and a daily logrotate rule (30 files, 100 MB max). Per-instance credentials can go in `/etc/redditmodlog/.env`. The unit sets `ProtectSystem=false`, allows writes to `/etc/redditmodlog` and `/var/log/redditmodlog`, and sets `DATABASE_PATH=/etc/redditmodlog/modlog.db` and `LOGS_DIR=/var/log/redditmodlog`. Limits: 256 MB memory and 25% CPU. ## Troubleshooting diff --git a/systemd/modlog@.service b/systemd/modlog@.service index f3b2e7d..7db8dc8 100644 --- a/systemd/modlog@.service +++ b/systemd/modlog@.service @@ -12,6 +12,8 @@ WorkingDirectory=/opt/RedditModLog # Environment file for credentials (optional) EnvironmentFile=-/etc/redditmodlog/%i.env +Environment="DATABASE_PATH=/etc/redditmodlog/modlog.db" +Environment="LOGS_DIR=/var/log/redditmodlog" # Use config file specific to this subreddit ExecStart=/opt/.venv/redditbot/bin/python /opt/RedditModLog/modlog_wiki_publisher.py \ @@ -27,9 +29,9 @@ StartLimitBurst=3 # Security hardening NoNewPrivileges=true PrivateTmp=true -ProtectSystem=strict +ProtectSystem=false ProtectHome=true -ReadWritePaths=/opt/RedditModLog/data /var/log/redditmodlog +ReadWritePaths=/etc/redditmodlog /var/log/redditmodlog # Resource limits MemoryMax=256M