bind: created /var/run/named directory 17037/head
authorPhilip Prindeville <philipp@redfish-solutions.com>
Sat, 30 Oct 2021 00:21:07 +0000 (18:21 -0600)
committerPhilip Prindeville <philipp@redfish-solutions.com>
Sun, 31 Oct 2021 22:01:44 +0000 (16:01 -0600)
Side-effect of dropping capabilities(7) with last commit is now we
need the `/var/run/named/` directory created for us at startup.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
net/bind/files/named.init

index 1a7683704524b0951b6e6a561cf57b3947d60497..bb13c5f5f5261482094d376db25f762eafc5a544 100644 (file)
@@ -21,7 +21,6 @@ dyndir=/tmp/bind
 
 conf_local_file=$dyndir/named.conf.local
 
-
 fix_perms() {
     for dir in $libdir $logdir $cachedir $dyndir; do
        test -e "$dir" || {
@@ -41,6 +40,13 @@ start_service() {
     group_exists bind 57 || group_add bind 57
     fix_perms
 
+    local runnamed=$(dirname $pid_file)
+    # with dropped privileges, we need this created for us
+    [ -d $runnamed ] || {
+       mkdir -m 0755 $runnamed
+       chown bind.bind $runnamed
+    }
+
     rndc-confgen > $rndc_temp
 
     sed -r -n \