# 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
Enable/disable the FreeIPMI plugin.
Default: enable it when libipmimonitoring is available.
+ --enable-lto
+ --disable-lto
+
+ Enable/disable Link-Time-Optimization
+ Default: enabled
+
--zlib-is-really-here
--libs-are-really-here
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
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
then
NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS} --disable-plugin-freeipmi"
shift 1
+ elif [ "$1" = "--enable-lto" ]
+ then
+ NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS} --enable-lto"
+ shift 1
+ elif [ "$1" = "--disable-lto" ]
+ then
+ NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS} --disable-lto"
+ shift 1
elif [ "$1" = "--help" -o "$1" = "-h" ]
then
usage
NETDATA_ADDED_TO_VARNISH=0
NETDATA_ADDED_TO_HAPROXY=0
NETDATA_ADDED_TO_ADM=0
+NETDATA_ADDED_TO_NSD=0
if [ ${UID} -eq 0 ]
then
portable_add_group netdata
portable_add_user_to_group varnish netdata && NETDATA_ADDED_TO_VARNISH=1
portable_add_user_to_group haproxy netdata && NETDATA_ADDED_TO_HAPROXY=1
portable_add_user_to_group adm netdata && NETDATA_ADDED_TO_ADM=1
+ portable_add_user_to_group nsd netdata && NETDATA_ADDED_TO_NSD=1
run_ok
else
run_failed "The installer does not run as root."
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 {} \;
echo " gpasswd -d netdata adm"
fi
+getent group nsd > /dev/null
+if [ $? -eq 0 -a "${NETDATA_ADDED_TO_NSD}" = "1" ]
+ then
+ echo
+ echo "You may also want to remove the netdata user from the nsd group"
+ echo "by running:"
+ echo " gpasswd -d netdata nsd"
+fi
+
UNINSTALL
chmod 750 netdata-uninstaller.sh