From d4dd00f58a502c9ca4b63e36ce6bc7a9945dc63c Mon Sep 17 00:00:00 2001 From: Federico Ceratto Date: Tue, 27 Mar 2018 22:28:21 +0100 Subject: New upstream version 1.10.0+dfsg --- makeself/build-x86_64-static.sh | 4 +-- makeself/functions.sh | 21 ++++++------ makeself/install-or-update.sh | 61 +++++++++++++++++++++++++++++---- makeself/jobs/50-bash-4.4.install.sh | 2 +- makeself/jobs/50-curl-7.53.1.install.sh | 2 +- makeself/jobs/50-fping-4.0.install.sh | 2 +- makeself/jobs/70-netdata-git.install.sh | 1 + 7 files changed, 71 insertions(+), 22 deletions(-) (limited to 'makeself') diff --git a/makeself/build-x86_64-static.sh b/makeself/build-x86_64-static.sh index 8c84039f3..357666093 100755 --- a/makeself/build-x86_64-static.sh +++ b/makeself/build-x86_64-static.sh @@ -4,7 +4,7 @@ set -e -DOCKER_CONTAINER_NAME="netdata-package-x86_64-static" +DOCKER_CONTAINER_NAME="netdata-package-x86_64-static-alpine37" if ! sudo docker inspect "${DOCKER_CONTAINER_NAME}" >/dev/null 2>&1 then @@ -21,7 +21,7 @@ then # inside the container and runs the script install-alpine-packages.sh # (also inside the container) # - run sudo docker run -v $(pwd):/usr/src/netdata.git:rw alpine:3.6 \ + run sudo docker run -v $(pwd):/usr/src/netdata.git:rw alpine:3.7 \ /bin/sh /usr/src/netdata.git/makeself/install-alpine-packages.sh # save the changes made permanently diff --git a/makeself/functions.sh b/makeself/functions.sh index a72a1f411..839fc3226 100755 --- a/makeself/functions.sh +++ b/makeself/functions.sh @@ -8,8 +8,6 @@ [ -z "${NETDATA_MAKESELF_PATH}" ] && export NETDATA_MAKESELF_PATH="$(dirname "${0}")/.." [ "${NETDATA_MAKESELF_PATH:0:1}" != "/" ] && export NETDATA_MAKESELF_PATH="$(pwd)/${NETDATA_MAKESELF_PATH}" [ -z "${NETDATA_SOURCE_PATH}" ] && export NETDATA_SOURCE_PATH="${NETDATA_MAKESELF_PATH}/.." -[ -z "${PROCESSORS}" ] && export PROCESSORS=$(grep -c ^processor /proc/cpuinfo) -[ -z "${PROCESSORS}" -o $((PROCESSORS)) -lt 1 ] && export PROCESSORS=1 export NULL= # make sure the path does not end with / @@ -21,14 +19,7 @@ fi # find the parent directory export NETDATA_INSTALL_PARENT="$(dirname "${NETDATA_INSTALL_PATH}")" - -# debug -echo "ME=${0}" -echo "NETDATA_INSTALL_PARENT=${NETDATA_INSTALL_PARENT}" -echo "NETDATA_INSTALL_PATH=${NETDATA_INSTALL_PATH}" -echo "NETDATA_MAKESELF_PATH=${NETDATA_MAKESELF_PATH}" -echo "NETDATA_SOURCE_PATH=${NETDATA_SOURCE_PATH}" -echo "PROCESSORS=${PROCESSORS}" +# ----------------------------------------------------------------------------- # bash strict mode set -euo pipefail @@ -58,3 +49,13 @@ fetch() { # load the functions of the netdata-installer.sh . "${NETDATA_SOURCE_PATH}/installer/functions.sh" + +# ----------------------------------------------------------------------------- + +# debug +echo "ME=${0}" +echo "NETDATA_INSTALL_PARENT=${NETDATA_INSTALL_PARENT}" +echo "NETDATA_INSTALL_PATH=${NETDATA_INSTALL_PATH}" +echo "NETDATA_MAKESELF_PATH=${NETDATA_MAKESELF_PATH}" +echo "NETDATA_SOURCE_PATH=${NETDATA_SOURCE_PATH}" +echo "PROCESSORS=${SYSTEM_CPUS}" diff --git a/makeself/install-or-update.sh b/makeself/install-or-update.sh index 34630cf16..eed2bc301 100755 --- a/makeself/install-or-update.sh +++ b/makeself/install-or-update.sh @@ -8,6 +8,21 @@ umask 002 # Be nice on production environments renice 19 $$ >/dev/null 2>/dev/null +# ----------------------------------------------------------------------------- + +STARTIT=1 + +while [ ! -z "${1}" ] +do + if [ "${1}" = "--dont-start-it" ] + then + STARTIT=0 + else + echo >&2 "Unknown option '${1}'. Ignoring it." + fi + shift +done + # ----------------------------------------------------------------------------- progress "Checking new configuration files" @@ -70,7 +85,7 @@ progress "Add user netdata to required user groups" NETDATA_USER="root" NETDATA_GROUP="root" -add_netdata_user_and_group +add_netdata_user_and_group "/opt/netdata" if [ $? -eq 0 ] then NETDATA_USER="netdata" @@ -80,6 +95,29 @@ else fi +# ----------------------------------------------------------------------------- +progress "Check SSL certificates paths" + +if [ ! -f "/etc/ssl/certs/ca-certificates.crt" ] +then + if [ ! -f /opt/netdata/.curlrc ] + then + cacert= + + # CentOS + [ -f "/etc/ssl/certs/ca-bundle.crt" ] && cacert="/etc/ssl/certs/ca-bundle.crt" + + if [ ! -z "${cacert}" ] + then + echo "Creating /opt/netdata/.curlrc with cacert=${cacert}" + echo >/opt/netdata/.curlrc "cacert=${cacert}" + else + run_failed "Failed to find /etc/ssl/certs/ca-certificates.crt" + fi + fi +fi + + # ----------------------------------------------------------------------------- progress "Install logrotate configuration for netdata" @@ -136,6 +174,7 @@ run chown -R ${NETDATA_USER}:${NETDATA_GROUP} /opt/netdata # ----------------------------------------------------------------------------- + progress "fix plugin permissions" for x in apps.plugin freeipmi.plugin cgroup-network @@ -156,14 +195,22 @@ then run chmod 4750 bin/fping fi + # ----------------------------------------------------------------------------- -progress "starting netdata" -restart_netdata "/opt/netdata/bin/netdata" -if [ $? -eq 0 ] - then - download_netdata_conf "${NETDATA_USER}:${NETDATA_GROUP}" "/opt/netdata/etc/netdata/netdata.conf" "http://localhost:19999/netdata.conf" - netdata_banner "is installed and running now!" +if [ ${STARTIT} -eq 1 ] +then + progress "starting netdata" + + restart_netdata "/opt/netdata/bin/netdata" + if [ $? -eq 0 ] + then + download_netdata_conf "${NETDATA_USER}:${NETDATA_GROUP}" "/opt/netdata/etc/netdata/netdata.conf" "http://localhost:19999/netdata.conf" + netdata_banner "is installed and running now!" + else + generate_netdata_conf "${NETDATA_USER}:${NETDATA_GROUP}" "/opt/netdata/etc/netdata/netdata.conf" "http://localhost:19999/netdata.conf" + netdata_banner "is installed now!" + fi else generate_netdata_conf "${NETDATA_USER}:${NETDATA_GROUP}" "/opt/netdata/etc/netdata/netdata.conf" "http://localhost:19999/netdata.conf" netdata_banner "is installed now!" diff --git a/makeself/jobs/50-bash-4.4.install.sh b/makeself/jobs/50-bash-4.4.install.sh index 8019cefb7..7868a1e76 100755 --- a/makeself/jobs/50-bash-4.4.install.sh +++ b/makeself/jobs/50-bash-4.4.install.sh @@ -34,7 +34,7 @@ run ./configure \ run make clean -run make -j${PROCESSORS} +run make -j${SYSTEM_CPUS} cat >examples/loadables/Makefile <