summaryrefslogtreecommitdiffstats
path: root/netdata-installer.sh
diff options
context:
space:
mode:
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>2017-03-04 23:47:09 +0200
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>2017-03-04 23:47:09 +0200
commit89c66bc7389a037231eebc0085bb1d083aaac469 (patch)
tree61fac67f54a790848c23b8a45411478fa083d381 /netdata-installer.sh
parentacba169f8c294db344b8ef2b62881a7da519e38f (diff)
fix minor installer issues on freebsd
Diffstat (limited to 'netdata-installer.sh')
-rwxr-xr-xnetdata-installer.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/netdata-installer.sh b/netdata-installer.sh
index 408e3f3dfc..b078ac6d5f 100755
--- a/netdata-installer.sh
+++ b/netdata-installer.sh
@@ -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
@@ -720,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 {} \;