summaryrefslogtreecommitdiffstats
path: root/makeself
diff options
context:
space:
mode:
authorFederico Ceratto <federico.ceratto@gmail.com>2018-03-27 21:28:21 +0000
committerFederico Ceratto <federico.ceratto@gmail.com>2018-03-27 21:28:21 +0000
commitd4dd00f58a502c9ca4b63e36ce6bc7a9945dc63c (patch)
treefaac99f51f182bb8c0a03e95e393d421ac9ddf42 /makeself
parentNew upstream version 1.9.0+dfsg (diff)
downloadnetdata-d4dd00f58a502c9ca4b63e36ce6bc7a9945dc63c.tar.xz
netdata-d4dd00f58a502c9ca4b63e36ce6bc7a9945dc63c.zip
New upstream version 1.10.0+dfsgupstream/1.10.0+dfsg
Diffstat (limited to '')
-rwxr-xr-xmakeself/build-x86_64-static.sh4
-rwxr-xr-xmakeself/functions.sh21
-rwxr-xr-xmakeself/install-or-update.sh61
-rwxr-xr-xmakeself/jobs/50-bash-4.4.install.sh2
-rwxr-xr-xmakeself/jobs/50-curl-7.53.1.install.sh2
-rwxr-xr-xmakeself/jobs/50-fping-4.0.install.sh2
-rwxr-xr-xmakeself/jobs/70-netdata-git.install.sh1
7 files changed, 71 insertions, 22 deletions
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"
@@ -81,6 +96,29 @@ 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"
install_netdata_logrotate || run_failed "Cannot install logrotate file 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 <<EOF
all:
diff --git a/makeself/jobs/50-curl-7.53.1.install.sh b/makeself/jobs/50-curl-7.53.1.install.sh
index 038fb2ac9..ea80f0d2c 100755
--- a/makeself/jobs/50-curl-7.53.1.install.sh
+++ b/makeself/jobs/50-curl-7.53.1.install.sh
@@ -24,7 +24,7 @@ run ./configure \
run sed -i -e "s/curl_LDFLAGS =/curl_LDFLAGS = -all-static/" src/Makefile
run make clean
-run make -j${PROCESSORS}
+run make -j${SYSTEM_CPUS}
run make install
if [ ${NETDATA_BUILD_WITH_DEBUG} -eq 0 ]
diff --git a/makeself/jobs/50-fping-4.0.install.sh b/makeself/jobs/50-fping-4.0.install.sh
index ce6cb270e..2e22ebf8d 100755
--- a/makeself/jobs/50-fping-4.0.install.sh
+++ b/makeself/jobs/50-fping-4.0.install.sh
@@ -19,7 +19,7 @@ install:
EOF
run make clean
-run make -j${PROCESSORS}
+run make -j${SYSTEM_CPUS}
run make install
if [ ${NETDATA_BUILD_WITH_DEBUG} -eq 0 ]
diff --git a/makeself/jobs/70-netdata-git.install.sh b/makeself/jobs/70-netdata-git.install.sh
index b85481492..fea3a88bd 100755
--- a/makeself/jobs/70-netdata-git.install.sh
+++ b/makeself/jobs/70-netdata-git.install.sh
@@ -9,6 +9,7 @@ then
export CFLAGS="-static -O3"
else
export CFLAGS="-static -O1 -ggdb -Wall -Wextra -Wformat-signedness -fstack-protector-all -D_FORTIFY_SOURCE=2 -DNETDATA_INTERNAL_CHECKS=1"
+# export CFLAGS="-static -O1 -ggdb -Wall -Wextra -Wformat-signedness"
fi
if [ ! -z "${NETDATA_INSTALL_PATH}" -a -d "${NETDATA_INSTALL_PATH}/etc" ]