diff --git a/netdata-1.16.0.tar.gz b/netdata-1.16.0.tar.gz new file mode 100644 index 0000000..32d39c8 Binary files /dev/null and b/netdata-1.16.0.tar.gz differ diff --git a/netdata-fix-python2-not-compatible-with-python3.patch b/netdata-fix-python2-not-compatible-with-python3.patch new file mode 100644 index 0000000..da3db74 --- /dev/null +++ b/netdata-fix-python2-not-compatible-with-python3.patch @@ -0,0 +1,25 @@ +From 913bc3e605a85dae532394f1010f640175367ab4 Mon Sep 17 00:00:00 2001 +From: baizg1107 +Date: Tue, 22 Jun 2021 19:25:16 +0800 +Subject: [PATCH] netdata fix python2 not compatible with python3 + +--- + collectors/python.d.plugin/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/collectors/python.d.plugin/Makefile.am b/collectors/python.d.plugin/Makefile.am +index ad72cfa..3686040 100644 +--- a/collectors/python.d.plugin/Makefile.am ++++ b/collectors/python.d.plugin/Makefile.am +@@ -138,7 +138,7 @@ dist_third_party_DATA = \ + python_modules/third_party/monotonic.py \ + $(NULL) + +-pythonyaml2dir=$(pythonmodulesdir)/pyyaml2 ++pythonyaml2dir=$(pythonmodulesdir)/pyyaml3 + dist_pythonyaml2_DATA = \ + python_modules/pyyaml2/__init__.py \ + python_modules/pyyaml2/composer.py \ +-- +2.27.0 + diff --git a/netdata-fix-shebang-1.16.0.patch b/netdata-fix-shebang-1.16.0.patch new file mode 100644 index 0000000..af6f317 --- /dev/null +++ b/netdata-fix-shebang-1.16.0.patch @@ -0,0 +1,444 @@ +Fix shebang according to +https://docs.fedoraproject.org/en-US/packaging-guidelines/#_shebang_lines + +diff -rup a/backends/nc-backend.sh b/backends/nc-backend.sh +--- a/backends/nc-backend.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/backends/nc-backend.sh 2019-07-09 12:14:38.544596979 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + + # SPDX-License-Identifier: GPL-3.0-or-later + +diff -rup a/collectors/cgroups.plugin/cgroup-name.sh.in b/collectors/cgroups.plugin/cgroup-name.sh.in +--- a/collectors/cgroups.plugin/cgroup-name.sh.in 2019-07-08 13:52:29.000000000 +0200 ++++ b/collectors/cgroups.plugin/cgroup-name.sh.in 2019-07-09 12:14:38.560597055 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + #shellcheck disable=SC2001 + + # netdata +diff -rup a/collectors/cgroups.plugin/cgroup-network-helper.sh b/collectors/cgroups.plugin/cgroup-network-helper.sh +--- a/collectors/cgroups.plugin/cgroup-network-helper.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/collectors/cgroups.plugin/cgroup-network-helper.sh 2019-07-09 12:14:38.559597050 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + # shellcheck disable=SC1117 + + # cgroup-network-helper.sh +diff -rup a/collectors/charts.d.plugin/charts.d.dryrun-helper.sh b/collectors/charts.d.plugin/charts.d.dryrun-helper.sh +--- a/collectors/charts.d.plugin/charts.d.dryrun-helper.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/collectors/charts.d.plugin/charts.d.dryrun-helper.sh 2019-07-09 12:14:38.552597017 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + # SPDX-License-Identifier: GPL-3.0-or-later + + # shellcheck disable=SC2181 +diff -rup a/collectors/charts.d.plugin/charts.d.plugin.in b/collectors/charts.d.plugin/charts.d.plugin.in +--- a/collectors/charts.d.plugin/charts.d.plugin.in 2019-07-08 13:52:29.000000000 +0200 ++++ b/collectors/charts.d.plugin/charts.d.plugin.in 2019-07-09 12:14:38.554597026 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + # SPDX-License-Identifier: GPL-3.0-or-later + + # netdata +diff -rup a/collectors/fping.plugin/fping.plugin.in b/collectors/fping.plugin/fping.plugin.in +--- a/collectors/fping.plugin/fping.plugin.in 2019-07-08 13:52:29.000000000 +0200 ++++ b/collectors/fping.plugin/fping.plugin.in 2019-07-09 12:14:38.546596989 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + # SPDX-License-Identifier: GPL-3.0-or-later + + # netdata +diff -rup a/collectors/ioping.plugin/ioping.plugin.in b/collectors/ioping.plugin/ioping.plugin.in +--- a/collectors/ioping.plugin/ioping.plugin.in 2019-07-08 13:52:29.000000000 +0200 ++++ b/collectors/ioping.plugin/ioping.plugin.in 2019-07-09 12:14:38.550597008 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + # SPDX-License-Identifier: GPL-3.0-or-later + + # netdata +diff -rup a/collectors/node.d.plugin/node.d.plugin.in b/collectors/node.d.plugin/node.d.plugin.in +--- a/collectors/node.d.plugin/node.d.plugin.in 2019-07-08 13:52:29.000000000 +0200 ++++ b/collectors/node.d.plugin/node.d.plugin.in 2019-07-09 12:14:38.562597064 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + ':' //; exec "$(command -v nodejs || command -v node || echo "ERROR node IS NOT AVAILABLE IN THIS SYSTEM")" "$0" "$@" + + // shebang hack from: +diff -rup a/collectors/python.d.plugin/python.d.plugin.in b/collectors/python.d.plugin/python.d.plugin.in +--- a/collectors/python.d.plugin/python.d.plugin.in 2019-07-08 13:52:29.000000000 +0200 ++++ b/collectors/python.d.plugin/python.d.plugin.in 2019-07-09 12:14:38.557597040 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + '''':; + if [[ "$OSTYPE" == "darwin"* ]]; then + export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES +diff -rup a/collectors/python.d.plugin/python_modules/third_party/boinc_client.py b/collectors/python.d.plugin/python_modules/third_party/boinc_client.py +--- a/collectors/python.d.plugin/python_modules/third_party/boinc_client.py 2019-07-08 13:52:29.000000000 +0200 ++++ b/collectors/python.d.plugin/python_modules/third_party/boinc_client.py 2019-07-09 12:14:38.652597487 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++# + # -*- coding: utf-8 -*- + # + # client.py - Somewhat higher-level GUI_RPC API for BOINC core client +diff -rup a/collectors/tc.plugin/tc-qos-helper.sh.in b/collectors/tc.plugin/tc-qos-helper.sh.in +--- a/collectors/tc.plugin/tc-qos-helper.sh.in 2019-07-08 13:52:29.000000000 +0200 ++++ b/collectors/tc.plugin/tc-qos-helper.sh.in 2019-07-09 12:14:38.548596998 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + + # netdata + # real-time performance and health monitoring, done right! +diff -rup a/contrib/rhel/build-netdata-rpm.sh b/contrib/rhel/build-netdata-rpm.sh +--- a/contrib/rhel/build-netdata-rpm.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/contrib/rhel/build-netdata-rpm.sh 2019-07-09 12:14:38.564597073 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + + # docker run -it --rm centos:6.9 /bin/sh + # yum -y install rpm-build redhat-rpm-config yum-utils autoconf automake curl gcc git libmnl-devel libuuid-devel make pkgconfig zlib-devel +diff -rup a/contrib/sles11/alarm-notify-basic.bash3.sh b/contrib/sles11/alarm-notify-basic.bash3.sh +--- a/contrib/sles11/alarm-notify-basic.bash3.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/contrib/sles11/alarm-notify-basic.bash3.sh 2019-07-09 12:14:38.566597083 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + + # basic version of netdata notifier to work with bash3 + # only mail and syslog destinations are supported, one recipient each +diff -rup a/coverity-install.sh b/coverity-install.sh +--- a/coverity-install.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/coverity-install.sh 2019-07-09 12:14:38.567597088 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + # Coverity installation script + # + # Copyright: SPDX-License-Identifier: GPL-3.0-or-later +diff -rup a/coverity-scan.sh b/coverity-scan.sh +--- a/coverity-scan.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/coverity-scan.sh 2019-07-09 12:14:38.569597097 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + # Coverity scan script + # + # To run this script you need to provide API token. This can be done either by: +diff -rup a/cppcheck.sh b/cppcheck.sh +--- a/cppcheck.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/cppcheck.sh 2019-07-09 12:14:38.571597106 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + + # echo >>/tmp/cppcheck.log "cppcheck ${*}" + +diff -rup a/daemon/anonymous-statistics.sh.in b/daemon/anonymous-statistics.sh.in +--- a/daemon/anonymous-statistics.sh.in 2019-07-08 13:52:29.000000000 +0200 ++++ b/daemon/anonymous-statistics.sh.in 2019-07-09 12:14:38.619597332 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env sh ++#!/usr/bin/sh + + # Valid actions: + +diff -rup a/daemon/system-info.sh b/daemon/system-info.sh +--- a/daemon/system-info.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/daemon/system-info.sh 2019-07-09 12:14:38.621597341 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env sh ++#!/usr/bin/sh + + # ------------------------------------------------------------------------------------------------- + # detect the kernel +diff -rup a/diagrams/build.sh b/diagrams/build.sh +--- a/diagrams/build.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/diagrams/build.sh 2019-07-09 12:14:38.572597111 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + # SPDX-License-Identifier: GPL-3.0-or-later + + path=$(dirname "$0") +diff -rup a/health/notifications/alarm-email.sh b/health/notifications/alarm-email.sh +--- a/health/notifications/alarm-email.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/health/notifications/alarm-email.sh 2019-07-09 12:14:38.575597125 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + # SPDX-License-Identifier: GPL-3.0-or-later + + # OBSOLETE - REPLACED WITH +diff -rup a/health/notifications/alarm-notify.sh.in b/health/notifications/alarm-notify.sh.in +--- a/health/notifications/alarm-notify.sh.in 2019-07-08 13:52:29.000000000 +0200 ++++ b/health/notifications/alarm-notify.sh.in 2019-07-09 12:14:38.579597144 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + #shellcheck source=/dev/null disable=SC2086,SC2154 + + # netdata +diff -rup a/health/notifications/alarm-test.sh b/health/notifications/alarm-test.sh +--- a/health/notifications/alarm-test.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/health/notifications/alarm-test.sh 2019-07-09 12:14:38.574597120 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + + # netdata + # real-time performance and health monitoring, done right! +diff -rup a/netdata-installer.sh b/netdata-installer.sh +--- a/netdata-installer.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/netdata-installer.sh 2019-07-09 12:14:38.582597158 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + # SPDX-License-Identifier: GPL-3.0-or-later + # shellcheck disable=SC2046,SC2086,SC2166 + +diff -rup a/packaging/docker/build.sh b/packaging/docker/build.sh +--- a/packaging/docker/build.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/packaging/docker/build.sh 2019-07-09 12:14:38.594597214 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + # + # + # Copyright: SPDX-License-Identifier: GPL-3.0-or-later +diff -rup a/packaging/docker/check_login.sh b/packaging/docker/check_login.sh +--- a/packaging/docker/check_login.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/packaging/docker/check_login.sh 2019-07-09 12:14:38.595597219 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + # + # This is a credential checker script, to help get early input on docker credentials status + # If these are wrong, then build/publish has no point running +diff -rup a/packaging/docker/publish.sh b/packaging/docker/publish.sh +--- a/packaging/docker/publish.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/packaging/docker/publish.sh 2019-07-09 12:14:38.592597205 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + # + # Cross-arch docker publish helper script + # Needs docker in version >18.02 due to usage of manifests +diff -rup a/packaging/docker/run.sh b/packaging/docker/run.sh +--- a/packaging/docker/run.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/packaging/docker/run.sh 2019-07-09 12:14:38.591597200 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + # + # Entry point script for netdata + # +diff -rup a/packaging/installer/kickstart.sh b/packaging/installer/kickstart.sh +--- a/packaging/installer/kickstart.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/packaging/installer/kickstart.sh 2019-07-09 12:14:38.625597360 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env sh ++#!/usr/bin/sh + # SPDX-License-Identifier: GPL-3.0-or-later + # + # Run me with: +diff -rup a/packaging/installer/kickstart-static64.sh b/packaging/installer/kickstart-static64.sh +--- a/packaging/installer/kickstart-static64.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/packaging/installer/kickstart-static64.sh 2019-07-09 12:14:38.623597350 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env sh ++#!/usr/bin/sh + # SPDX-License-Identifier: GPL-3.0-or-later + # shellcheck disable=SC1117,SC2039,SC2059,SC2086 + +diff -rup a/packaging/installer/netdata-uninstaller.sh b/packaging/installer/netdata-uninstaller.sh +--- a/packaging/installer/netdata-uninstaller.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/packaging/installer/netdata-uninstaller.sh 2019-07-09 12:14:38.587597181 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + #shellcheck disable=SC2181 + # + # This is the netdata uninstaller script +diff -rup a/packaging/installer/netdata-updater.sh b/packaging/installer/netdata-updater.sh +--- a/packaging/installer/netdata-updater.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/packaging/installer/netdata-updater.sh 2019-07-09 12:14:38.584597167 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + #shellcheck disable=SC2164 + + # this script will uninstall netdata +diff -rup a/packaging/makeself/build.sh b/packaging/makeself/build.sh +--- a/packaging/makeself/build.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/packaging/makeself/build.sh 2019-07-09 12:14:38.626597365 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env sh ++#!/usr/bin/sh + # SPDX-License-Identifier: GPL-3.0-or-later + + # ----------------------------------------------------------------------------- +diff -rup a/packaging/makeself/build-x86_64-static.sh b/packaging/makeself/build-x86_64-static.sh +--- a/packaging/makeself/build-x86_64-static.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/packaging/makeself/build-x86_64-static.sh 2019-07-09 12:14:38.597597228 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + # SPDX-License-Identifier: GPL-3.0-or-later + + . $(dirname "$0")/../installer/functions.sh || exit 1 +diff -rup a/packaging/makeself/functions.sh b/packaging/makeself/functions.sh +--- a/packaging/makeself/functions.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/packaging/makeself/functions.sh 2019-07-09 12:14:38.614597308 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + # SPDX-License-Identifier: GPL-3.0-or-later + + # ----------------------------------------------------------------------------- +diff -rup a/packaging/makeself/install-alpine-packages.sh b/packaging/makeself/install-alpine-packages.sh +--- a/packaging/makeself/install-alpine-packages.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/packaging/makeself/install-alpine-packages.sh 2019-07-09 12:14:38.628597374 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env sh ++#!/usr/bin/sh + # + # Installation script for the alpine host + # to prepare the static binary +diff -rup a/packaging/makeself/install-or-update.sh b/packaging/makeself/install-or-update.sh +--- a/packaging/makeself/install-or-update.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/packaging/makeself/install-or-update.sh 2019-07-09 12:14:38.612597299 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + # SPDX-License-Identifier: GPL-3.0-or-later + + . $(dirname "${0}")/functions.sh +diff -rup a/packaging/makeself/jobs/10-prepare-destination.install.sh b/packaging/makeself/jobs/10-prepare-destination.install.sh +--- a/packaging/makeself/jobs/10-prepare-destination.install.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/packaging/makeself/jobs/10-prepare-destination.install.sh 2019-07-09 12:14:38.600597243 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + # SPDX-License-Identifier: GPL-3.0-or-later + + . $(dirname "${0}")/../functions.sh "${@}" || exit 1 +diff -rup a/packaging/makeself/jobs/50-bash-4.4.18.install.sh b/packaging/makeself/jobs/50-bash-4.4.18.install.sh +--- a/packaging/makeself/jobs/50-bash-4.4.18.install.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/packaging/makeself/jobs/50-bash-4.4.18.install.sh 2019-07-09 12:14:38.610597290 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + # SPDX-License-Identifier: GPL-3.0-or-later + + . $(dirname "${0}")/../functions.sh "${@}" || exit 1 +diff -rup a/packaging/makeself/jobs/50-curl-7.60.0.install.sh b/packaging/makeself/jobs/50-curl-7.60.0.install.sh +--- a/packaging/makeself/jobs/50-curl-7.60.0.install.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/packaging/makeself/jobs/50-curl-7.60.0.install.sh 2019-07-09 12:14:38.605597266 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + # SPDX-License-Identifier: GPL-3.0-or-later + + . $(dirname "${0}")/../functions.sh "${@}" || exit 1 +diff -rup a/packaging/makeself/jobs/50-fping-4.2.install.sh b/packaging/makeself/jobs/50-fping-4.2.install.sh +--- a/packaging/makeself/jobs/50-fping-4.2.install.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/packaging/makeself/jobs/50-fping-4.2.install.sh 2019-07-09 12:14:38.607597276 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + # SPDX-License-Identifier: GPL-3.0-or-later + + . $(dirname "${0}")/../functions.sh "${@}" || exit 1 +diff -rup a/packaging/makeself/jobs/50-ioping-1.1.install.sh b/packaging/makeself/jobs/50-ioping-1.1.install.sh +--- a/packaging/makeself/jobs/50-ioping-1.1.install.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/packaging/makeself/jobs/50-ioping-1.1.install.sh 2019-07-09 12:14:38.602597252 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + # SPDX-License-Identifier: GPL-3.0-or-later + + . $(dirname "${0}")/../functions.sh "${@}" || exit 1 +diff -rup a/packaging/makeself/jobs/70-netdata-git.install.sh b/packaging/makeself/jobs/70-netdata-git.install.sh +--- a/packaging/makeself/jobs/70-netdata-git.install.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/packaging/makeself/jobs/70-netdata-git.install.sh 2019-07-09 12:14:38.608597280 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + # SPDX-License-Identifier: GPL-3.0-or-later + + . ${NETDATA_MAKESELF_PATH}/functions.sh "${@}" || exit 1 +diff -rup a/packaging/makeself/jobs/99-makeself.install.sh b/packaging/makeself/jobs/99-makeself.install.sh +--- a/packaging/makeself/jobs/99-makeself.install.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/packaging/makeself/jobs/99-makeself.install.sh 2019-07-09 12:14:38.603597257 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + # SPDX-License-Identifier: GPL-3.0-or-later + + . $(dirname "${0}")/../functions.sh "${@}" || exit 1 +diff -rup a/packaging/makeself/run-all-jobs.sh b/packaging/makeself/run-all-jobs.sh +--- a/packaging/makeself/run-all-jobs.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/packaging/makeself/run-all-jobs.sh 2019-07-09 12:14:38.598597233 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + # SPDX-License-Identifier: GPL-3.0-or-later + + LC_ALL=C +diff -rup a/packaging/manual_nightly_deployment.sh b/packaging/manual_nightly_deployment.sh +--- a/packaging/manual_nightly_deployment.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/packaging/manual_nightly_deployment.sh 2019-07-09 12:14:38.589597191 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + # + # This tool allows netdata team to manually deploy nightlies + # It emulates the nightly operations required for a new version to be published for our users +diff -rup a/system/edit-config.in b/system/edit-config.in +--- a/system/edit-config.in 2019-07-08 13:52:29.000000000 +0200 ++++ b/system/edit-config.in 2019-07-09 12:14:38.630597383 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env sh ++#!/usr/bin/sh + + [ -f /etc/profile ] && . /etc/profile + +diff -rup a/system/netdata-lsb.in b/system/netdata-lsb.in +--- a/system/netdata-lsb.in 2019-07-08 13:52:29.000000000 +0200 ++++ b/system/netdata-lsb.in 2019-07-09 12:14:38.615597313 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + # + # Netdata LSB start script + # +diff -rup a/tests/health_mgmtapi/health-cmdapi-test.sh.in b/tests/health_mgmtapi/health-cmdapi-test.sh.in +--- a/tests/health_mgmtapi/health-cmdapi-test.sh.in 2019-07-08 13:52:29.000000000 +0200 ++++ b/tests/health_mgmtapi/health-cmdapi-test.sh.in 2019-07-09 12:14:38.617597322 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/usr/bin/bash + # shellcheck disable=SC1117,SC2034,SC2059,SC2086,SC2181 + + NETDATA_VARLIB_DIR="@varlibdir_POST@" +diff -rup a/tests/updater_checks.sh b/tests/updater_checks.sh +--- a/tests/updater_checks.sh 2019-07-08 13:52:29.000000000 +0200 ++++ b/tests/updater_checks.sh 2019-07-09 12:14:38.632597393 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env sh ++#!/usr/bin/sh + # + # Wrapper script that installs the required dependencies + # for the BATS script to run successfully diff --git a/netdata-remove-fonts-1.12.0.patch b/netdata-remove-fonts-1.12.0.patch new file mode 100644 index 0000000..4c2c520 --- /dev/null +++ b/netdata-remove-fonts-1.12.0.patch @@ -0,0 +1,19 @@ +diff -rup a/web/gui/Makefile.am b/web/gui/Makefile.am +--- a/web/gui/Makefile.am 2019-02-06 10:17:04.000000000 +0100 ++++ b/web/gui/Makefile.am 2019-02-18 22:31:55.058655622 +0100 +@@ -104,15 +104,6 @@ dist_webcss_DATA = \ + css/c3-0.4.18.min.css \ + $(NULL) + +-webfontsdir=$(webdir)/fonts +-dist_webfonts_DATA = \ +- fonts/glyphicons-halflings-regular.eot \ +- fonts/glyphicons-halflings-regular.svg \ +- fonts/glyphicons-halflings-regular.ttf \ +- fonts/glyphicons-halflings-regular.woff \ +- fonts/glyphicons-halflings-regular.woff2 \ +- $(NULL) +- + webimagesdir=$(webdir)/images + dist_webimages_DATA = \ + images/netdata-logomark.svg \ diff --git a/netdata.conf b/netdata.conf new file mode 100644 index 0000000..db89add --- /dev/null +++ b/netdata.conf @@ -0,0 +1,23 @@ +# netdata configuration +# +# You can download the latest version of this file, using: +# +# wget -O /etc/netdata/netdata.conf http://localhost:19999/netdata.conf +# or +# curl -o /etc/netdata/netdata.conf http://localhost:19999/netdata.conf +# +# You can uncomment and change any of the options below. +# The value shown in the commented settings, is the default value. +# + +# global netdata configuration +[global] + stock config directory = /etc/netdata/conf.d + +[web] + web files owner = root + web files group = root + bind to = localhost + +[health] + stock health configuration directory = /etc/netdata/conf.d/health.d diff --git a/netdata.init b/netdata.init new file mode 100644 index 0000000..3505e11 --- /dev/null +++ b/netdata.init @@ -0,0 +1,71 @@ +#!/bin/bash +# +# netdata This shell script takes care of starting and stopping netdata. +# +# chkconfig: 345 99 01 +# description: netdata is a Real-time performance monitoring +# probe: false +# processname: netdata +# pidfile: /var/run/netdata.pid +### BEGIN INIT INFO +# Provides: netdata +# Required-Start: $network +# Required-Stop: $network +# Default-Start: 3 4 5 +# Short-Description: netdata. +# Description: netdata is a highly optimized Linux daemon providing real-time +# performance monitoring for Linux systems, Applications, SNMP devices, over +# the web! +#It tries to visualize the truth of now, in its greatest detail, so that you +#can get insights of what is happening now and what just happened, on your +#systems and applications. +### END INIT INFO + + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source networking configuration. +. /etc/sysconfig/network + +[ -f /usr/sbin/netdata ] || exit 0 + +# See how we were called. +case "$1" in + start) + if [ -n "`/sbin/pidof netdata`" ]; then + echo -n "netdata: already running" + RETVAL=$? + echo + exit $RETVAL + fi + echo -n "Starting netdata: " + /usr/sbin/netdata ${OPTIONS} + RETVAL=$? + [ $RETVAL -eq 0 ] && success || failure + echo + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/netdata + ;; + stop) + echo -n "Stopping netdata: " + killproc netdata + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/netdata + ;; + status) + status netdata + RETVAL=$? + ;; + restart|reload) + $0 stop + $0 start + RETVAL=$? + ;; + *) + echo "Usage: netdata {start|stop|status|restart}" + exit 1 + ;; +esac + +exit $RETVAL diff --git a/netdata.spec b/netdata.spec new file mode 100644 index 0000000..a46efc5 --- /dev/null +++ b/netdata.spec @@ -0,0 +1,220 @@ +%bcond_without systemd +#We use some plugins which need suid +%global _hardened_build 1 +# Build release candidate +%global upver 1.16.0 +Name: netdata +Version: %{upver}%{?rcver:~%{rcver}} +Release: 1 +Summary: Real-time performance monitoring +License: GPLv3 and GPLv3+ and ASL 2.0 and CC-BY and MIT and WTFPL +URL: https://github.com/%{name}/%{name}/ +Source0: https://github.com/%{name}/%{name}/archive/v%{upver}%{?rcver:-%{rcver}}/%{name}-%{upver}%{?rcver:-%{rcver}}.tar.gz +Source1: netdata.tmpfiles.conf +Source2: netdata.init +Source3: netdata.conf +Patch0: netdata-fix-shebang-1.16.0.patch +Patch1: netdata-fix-python2-not-compatible-with-python3.patch +# Remove embedded font +Patch10: netdata-remove-fonts-1.12.0.patch +BuildRequires: zlib-devel git autoconf automake pkgconfig libuuid-devel freeipmi-devel httpd +BuildRequires: cppcheck gcc tinyxml2 +Requires: nodejs glyphicons-halflings-fonts +%if %{with systemd} +BuildRequires: systemd +%{?systemd_requires} +%else +Requires: initscripts /sbin/service /sbin/chkconfig +%endif +Requires: %{name}-data = %{version}-%{release} %{name}-conf = %{version}-%{release} +%description +netdata is the fastest way to visualize metrics. It is a resource +efficient, highly optimized system for collecting and visualizing any +type of realtime time-series data, from CPU usage, disk activity, SQL +queries, API calls, web site visitors, etc. +netdata tries to visualize the truth of now, in its greatest detail, +so that you can get insights of what is happening now and what just +happened, on your systems and applications. + +%package data +BuildArch: noarch +Summary: Data files for netdata +%description data +Data files for netdata + +%package conf +BuildArch: noarch +Summary: Configuration files for netdata +%description conf +Configuration files for netdata + +%package freeipmi +Summary: FreeIPMI plugin for netdata +Requires: %{name}%{?_isa} = %{version}-%{release} +License: GPLv3 +%description freeipmi +freeipmi plugin for netdata + +%prep +%setup -qn %{name}-%{upver}%{?rcver:-%{rcver}} +%patch0 -p1 +%patch1 -p1 +# Remove embedded font(added in requires) +%patch10 -p1 +rm -rf web/fonts + +%build +autoreconf -ivf +%configure \ + --prefix=%{_prefix} \ + --sysconfdir=%{_sysconfdir} \ + --localstatedir=%{_localstatedir} \ + --enable-plugin-freeipmi \ + --with-zlib --with-math --with-user=netdata +%make_build + +%install +%make_install +find %{buildroot} -name '.keep' -delete +# Unit file +%if %{with systemd} +mkdir -p %{buildroot}%{_unitdir} +mkdir -p %{buildroot}%{_tmpfilesdir} +install -Dp -m 0644 system/netdata.service %{buildroot}%{_unitdir}/%{name}.service +install -p -m 0644 %{SOURCE1} %{buildroot}%{_tmpfilesdir}/%{name}.conf +%else +# Init script +mkdir -p %{buildroot}%{_initrddir} +install -p -Dp -m 0755 %{SOURCE2} %{buildroot}%{_initrddir}/%{name} +%endif +mkdir -p %{buildroot}%{_localstatedir}/lib/%{name} +mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d +install -p -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/%{name}/ +install -p -m 0644 system/netdata.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name} +# Conf files must be in /etc, dixit FHS +mv %{buildroot}%{_libdir}/%{name}/conf.d %{buildroot}%{_sysconfdir}/%{name}/ +# Scripts must not be in /etc +mv %{buildroot}%{_sysconfdir}/%{name}/edit-config %{buildroot}%{_libexecdir}/%{name}/edit-config +# Fix EOL +sed -i -e 's/\r//' %{buildroot}%{_datadir}/%{name}/web/lib/tableExport-1.6.0.min.js +# Delete useless hidden dir +rm -rf %{buildroot}%{_datadir}/%{name}/web/.well-known + +%check +./cppcheck.sh + +%pre +getent group netdata > /dev/null || groupadd -r netdata +getent passwd netdata > /dev/null || useradd -r -g netdata -c "NetData User" -s /sbin/nologin -d /var/log/%{name} netdata + +%post +%if 0%{?systemd_post:1} +%systemd_post %{name}.service +%else +if [ $1 = 1 ]; then + # Initial installation +%if %{with systemd} + /bin/systemctl daemon-reload >/dev/null 2>&1 || : +%else + /sbin/chkconfig --add %{name} +%endif +fi +%endif +echo "The current config file can be downloaded with the following command" +echo "curl -o /etc/netdata/netdata.conf http://localhost:19999/netdata.conf" + +%preun +%if 0%{?systemd_preun:1} +%systemd_preun %{name}.service +%else +if [ "$1" = 0 ] ; then + # Package removal, not upgrade +%if %{with systemd} + /bin/systemctl --no-reload disable %{name}.service >/dev/null 2>&1 || : + /bin/systemctl stop %{name}.service >/dev/null 2>&1 || : +%else + /sbin/service %{name} stop > /dev/null 2>&1 + /sbin/chkconfig --del %{name} +%endif +fi +exit 0 +%endif + +%postun +%if 0%{?systemd_postun_with_restart:1} +%systemd_postun_with_restart %{name}.service +%else +%if %{with systemd} +/bin/systemctl daemon-reload >/dev/null 2>&1 || : +if [ $1 -ge 1 ]; then +# Package upgrade, not uninstall + /bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || : +fi +%else +if [ "$1" -ge 1 ]; then + /sbin/service %{name} restart > /dev/null 2>&1 +fi +exit 0 +%endif +%endif +%triggerun -- netdata +%if %{with systemd} +if [ -f /etc/rc.d/init.d/%{name} ]; then +# Save the current service runlevel info +# User must manually run systemd-sysv-convert --apply netdata +# to migrate them to systemd targets +/usr/bin/systemd-sysv-convert --save %{name} >/dev/null 2>&1 ||: +# Run these because the SysV package being removed won't do them +/sbin/chkconfig --del %{name} >/dev/null 2>&1 || : +/bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || : +fi +%endif + +%files +%doc README.md CHANGELOG.md CODE_OF_CONDUCT.md CONTRIBUTORS.md HISTORICAL_CHANGELOG.md +%license LICENSE REDISTRIBUTED.md +%{_sbindir}/%{name} +%{_libexecdir}/%{name} +%if %{with systemd} +%{_unitdir}/%{name}.service +%{_tmpfilesdir}/%{name}.conf +%else +%attr(0755,root,root) %{_initrddir}/%{name} +%endif +%attr(4755,root,root) %{_libexecdir}/%{name}/plugins.d/apps.plugin +%exclude %{_libexecdir}/%{name}/plugins.d/freeipmi.plugin +%attr(0755, netdata, netdata) %{_localstatedir}/lib/%{name} +%attr(0755, netdata, netdata) %dir %{_localstatedir}/cache/%{name} +%attr(0755, netdata, netdata) %dir %{_localstatedir}/log/%{name} +%config(noreplace) %{_sysconfdir}/logrotate.d/%{name} + +%files conf +%doc README.md +%license LICENSE REDISTRIBUTED.md +%dir %{_sysconfdir}/%{name} +%dir %{_sysconfdir}/%{name}/conf.d +%dir %{_sysconfdir}/%{name}/conf.d/charts.d +%dir %{_sysconfdir}/%{name}/conf.d/health.d +%dir %{_sysconfdir}/%{name}/conf.d/python.d +%dir %{_sysconfdir}/%{name}/conf.d/statsd.d +%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf +%config(noreplace) %{_sysconfdir}/%{name}/conf.d/*.conf +%config(noreplace) %{_sysconfdir}/%{name}/conf.d/charts.d/*.conf +%config(noreplace) %{_sysconfdir}/%{name}/conf.d/health.d/*.conf +%config(noreplace) %{_sysconfdir}/%{name}/conf.d/python.d/*.conf +%config(noreplace) %{_sysconfdir}/%{name}/conf.d/statsd.d/*.conf + +%files data +%doc README.md +%license LICENSE REDISTRIBUTED.md +%dir %{_datadir}/%{name} +%{_datadir}/%{name}/web + +%files freeipmi +%doc README.md +%license LICENSE REDISTRIBUTED.md +%attr(4755,root,root) %{_libexecdir}/%{name}/plugins.d/freeipmi.plugin + +%changelog +* Thu Jun 24 2021 baizhonggui - 1.16.0 - 1 +- package init diff --git a/netdata.tmpfiles.conf b/netdata.tmpfiles.conf new file mode 100644 index 0000000..c787c6f --- /dev/null +++ b/netdata.tmpfiles.conf @@ -0,0 +1 @@ +D /var/run/netdata 0775 netdata netdata -