From 18801eb4ff4db95f88e5e4eb7739ac60320e89b3 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Thu, 5 Mar 2026 09:34:29 +0100 Subject: [PATCH] fix(powerdns): fix SQLite directory permissions for pdns user The /opt/poweradmin/ directory was owned by www-data:www-data (755), but pdns runs as the 'pdns' user which had no write access to the directory. SQLite requires write access to the database directory to create journal/WAL files (powerdns.db-journal, powerdns.db-wal). Without this, pdns fails to start. Changes: - Set directory group to 'pdns' instead of 'www-data' so pdns user can create SQLite journal/WAL files (via group write 775) - Apply same permissions fix in update_script (ct/powerdns.sh) - Fix msg_info -> msg_ok for 'Created Service' completion message Fixes #12572 --- ct/powerdns.sh | 5 ++++- install/powerdns-install.sh | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ct/powerdns.sh b/ct/powerdns.sh index f7e41bc42..9d1240516 100644 --- a/ct/powerdns.sh +++ b/ct/powerdns.sh @@ -47,7 +47,10 @@ function update_script() { cp /opt/poweradmin_powerdns.db.bak /opt/poweradmin/powerdns.db rm -rf /opt/poweradmin/install rm -f /opt/poweradmin_settings.php.bak /opt/poweradmin_powerdns.db.bak - chown -R www-data:www-data /opt/poweradmin + chown -R www-data:pdns /opt/poweradmin + chmod 775 /opt/poweradmin + chown pdns:pdns /opt/poweradmin/powerdns.db + chmod 664 /opt/poweradmin/powerdns.db msg_ok "Updated Poweradmin" msg_info "Restarting Services" diff --git a/install/powerdns-install.sh b/install/powerdns-install.sh index 6c388b7b0..4f5121f26 100644 --- a/install/powerdns-install.sh +++ b/install/powerdns-install.sh @@ -131,12 +131,13 @@ cat </etc/apache2/sites-enabled/poweradmin.conf EOF $STD a2enmod rewrite headers -chown -R www-data:www-data /opt/poweradmin +chown -R www-data:pdns /opt/poweradmin +chmod 775 /opt/poweradmin chown pdns:pdns /opt/poweradmin/powerdns.db chmod 664 /opt/poweradmin/powerdns.db usermod -aG pdns www-data $STD systemctl restart pdns apache2 -msg_info "Created Service" +msg_ok "Created Service" motd_ssh customize