]> arthur.barton.de Git - netdata.git/blobdiff - netdata-installer.sh
Merge pull request #1590 from l2isbad/elasticsearch_plugin
[netdata.git] / netdata-installer.sh
index ac19452b36cd04403b4dfb2fecf4e34c1acd7f43..874315437ec13e1961fcafb0c8009db371168689 100755 (executable)
@@ -692,12 +692,16 @@ run find ./system/ -type f -a \! -name \*.in -a \! -name Makefile\* -a \! -name
 
 NETDATA_ADDED_TO_DOCKER=0
 NETDATA_ADDED_TO_NGINX=0
+NETDATA_ADDED_TO_VARNISH=0
+NETDATA_ADDED_TO_HAPROXY=0
 if [ ${UID} -eq 0 ]
     then
     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 nginx  netdata && NETDATA_ADDED_TO_NGINX=1
+    portable_add_user_to_group varnish  netdata && NETDATA_ADDED_TO_VARNISH=1
+    portable_add_user_to_group haproxy  netdata && NETDATA_ADDED_TO_HAPROXY=1
 
     if [ -d /etc/logrotate.d -a ! -f /etc/logrotate.d/netdata ]
         then
@@ -839,6 +843,15 @@ if [ ${UID} -eq 0 ]
         then
         run setcap cap_dac_read_search,cap_sys_ptrace+ep "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/apps.plugin"
         setcap_ret=$?
+
+        if [ ${setcap_ret} -eq 0 ]
+            then
+            # if we managed to setcap
+            # but we fail to execute apps.plugin
+            # trigger setuid to root
+            "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/apps.plugin" -v >/dev/null 2>&1
+            setcap_ret=$?
+        fi
     fi
 
     if [ ${setcap_ret} -ne 0 ]
@@ -1334,6 +1347,25 @@ if [ $? -eq 0 -a "${NETDATA_ADDED_TO_NGINX}" = "1" ]
     echo "   gpasswd -d netdata nginx"
 fi
 
+getent group varnish > /dev/null
+if [ $? -eq 0 -a "${NETDATA_ADDED_TO_VARNISH}" = "1" ]
+    then
+    echo
+    echo "You may also want to remove the netdata user from the varnish group"
+    echo "by running:"
+    echo "   gpasswd -d netdata varnish"
+fi
+
+getent group haproxy > /dev/null
+if [ $? -eq 0 -a "${NETDATA_ADDED_TO_HAPROXY}" = "1" ]
+    then
+    echo
+    echo "You may also want to remove the netdata user from the haproxy group"
+    echo "by running:"
+    echo "   gpasswd -d netdata haproxy"
+fi
+
+
 UNINSTALL
 chmod 750 netdata-uninstaller.sh