]> arthur.barton.de Git - netdata.git/blobdiff - netdata-installer.sh
Merge pull request #1891 from ktsaou/master
[netdata.git] / netdata-installer.sh
index 680772c7ec489b2333ad117217f648aacd3f2fda..9957e95b59003343f34947ef49b62f5a57cfbd85 100755 (executable)
@@ -49,7 +49,7 @@ umask 002
 # Be nice on production environments
 renice 19 $$ >/dev/null 2>/dev/null
 
-processors=$(grep ^processor </proc/cpuinfo 2>/dev/null | wc -l)
+processors=$(cat /proc/cpuinfo 2>/dev/null | grep ^processor | wc -l)
 [ $(( processors )) -lt 1 ] && processors=1
 
 # you can set CFLAGS before running installer
@@ -99,8 +99,10 @@ Valid <installer options> are:
         Start immediately building it.
 
    --enable-plugin-freeipmi
+   --disable-plugin-freeipmi
 
-        Enable the FreeIPMI plugin.
+        Enable/disable the FreeIPMI plugin.
+        Default: enable it when libipmimonitoring is available.
 
    --zlib-is-really-here
    --libs-are-really-here
@@ -129,7 +131,7 @@ For the plugins, you will at least need:
 USAGE
 }
 
-md5sum="$(which md5sum 2>/dev/null || command -v md5sum 2>/dev/null)"
+md5sum="$(which md5sum 2>/dev/null || command -v md5sum 2>/dev/null || command -v md5 2>/dev/null)"
 get_git_config_signatures() {
     local x s file md5
 
@@ -145,7 +147,7 @@ get_git_config_signatures() {
             for c in $(git log --follow "conf.d/${x}" | grep ^commit | cut -d ' ' -f 2)
             do
                     git checkout ${c} "conf.d/${x}" || continue
-                    s="$(cat "conf.d/${x}" | md5sum | cut -d ' ' -f 1)"
+                    s="$(cat "conf.d/${x}" | ${md5sum} | cut -d ' ' -f 1)"
                     echo >>configs.signatures.tmp "${s}:${x}"
                     echo "    ${s}"
             done
@@ -193,6 +195,10 @@ do
         then
         NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS} --enable-plugin-freeipmi"
         shift 1
+    elif [ "$1" = "--disable-plugin-freeipmi" ]
+        then
+        NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS} --disable-plugin-freeipmi"
+        shift 1
     elif [ "$1" = "--help" -o "$1" = "-h" ]
         then
         usage
@@ -714,7 +720,13 @@ run chmod 755 "${NETDATA_LOG_DIR}"
 
 if [ ${UID} -eq 0 ]
     then
-    run chown "${NETDATA_USER}:root" "${NETDATA_LOG_DIR}"
+    # find the admin group
+    admin_group=
+    test -z "${admin_group}" && getent group root >/dev/null 2>&1 && admin_group="root"
+    test -z "${admin_group}" && getent group daemon >/dev/null 2>&1 && admin_group="daemon"
+    test -z "${admin_group}" && admin_group="${NETDATA_USER}"
+
+    run chown "${NETDATA_USER}:${admin_group}" "${NETDATA_LOG_DIR}"
     run chown -R root "${NETDATA_PREFIX}/usr/libexec/netdata"
     run find "${NETDATA_PREFIX}/usr/libexec/netdata" -type d -exec chmod 0755 {} \;
     run find "${NETDATA_PREFIX}/usr/libexec/netdata" -type f -exec chmod 0644 {} \;