]> arthur.barton.de Git - netdata.git/blobdiff - netdata-installer.sh
fix logrotate file permissions; #1456
[netdata.git] / netdata-installer.sh
index 90f0bab4745ce987ab38f4eb182f849bbafbcf1e..d16f1b1331b836f52fe2636f147bd632fa51db1d 100755 (executable)
@@ -657,7 +657,7 @@ portable_add_user_to_group() {
     fi
 }
 
-run find ./system/ -type f -a \! -name \*.in -a \! -name Makefile\* -a \! -name \*.conf  -a \! -name \*.service -exec chmod 755 {} \;
+run find ./system/ -type f -a \! -name \*.in -a \! -name Makefile\* -a \! -name \*.conf -a \! -name \*.service -a \! -name \*.logrotate -exec chmod 755 {} \;
 
 NETDATA_ADDED_TO_DOCKER=0
 NETDATA_ADDED_TO_NGINX=0
@@ -666,13 +666,19 @@ if [ ${UID} -eq 0 ]
     portable_add_group netdata
     portable_add_user netdata
     portable_add_user_to_group docker netdata && NETDATA_ADDED_TO_DOCKER=1
-    portable_add_user_to_group ngnix  netdata && NETDATA_ADDED_TO_NGINX=1
+    portable_add_user_to_group nginx  netdata && NETDATA_ADDED_TO_NGINX=1
 
     if [ -d /etc/logrotate.d -a ! -f /etc/logrotate.d/netdata ]
         then
         echo >&2 "Adding netdata logrotate configuration ..."
         run cp system/netdata.logrotate /etc/logrotate.d/netdata
     fi
+    
+    if [ -f /etc/logrotate.d/netdata ]
+        then
+        echo >&2 "Fixing netdata logrotate permissions ..."
+        run chmod 644 /etc/logrotate.d/netdata
+    fi
 fi