From 32606e7402346695a9bcf7e221d17cc3ec025a69 Mon Sep 17 00:00:00 2001 From: Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com> Date: Fri, 12 Apr 2024 14:09:04 +0300 Subject: Patch release 1.45.3 (#17388) * hardcode ndsudo PATH (#17377) (cherry picked from commit 44c3debc4da5218606e899c1a3515117c057bd5d) * set min thread stack size to 1 MB (#17317) (cherry picked from commit ee0beeb9ebc94c2ccc40a86692442a344e53277f) * uninstaller: remove LaunchDaemons plist file (macOS) (#17357) (cherry picked from commit c41702d9daf4f5c0edd417db7ff76ea10735ef57) * fix percentages on alerts (#17391) --------- Co-authored-by: Ilya Mashchenko Co-authored-by: Costa Tsaousis --- packaging/installer/netdata-uninstaller.sh | 5 +++++ src/collectors/plugins.d/ndsudo.c | 3 +++ src/daemon/main.c | 3 +++ src/health/health.h | 2 +- src/health/health_prototypes.c | 6 ++++++ 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/packaging/installer/netdata-uninstaller.sh b/packaging/installer/netdata-uninstaller.sh index dcd9d965de..1627ca6b5d 100755 --- a/packaging/installer/netdata-uninstaller.sh +++ b/packaging/installer/netdata-uninstaller.sh @@ -723,6 +723,10 @@ trap quit_msg EXIT info "Stopping a possibly running netdata..." stop_all_netdata +if [ "$(uname -s)" = "Darwin" ]; then + launchctl unload /Library/LaunchDaemons/com.github.netdata.plist 2>/dev/null +fi + #### REMOVE NETDATA FILES rm_file /etc/logrotate.d/netdata rm_file /etc/systemd/system/netdata.service @@ -741,6 +745,7 @@ rm_file /etc/periodic/daily/netdata-updater rm_file /etc/cron.daily/netdata-updater rm_file /etc/cron.d/netdata-updater rm_file /etc/cron.d/netdata-updater-daily +rm_file /Library/LaunchDaemons/com.github.netdata.plist if [ -n "${NETDATA_PREFIX}" ] && [ -d "${NETDATA_PREFIX}" ] && [ "netdata" = "$(basename "$NETDATA_PREFIX")" ] ; then diff --git a/src/collectors/plugins.d/ndsudo.c b/src/collectors/plugins.d/ndsudo.c index f5fa78bf58..13e2ccaaa6 100644 --- a/src/collectors/plugins.d/ndsudo.c +++ b/src/collectors/plugins.d/ndsudo.c @@ -260,6 +260,9 @@ int main(int argc, char *argv[]) { return 3; } + char new_path[] = "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"; + setenv("PATH", new_path, 1); + bool found = false; char filename[FILENAME_MAX]; diff --git a/src/daemon/main.c b/src/daemon/main.c index 6b170d81f0..c9602432a2 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -2023,6 +2023,9 @@ int main(int argc, char **argv) { // setup threads configs default_stacksize = netdata_threads_init(); + // musl default thread stack size is 128k, let's set it to a higher value to avoid random crashes + if (default_stacksize < 1 * 1024 * 1024) + default_stacksize = 1 * 1024 * 1024; #ifdef NETDATA_INTERNAL_CHECKS config_set_boolean(CONFIG_SECTION_PLUGINS, "netdata monitoring", true); diff --git a/src/health/health.h b/src/health/health.h index 2a1dd6c656..8aca6dcb2b 100644 --- a/src/health/health.h +++ b/src/health/health.h @@ -22,7 +22,7 @@ typedef enum __attribute__((packed)) { #define RRDR_OPTIONS_DATA_SOURCES (RRDR_OPTION_PERCENTAGE|RRDR_OPTION_ANOMALY_BIT) #define RRDR_OPTIONS_DIMS_AGGREGATION (RRDR_OPTION_DIMS_MIN|RRDR_OPTION_DIMS_MAX|RRDR_OPTION_DIMS_AVERAGE|RRDR_OPTION_DIMS_MIN2MAX) -#define RRDR_OPTIONS_REMOVE_OVERLAPPING(options) ((options) &= ~(RRDR_OPTIONS_DIMS_AGGREGATION|RRDR_OPTIONS_DATA_SOURCES)) +#define RRDR_OPTIONS_REMOVE_OVERLAPPING(options) ((options) & ~(RRDR_OPTIONS_DIMS_AGGREGATION|RRDR_OPTIONS_DATA_SOURCES)) void health_entry_flags_to_json_array(BUFFER *wb, const char *key, HEALTH_ENTRY_FLAGS flags); diff --git a/src/health/health_prototypes.c b/src/health/health_prototypes.c index 8e343bfa1a..ceefbc2225 100644 --- a/src/health/health_prototypes.c +++ b/src/health/health_prototypes.c @@ -540,9 +540,15 @@ void health_prototype_copy_config(struct rrd_alert_config *dst, struct rrd_alert dst->update_every = src->update_every; + dst->alert_action_options = src->alert_action_options; + dst->dimensions = string_dup(src->dimensions); dst->time_group = src->time_group; + dst->time_group_condition = src->time_group_condition; + dst->time_group_value = src->time_group_value; + dst->dims_group = src->dims_group; + dst->data_source = src->data_source; dst->before = src->before; dst->after = src->after; dst->options = src->options; -- cgit v1.2.3