diff options
Diffstat (limited to '')
-rw-r--r-- | packaging/installer/README.md | 37 | ||||
-rw-r--r-- | packaging/installer/functions.sh | 43 | ||||
-rwxr-xr-x | packaging/installer/kickstart-static64.sh | 2 | ||||
-rwxr-xr-x | packaging/installer/kickstart.sh | 10 | ||||
-rwxr-xr-x | packaging/installer/netdata-uninstaller.sh | 2 | ||||
-rwxr-xr-x | packaging/installer/netdata-updater.sh | 4 |
6 files changed, 64 insertions, 34 deletions
diff --git a/packaging/installer/README.md b/packaging/installer/README.md index 6dc084e83..b10ffa05a 100644 --- a/packaging/installer/README.md +++ b/packaging/installer/README.md @@ -20,6 +20,8 @@ The best way to install Netdata is directly from source. Our **automatic install See also the list of Netdata [package maintainers](../maintainers) for ASUSTOR NAS, OpenWRT, ReadyNAS, etc. +Note: From Netdata v1.12 and above, anonymous usage information is collected by default and sent to Google Analytics. To read more about the information collected and how to opt-out, check the [anonymous statistics page](../../docs/anonymous-statistics.md). + --- ## One line installation @@ -42,7 +44,7 @@ bash <(curl -Ss https://my-netdata.io/kickstart.sh) Verify the integrity of the script with this: ```bash -[ "fe451cd039c8f99b2ba4ca0feab88033" = "$(curl -Ss https://my-netdata.io/kickstart.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID" +[ "8a2b054081a108dff915994ce77f2f2d" = "$(curl -Ss https://my-netdata.io/kickstart.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID" ``` *It should print `OK, VALID` if the script is the one we ship.* @@ -99,7 +101,7 @@ To install Netdata with a binary package on any Linux distro, any kernel version Verify the integrity of the script with this: ```bash -[ "9ff4f5f37d23dff431f80d5349e0a25c" = "$(curl -Ss https://my-netdata.io/kickstart-static64.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID" +[ "8779d8717ccaa8dac18d599502eef591" = "$(curl -Ss https://my-netdata.io/kickstart-static64.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID" ``` *It should print `OK, VALID` if the script is the one we ship.* @@ -163,13 +165,25 @@ To install the latest git version of Netdata, please follow these 2 steps: Try our experimental automatic requirements installer (no need to be root). This will try to find the packages that should be installed on your system to build and run Netdata. It supports most major Linux distributions released after 2010: -- **Alpine** Linux and its derivatives (you have to install `bash` yourself, before using the installer) -- **Arch** Linux and its derivatives -- **Gentoo** Linux and its derivatives -- **Debian** Linux and its derivatives (including **Ubuntu**, **Mint**) -- **Fedora** and its derivatives (including **Red Hat Enterprise Linux**, **CentOS**, **Amazon Machine Image**) -- **SuSe** Linux and its derivatives (including **openSuSe**) -- **SLE12** Must have your system registered with Suse Customer Center or have the DVD. See [#1162](https://github.com/netdata/netdata/issues/1162) +* **Alpine** Linux and its derivatives + * You have to install `bash` yourself, before using the installer. + +* **Arch** Linux and its derivatives + * You need arch/aur for package Judy. + +* **Gentoo** Linux and its derivatives + +* **Debian** Linux and its derivatives (including **Ubuntu**, **Mint**) + +* **Redhat Enterprise Linux** and its derivatives (including **Fedora**, **CentOS**, **Amazon Machine Image**) + * Please note that for RHEL/CentOS you need + [EPEL](http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/). + In addition, RHEL/CentOS version 6 also need + [OKay](https://okay.com.mx/blog-news/rpm-repositories-for-centos-6-and-7.html) for package libuv version 1. + +* **SuSe** Linux and its derivatives (including **openSuSe**) + +* **SLE12** Must have your system registered with Suse Customer Center or have the DVD. See [#1162](https://github.com/netdata/netdata/issues/1162) Install the packages for having a **basic Netdata installation** (system monitoring and many applications, without `mysql` / `mariadb`, `postgres`, `named`, hardware sensors and `SNMP`): @@ -199,9 +213,10 @@ dnf install zlib-devel libuuid-devel libuv-devel lz4-devel Judy-devel openssl-de # CentOS / Red Hat Enterprise Linux yum install autoconf automake curl gcc git libmnl-devel libuuid-devel openssl-devel libuv-devel lz4-devel Judy-devel lm_sensors make MySQL-python nc pkgconfig python python-psycopg2 PyYAML zlib-devel -``` +# openSUSE +zypper install zlib-devel libuuid-devel libuv-devel liblz4-devel judy-devel libopenssl-devel libmnl-devel gcc make git autoconf autoconf-archive autogen automake pkgconfig curl findutils -Please note that for RHEL/CentOS you might need [EPEL](http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/). +``` Once Netdata is compiled, to run it the following packages are required (already installed using the above commands): diff --git a/packaging/installer/functions.sh b/packaging/installer/functions.sh index d1e944878..6f9996906 100644 --- a/packaging/installer/functions.sh +++ b/packaging/installer/functions.sh @@ -303,7 +303,7 @@ install_non_systemd_init() { run rc-update add netdata default && return 0 - elif [ "${key}" = "debian-7" ] || [ "${key}" = "ubuntu-12.04" ] || [ "${key}" = "ubuntu-14.04" ]; then + elif [ "${key}" =~ ^devuan* ] || [ "${key}" = "debian-7" ] || [ "${key}" = "ubuntu-12.04" ] || [ "${key}" = "ubuntu-14.04" ]; then echo >&2 "Installing LSB init file..." run cp system/netdata-lsb /etc/init.d/netdata && run chmod 755 /etc/init.d/netdata && @@ -332,6 +332,8 @@ install_non_systemd_init() { NETDATA_START_CMD="netdata" NETDATA_STOP_CMD="killall netdata" +NETDATA_INSTALLER_START_CMD="${NETDATA_START_CMD}" +NETDATA_INSTALLER_STOP_CMD="${NETDATA_STOP_CMD}" install_netdata_service() { local uname="$(uname 2>/dev/null)" @@ -351,15 +353,23 @@ install_netdata_service() { elif [ "${uname}" = "FreeBSD" ]; then - run cp system/netdata-freebsd /etc/rc.d/netdata && - NETDATA_START_CMD="service netdata start" && - NETDATA_STOP_CMD="service netdata stop" && - return 0 + run cp system/netdata-freebsd /etc/rc.d/netdata && NETDATA_START_CMD="service netdata start" && + NETDATA_STOP_CMD="service netdata stop" && + NETDATA_INSTALLER_START_CMD="service netdata onestart" && + NETDATA_INSTALLER_STOP_CMD="${NETDATA_STOP_CMD}" + myret=$? + + echo >&2 "Note: To explicitly enable netdata automatic start, set 'netdata_enable' to 'YES' in /etc/rc.conf" + echo >&2 "" + + return ${myret} elif issystemd; then # systemd is running on this system NETDATA_START_CMD="systemctl start netdata" NETDATA_STOP_CMD="systemctl stop netdata" + NETDATA_INSTALLER_START_CMD="${NETDATA_START_CMD}" + NETDATA_INSTALLER_STOP_CMD="${NETDATA_STOP_CMD}" SYSTEMD_DIRECTORY="" @@ -390,6 +400,8 @@ install_netdata_service() { NETDATA_START_CMD="rc-service netdata start" NETDATA_STOP_CMD="rc-service netdata stop" fi + NETDATA_INSTALLER_START_CMD="${NETDATA_START_CMD}" + NETDATA_INSTALLER_STOP_CMD="${NETDATA_STOP_CMD}" fi return ${ret} @@ -429,6 +441,7 @@ stop_netdata_on_pid() { ret=$? test ${ret} -eq 0 && printf >&2 "." && sleep 2 + done echo >&2 @@ -446,8 +459,6 @@ netdata_pids() { myns="$(readlink /proc/self/ns/pid 2>/dev/null)" - # echo >&2 "Stopping a (possibly) running netdata (namespace '${myns}')..." - for p in \ $(cat /var/run/netdata.pid 2>/dev/null) \ $(cat /var/run/netdata/netdata.pid 2>/dev/null) \ @@ -477,12 +488,15 @@ restart_netdata() { local started=0 - progress "Start netdata" + progress "Restarting netdata instance" if [ "${UID}" -eq 0 ]; then - service netdata stop - stop_all_netdata - service netdata restart && started=1 + echo >&2 + echo >&2 "Stopping all netdata threads" + run stop_all_netdata + + echo >&2 "Starting netdata using command '${NETDATA_INSTALLER_START_CMD}'" + run ${NETDATA_INSTALLER_START_CMD} && started=1 if [ ${started} -eq 1 ] && [ -z "$(netdata_pids)" ]; then echo >&2 "Ooops! it seems netdata is not started." @@ -490,7 +504,8 @@ restart_netdata() { fi if [ ${started} -eq 0 ]; then - service netdata start && started=1 + echo >&2 "Attempting another netdata start using command '${NETDATA_INSTALLER_START_CMD}'" + run ${NETDATA_INSTALLER_START_CMD} && started=1 fi fi @@ -500,8 +515,8 @@ restart_netdata() { fi if [ ${started} -eq 0 ]; then - # still not started... - + # still not started... another forced attempt, just run the binary + echo >&2 "Netdata service still not started, attempting another forced restart by running '${netdata} ${@}'" run stop_all_netdata run "${netdata}" "${@}" return $? diff --git a/packaging/installer/kickstart-static64.sh b/packaging/installer/kickstart-static64.sh index 505179051..a9f11238c 100755 --- a/packaging/installer/kickstart-static64.sh +++ b/packaging/installer/kickstart-static64.sh @@ -127,7 +127,7 @@ download() { } set_tarball_urls() { - if [ "$1" == "stable" ]; then + if [ "$1" = "stable" ]; then local latest # Simple version # latest="$(curl -sSL https://api.github.com/repos/netdata/netdata/releases/latest | grep tag_name | cut -d'"' -f4)" diff --git a/packaging/installer/kickstart.sh b/packaging/installer/kickstart.sh index 2db95f21d..d396f139e 100755 --- a/packaging/installer/kickstart.sh +++ b/packaging/installer/kickstart.sh @@ -141,7 +141,7 @@ warning() { create_tmp_directory() { # Check if tmp is mounted as noexec - if grep -Eq '^[^ ]+ /tmp [^ ]+ ([^ ]*,)?noexec[, ]' /proc/mounts; then + if grep -Eq '^[^ ]+ /tmp [^ ]+ ([^ ]*,)?noexec[, ]' /proc/mounts > /dev/null 2>&1; then pattern="$(pwd)/netdata-kickstart-XXXXXX" else pattern="/tmp/netdata-kickstart-XXXXXX" @@ -163,7 +163,7 @@ download() { } set_tarball_urls() { - if [ "$1" == "stable" ]; then + if [ "$1" = "stable" ]; then local latest # Simple version # latest="$(curl -sSL https://api.github.com/repos/netdata/netdata/releases/latest | grep tag_name | cut -d'"' -f4)" @@ -200,9 +200,9 @@ detect_bash4() { } dependencies() { - SYSTEM="$(uname -s)" - OS="$(uname -o)" - MACHINE="$(uname -m)" + SYSTEM="$(uname -s 2> /dev/null || uname -v)" + OS="$(uname -o 2> /dev/null || uname -rs)" + MACHINE="$(uname -m 2> /dev/null)" echo "System : ${SYSTEM}" echo "Operating System : ${OS}" diff --git a/packaging/installer/netdata-uninstaller.sh b/packaging/installer/netdata-uninstaller.sh index cfd858c02..0bbdaac2c 100755 --- a/packaging/installer/netdata-uninstaller.sh +++ b/packaging/installer/netdata-uninstaller.sh @@ -232,7 +232,7 @@ quit_msg() { user_input() { TEXT="$1" - if [ "${INTERACTIVITY}" == "-i" ]; then + if [ "${INTERACTIVITY}" = "-i" ]; then read -r -p "$TEXT" >&2 fi } diff --git a/packaging/installer/netdata-updater.sh b/packaging/installer/netdata-updater.sh index 21a769ba5..83031f3aa 100755 --- a/packaging/installer/netdata-updater.sh +++ b/packaging/installer/netdata-updater.sh @@ -73,7 +73,7 @@ set_tarball_urls() { return fi - if [ "$1" == "stable" ]; then + if [ "$1" = "stable" ]; then local latest # Simple version # latest="$(curl -sSL https://api.github.com/repos/netdata/netdata/releases/latest | grep tag_name | cut -d'"' -f4)" @@ -95,7 +95,7 @@ update() { if [ -z "${NETDATA_LOCAL_TARBAL_OVERRIDE}" ]; then download "${NETDATA_TARBALL_CHECKSUM_URL}" "${tmpdir}/sha256sum.txt" >&3 2>&3 - if grep "${NETDATA_TARBALL_CHECKSUM}" sha256sum.txt >&3 2>&3; then + if [[ -n "${NETDATA_TARBALL_CHECKSUM}" ]] && grep "${NETDATA_TARBALL_CHECKSUM}" sha256sum.txt >&3 2>&3; then info "Newest version is already installed" else download "${NETDATA_TARBALL_URL}" "${tmpdir}/netdata-latest.tar.gz" |