summaryrefslogtreecommitdiffstats
path: root/makeself
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xmakeself/install-or-update.sh2
-rwxr-xr-xmakeself/jobs/70-netdata-git.install.sh8
-rwxr-xr-xmakeself/jobs/99-makeself.install.sh95
-rwxr-xr-xmakeself/makeself-header.sh5
-rw-r--r--makeself/makeself.lsm2
-rwxr-xr-xmakeself/makeself.sh8
6 files changed, 72 insertions, 48 deletions
diff --git a/makeself/install-or-update.sh b/makeself/install-or-update.sh
index b64e7be3..34630cf1 100755
--- a/makeself/install-or-update.sh
+++ b/makeself/install-or-update.sh
@@ -162,7 +162,9 @@ 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
diff --git a/makeself/jobs/70-netdata-git.install.sh b/makeself/jobs/70-netdata-git.install.sh
index 0486ce11..b8548149 100755
--- a/makeself/jobs/70-netdata-git.install.sh
+++ b/makeself/jobs/70-netdata-git.install.sh
@@ -11,6 +11,13 @@ else
export CFLAGS="-static -O1 -ggdb -Wall -Wextra -Wformat-signedness -fstack-protector-all -D_FORTIFY_SOURCE=2 -DNETDATA_INTERNAL_CHECKS=1"
fi
+if [ ! -z "${NETDATA_INSTALL_PATH}" -a -d "${NETDATA_INSTALL_PATH}/etc" ]
+ then
+ # make sure we don't have an old etc path, so that the installer
+ # will install all files without examining changes
+ run mv "${NETDATA_INSTALL_PATH}/etc" "${NETDATA_INSTALL_PATH}/etc.new"
+fi
+
run ./netdata-installer.sh --install "${NETDATA_INSTALL_PARENT}" \
--dont-wait \
--dont-start-it \
@@ -20,4 +27,5 @@ if [ ${NETDATA_BUILD_WITH_DEBUG} -eq 0 ]
then
run strip ${NETDATA_INSTALL_PATH}/bin/netdata
run strip ${NETDATA_INSTALL_PATH}/usr/libexec/netdata/plugins.d/apps.plugin
+ run strip ${NETDATA_INSTALL_PATH}/usr/libexec/netdata/plugins.d/cgroup-network
fi
diff --git a/makeself/jobs/99-makeself.install.sh b/makeself/jobs/99-makeself.install.sh
index 465a3195..698f2f92 100755
--- a/makeself/jobs/99-makeself.install.sh
+++ b/makeself/jobs/99-makeself.install.sh
@@ -2,14 +2,46 @@
. $(dirname "${0}")/../functions.sh "${@}" || exit 1
+run cd "${NETDATA_SOURCE_PATH}" || exit 1
+
+# -----------------------------------------------------------------------------
+# find the netdata version
+
+NOWNER="unknown"
+ORIGIN="$(git config --get remote.origin.url || echo "unknown")"
+if [[ "${ORIGIN}" =~ ^git@github.com:.*/netdata.*$ ]]
+ then
+ NOWNER="${ORIGIN/git@github.com:/}"
+ NOWNER="${NOWNER/\/netdata*/}"
+
+elif [[ "${ORIGIN}" =~ ^https://github.com/.*/netdata.*$ ]]
+ then
+ NOWNER="${ORIGIN/https:\/\/github.com\//}"
+ NOWNER="${NOWNER/\/netdata*/}"
+fi
+
+# make sure it does not have any slashes in it
+NOWNER="${NOWNER//\//_}"
+
+if [ "${NOWNER}" = "firehol" ]
+ then
+ NOWNER=
+else
+ NOWNER="-${NOWNER}"
+fi
+
+VERSION="$(git describe || echo "undefined")"
+[ -z "${VERSION}" ] && VERSION="undefined"
+
+FILE_VERSION="${VERSION}-$(uname -m)-$(date +"%Y%m%d-%H%M%S")${NOWNER}"
+
# -----------------------------------------------------------------------------
# copy the files needed by makeself installation
run mkdir -p "${NETDATA_INSTALL_PATH}/system"
-run cd "${NETDATA_SOURCE_PATH}" || exit 1
-cp \
+run cp \
makeself/post-installer.sh \
makeself/install-or-update.sh \
installer/functions.sh \
@@ -25,9 +57,9 @@ cp \
# -----------------------------------------------------------------------------
# create a wrapper to start our netdata with a modified path
-mkdir -p "${NETDATA_INSTALL_PATH}/bin/srv"
+run mkdir -p "${NETDATA_INSTALL_PATH}/bin/srv"
-mv "${NETDATA_INSTALL_PATH}/bin/netdata" \
+run mv "${NETDATA_INSTALL_PATH}/bin/netdata" \
"${NETDATA_INSTALL_PATH}/bin/srv/netdata" || exit 1
cat >"${NETDATA_INSTALL_PATH}/bin/netdata" <<EOF
@@ -35,28 +67,34 @@ cat >"${NETDATA_INSTALL_PATH}/bin/netdata" <<EOF
export PATH="${NETDATA_INSTALL_PATH}/bin:\${PATH}"
exec "${NETDATA_INSTALL_PATH}/bin/srv/netdata" "\${@}"
EOF
-chmod 755 "${NETDATA_INSTALL_PATH}/bin/netdata"
+run chmod 755 "${NETDATA_INSTALL_PATH}/bin/netdata"
# -----------------------------------------------------------------------------
# move etc to protect the destination when unpacked
-if [ -d "${NETDATA_INSTALL_PATH}/etc" ]
+if [ ! -z "${NETDATA_INSTALL_PATH}" -a -d "${NETDATA_INSTALL_PATH}/etc" ]
then
if [ -d "${NETDATA_INSTALL_PATH}/etc.new" ]
then
- rm -rf "${NETDATA_INSTALL_PATH}/etc.new" || exit 1
+ run rm -rf "${NETDATA_INSTALL_PATH}/etc.new" || exit 1
fi
- mv "${NETDATA_INSTALL_PATH}/etc" \
+ run mv "${NETDATA_INSTALL_PATH}/etc" \
"${NETDATA_INSTALL_PATH}/etc.new" || exit 1
+
+ if [ -f "${NETDATA_INSTALL_PATH}/etc.new/netdata/netdata.conf" ]
+ then
+ # delete the generated netdata.conf, so that the static installer will generate a new one
+ run rm "${NETDATA_INSTALL_PATH}/etc.new/netdata/netdata.conf"
+ fi
fi
# -----------------------------------------------------------------------------
# remove the links to allow untaring the archive
-rm "${NETDATA_INSTALL_PATH}/sbin" \
+run rm "${NETDATA_INSTALL_PATH}/sbin" \
"${NETDATA_INSTALL_PATH}/usr/bin" \
"${NETDATA_INSTALL_PATH}/usr/sbin" \
"${NETDATA_INSTALL_PATH}/usr/local"
@@ -65,14 +103,16 @@ rm "${NETDATA_INSTALL_PATH}/sbin" \
# -----------------------------------------------------------------------------
# create the makeself archive
-"${NETDATA_MAKESELF_PATH}/makeself.sh" \
+run sed "s|NETDATA_VERSION|${FILE_VERSION}|g" <"${NETDATA_MAKESELF_PATH}/makeself.lsm" >"${NETDATA_MAKESELF_PATH}/makeself.lsm.tmp"
+
+run "${NETDATA_MAKESELF_PATH}/makeself.sh" \
--gzip \
--complevel 9 \
--notemp \
--needroot \
--target "${NETDATA_INSTALL_PATH}" \
--header "${NETDATA_MAKESELF_PATH}/makeself-header.sh" \
- --lsm "${NETDATA_MAKESELF_PATH}/makeself.lsm" \
+ --lsm "${NETDATA_MAKESELF_PATH}/makeself.lsm.tmp" \
--license "${NETDATA_MAKESELF_PATH}/makeself-license.txt" \
--help-header "${NETDATA_MAKESELF_PATH}/makeself-help-header.txt" \
"${NETDATA_INSTALL_PATH}" \
@@ -81,41 +121,16 @@ rm "${NETDATA_INSTALL_PATH}/sbin" \
./system/post-installer.sh \
${NULL}
+run rm "${NETDATA_MAKESELF_PATH}/makeself.lsm.tmp"
# -----------------------------------------------------------------------------
# copy it to the netdata build dir
-NOWNER="unknown"
-ORIGIN="$(git config --get remote.origin.url || echo "unknown")"
-if [[ "${ORIGIN}" =~ ^git@github.com:.*/netdata.*$ ]]
- then
- NOWNER="${ORIGIN/git@github.com:/}"
- NOWNER="${NOWNER/\/netdata*/}"
-
-elif [[ "${ORIGIN}" =~ ^https://github.com/.*/netdata.*$ ]]
- then
- NOWNER="${ORIGIN/https:\/\/github.com\//}"
- NOWNER="${NOWNER/\/netdata*/}"
-fi
-
-# make sure it does not have any slashes in it
-NOWNER="${NOWNER//\//_}"
-
-if [ "${NOWNER}" = "firehol" ]
- then
- NOWNER=
-else
- NOWNER="-${NOWNER}"
-fi
-
-VERSION="$(git describe || echo "undefined")"
-[ -z "${VERSION}" ] && VERSION="undefined"
-
-FILE="netdata-${VERSION}-$(uname -m)-$(date +"%Y%m%d-%H%M%S")${NOWNER}.gz.run"
+FILE="netdata-${FILE_VERSION}.gz.run"
-cp "${NETDATA_INSTALL_PATH}.gz.run" "${FILE}"
+run cp "${NETDATA_INSTALL_PATH}.gz.run" "${FILE}"
echo >&2 "Self-extracting installer copied to '${FILE}'"
[ -f netdata-latest.gz.run ] && rm netdata-latest.gz.run
-ln -s "${FILE}" netdata-latest.gz.run
+run ln -s "${FILE}" netdata-latest.gz.run
echo >&2 "Self-extracting installer linked to 'netdata-latest.gz.run'"
diff --git a/makeself/makeself-header.sh b/makeself/makeself-header.sh
index 93d937b3..83131a17 100755
--- a/makeself/makeself-header.sh
+++ b/makeself/makeself-header.sh
@@ -218,10 +218,9 @@ MS_Check()
UnTAR()
{
if test x"\$quiet" = xn; then
- tar \$1 "$UNTAR_EXTRA" -vf - 2>&1 || { echo Extraction failed. > /dev/tty; kill -15 \$$; }
+ tar \$1vf - $UNTAR_EXTRA 2>&1 || { echo " ... Extraction failed." > /dev/tty; kill -15 \$$; }
else
-
- tar \$1 "$UNTAR_EXTRA" -f - 2>&1 || { echo Extraction failed. > /dev/tty; kill -15 \$$; }
+ tar \$1f - $UNTAR_EXTRA 2>&1 || { echo Extraction failed. > /dev/tty; kill -15 \$$; }
fi
}
diff --git a/makeself/makeself.lsm b/makeself/makeself.lsm
index 02679629..6bd4703d 100644
--- a/makeself/makeself.lsm
+++ b/makeself/makeself.lsm
@@ -1,6 +1,6 @@
Begin3
Title: netdata
-Version: 1.6.0
+Version: NETDATA_VERSION
Description: netdata is a system for distributed real-time performance and health monitoring.
It provides unparalleled insights, in real-time, of everything happening on the
system it runs (including applications such as web and database servers), using
diff --git a/makeself/makeself.sh b/makeself/makeself.sh
index 709473aa..2ce37a24 100755
--- a/makeself/makeself.sh
+++ b/makeself/makeself.sh
@@ -470,8 +470,8 @@ gpg-asymmetric)
GUNZIP_CMD="gpg --yes -d"
;;
openssl)
- GZIP_CMD="openssl aes-256-cbc -a -salt"
- GUNZIP_CMD="openssl aes-256-cbc -d -a"
+ GZIP_CMD="openssl aes-256-cbc -a -salt -md sha256"
+ GUNZIP_CMD="openssl aes-256-cbc -d -a -md sha256"
;;
Unix)
GZIP_CMD="compress -cf"
@@ -529,7 +529,8 @@ if test "$QUIET" = "n";then
echo Adding files to archive named \"$archname\"...
fi
exec 3<> "$tmpfile"
-(cd "$archdir" && ( tar "$TAR_EXTRA" -$TAR_ARGS - . | eval "$GZIP_CMD" >&3 ) ) || { echo Aborting: Archive directory not found or temporary file: "$tmpfile" could not be created.; exec 3>&-; rm -f "$tmpfile"; exit 1; }
+( cd "$archdir" && ( tar $TAR_EXTRA -$TAR_ARGS - . | eval "$GZIP_CMD" >&3 ) ) || \
+ { echo Aborting: archive directory not found or temporary file: "$tmpfile" could not be created.; exec 3>&-; rm -f "$tmpfile"; exit 1; }
exec 3>&- # try to close the archive
fsize=`cat "$tmpfile" | wc -c | tr -d " "`
@@ -617,4 +618,3 @@ else
fi
fi
rm -f "$tmpfile"
-