From d248520c50e0df47f47278b392b83274bec46ae8 Mon Sep 17 00:00:00 2001 From: JimboJoe Date: Mon, 4 Mar 2019 09:09:30 +0100 Subject: [PATCH] Upgrade to upstream version 1.12.2 (#29) * Upgrade to upstream version 1.12.1 * Upgrade to upstream version 1.12.2 --- README.md | 2 +- conf/app.src | 4 ++-- conf/uninstaller.src | 4 ++++ manifest.json | 2 +- scripts/_common.sh | 4 ++++ scripts/install | 3 --- scripts/remove | 19 +++++-------------- scripts/upgrade | 12 ++++-------- 8 files changed, 21 insertions(+), 29 deletions(-) create mode 100644 conf/uninstaller.src diff --git a/README.md b/README.md index 78d2571..81c7fbf 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ _netdata is **fast** and **efficient**, designed to permanently run on all syste (**physical** & **virtual** servers, **containers**, **IoT** devices), without disrupting their core function._ -**Shipped version:** 1.11.1 +**Shipped version:** 1.12.2 **Customization brought by the package:** diff --git a/conf/app.src b/conf/app.src index 4d0ef2b..30afe02 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,3 +1,3 @@ -SOURCE_URL=https://github.com/netdata/netdata/releases/download/v1.11.1/netdata-v1.11.1.tar.gz -SOURCE_SUM=0150b2a060da0e5cc844bd9540d6704cd352c434ea1bb9d5268131830a815736 +SOURCE_URL=https://github.com/netdata/netdata/releases/download/v1.12.2/netdata-v1.12.2.tar.gz +SOURCE_SUM=f8cd689ec1ab262903b5a54c8df2fd0fe6e5e7b0ab4a2c60fde4e88f37aa72b5 SOURCE_FORMAT=tar.gz diff --git a/conf/uninstaller.src b/conf/uninstaller.src new file mode 100644 index 0000000..bd62122 --- /dev/null +++ b/conf/uninstaller.src @@ -0,0 +1,4 @@ +SOURCE_URL=https://raw.githubusercontent.com/netdata/netdata/v1.12.2/packaging/installer/netdata-uninstaller.sh +SOURCE_SUM=a91970882dd90fd3b2352be185c6df9fc1b0ecda9e08677a1f47a0fd281a7615 +SOURCE_FILENAME=netdata-uninstaller.sh +SOURCE_EXTRACT=false diff --git a/manifest.json b/manifest.json index 37dd3d1..1f93eb4 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "real-time performance and health monitoring", "fr": "Monitoring serveur en temps reel" }, - "version": "1.11.1~ynh1", + "version": "1.12.2~ynh1", "url": "http://my-netdata.io/", "license": "GPL-3.0", "maintainer": { diff --git a/scripts/_common.sh b/scripts/_common.sh index 212c52a..d096828 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -14,6 +14,10 @@ configure_netdata() { s@# registry to announce = https://registry.my-netdata.io@registry to announce = https://$domain$path_url@ }" /opt/netdata/etc/netdata/netdata.conf +# Opt-out from sending anonymous statistics +# (see https://docs.netdata.cloud/docs/anonymous-statistics/#opt-out) +touch /opt/netdata/etc/netdata/.opt-out-from-anonymous-statistics + # Add a web_log entry for every YunoHost domain netdata_add_yunohost_web_logs diff --git a/scripts/install b/scripts/install index d7b8aee..7be2ea3 100644 --- a/scripts/install +++ b/scripts/install @@ -95,9 +95,6 @@ ynh_add_nginx_config pushd $NETDATA_TMPDIR ./netdata-installer.sh --install /opt --dont-wait -# Store the uninstaller for the removal script -mv ./netdata-uninstaller.sh /opt/netdata/etc/netdata - configure_netdata # Store the app.src file diff --git a/scripts/remove b/scripts/remove index 000a7da..b86ca74 100644 --- a/scripts/remove +++ b/scripts/remove @@ -39,30 +39,21 @@ ynh_remove_app_dependencies # Prepare to execute uninstaller(generated by NetData install script) UNINSTALL_SCRIPT="netdata-uninstaller.sh" +ynh_setup_source "/tmp" uninstaller +chmod +x /tmp/$UNINSTALL_SCRIPT + # Move outside the directory (which will be removed) -mv /opt/netdata/etc/netdata/${UNINSTALL_SCRIPT} /tmp cd /tmp -# Remove the need for interaction -ynh_replace_string "rm -i" "rm -f" ${UNINSTALL_SCRIPT} -ynh_replace_string "rm -I" "rm -f" ${UNINSTALL_SCRIPT} # Execute the uninstall script -./${UNINSTALL_SCRIPT} --force +./${UNINSTALL_SCRIPT} --yes --force --env /opt/netdata/etc/netdata/.environment # Remove MySQL netdata user ynh_mysql_execute_as_root "drop user 'netdata'@'localhost'; flush privileges;" - + #================================================= # REMOVE NGINX CONFIGURATION #================================================= # Remove the dedicated nginx config ynh_remove_nginx_config - -#================================================= -# SPECIFIC REMOVE -#================================================= - -# The following command is kept as a matter of transition with the previous way -# of managing dependencies -ynh_package_autoremove "netdata-deps" || true diff --git a/scripts/upgrade b/scripts/upgrade index c845550..9ac8ecf 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -54,7 +54,7 @@ then else # Move prefix comment #for-subdir at end of lines ynh_replace_string "#for-subdir\(.*\)" "\1 #for-subdir" $nginx_conf -fi +fi # Create a dedicated nginx config ynh_add_nginx_config @@ -68,7 +68,7 @@ ynh_install_app_dependencies $pkg_dependencies installed_version=$(cat /opt/netdata/etc/netdata/app.src | grep SOURCE_URL | sed "s|.*/v\(.*\)/.*|\1|g") version_to_install=$(cat ../conf/app.src | grep SOURCE_URL | sed "s|.*/v\(.*\)/.*|\1|g") -if [ "$installed_version" != "$version_to_install" ] ; then +if [ "$installed_version" != "$version_to_install" ] ; then #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -90,7 +90,7 @@ if [ "$installed_version" != "$version_to_install" ] ; then tmp=$(mktemp /tmp/netdata-updater-log-XXXXXX.log) # open fd 3 and send it to tmp exec 3>${tmp} - + # Launch netdata installation in /opt directory pushd $NETDATA_TMPDIR # Remove previous service definition (specific 1.8.0 upgrade) @@ -98,10 +98,7 @@ if [ "$installed_version" != "$version_to_install" ] ; then ./netdata-installer.sh --install /opt --dont-wait >&3 2>&3 || ynh_die "FAILED TO COMPILE/INSTALL NETDATA" - # Store the uninstaller for the removal script - mv ./netdata-uninstaller.sh /opt/netdata/etc/netdata - - popd + popd fi # Specific configuration @@ -126,4 +123,3 @@ fi #================================================= systemctl reload nginx -