From b2b087593d07ba44cf2312c366a73a824d7a18ac Mon Sep 17 00:00:00 2001 From: twtlpl Date: Wed, 20 Nov 2024 17:03:14 +0800 Subject: [PATCH] DRBDmon: Pass-through the monitor environment --- ...oading-saved-DRBD-events-adjust-node.patch | 503 ++++++++++++++++++ ...Pass-through-the-monitor-environment.patch | 374 +++++++++++++ ...ort-DRBDmon-SystemApi-methods-update.patch | 176 ++++++ drbd.spec | 9 +- 4 files changed, 1061 insertions(+), 1 deletion(-) create mode 100644 backport-DRBDmon-Enable-loading-saved-DRBD-events-adjust-node.patch create mode 100644 backport-DRBDmon-Pass-through-the-monitor-environment.patch create mode 100644 backport-DRBDmon-SystemApi-methods-update.patch diff --git a/backport-DRBDmon-Enable-loading-saved-DRBD-events-adjust-node.patch b/backport-DRBDmon-Enable-loading-saved-DRBD-events-adjust-node.patch new file mode 100644 index 0000000..e943a3e --- /dev/null +++ b/backport-DRBDmon-Enable-loading-saved-DRBD-events-adjust-node.patch @@ -0,0 +1,503 @@ +From 1197ffd72a00ff90e9c4d74cf028946cc32f79d2 Mon Sep 17 00:00:00 2001 +From: Robert Altnoeder +Date: Tue, 19 Mar 2024 16:14:05 +0100 +Subject: [PATCH 083/100] DRBDmon: Enable loading saved DRBD events, adjust + node name related code + +--- + user/drbdmon/Configurable.h | 4 +- + user/drbdmon/DrbdMon.cpp | 43 +++++++++++-------- + user/drbdmon/DrbdMon.h | 6 ++- + user/drbdmon/MonitorEnvironment.h | 3 +- + user/drbdmon/drbdmon_main.cpp | 37 ++++++++-------- + .../subprocess/EventsSourceSpawner.cpp | 29 ++++++++++--- + user/drbdmon/subprocess/EventsSourceSpawner.h | 8 ++-- + user/drbdmon/terminal/ComponentsHub.cpp | 1 + + user/drbdmon/terminal/ComponentsHub.h | 1 + + user/drbdmon/terminal/DisplayCommonImpl.cpp | 11 +++++ + user/drbdmon/terminal/DisplayController.cpp | 11 +++-- + user/drbdmon/terminal/DisplayController.h | 2 + + 12 files changed, 100 insertions(+), 56 deletions(-) + +diff --git a/user/drbdmon/Configurable.h b/user/drbdmon/Configurable.h +index 53387f1e..1d6bfd93 100644 +--- a/user/drbdmon/Configurable.h ++++ b/user/drbdmon/Configurable.h +@@ -19,10 +19,10 @@ class Configurable + virtual void options_help() noexcept = 0; + + // @throws std::bad_alloc, ConfigurationException +- virtual void set_flag(std::string& key) = 0; ++ virtual void set_flag(const std::string& key) = 0; + + // @throws std::bad_alloc, ConfigurationException +- virtual void set_option(std::string& key, std::string& value) = 0; ++ virtual void set_option(const std::string& key, const std::string& value) = 0; + }; + + #endif /* CONFIGURABLE_H */ +diff --git a/user/drbdmon/DrbdMon.cpp b/user/drbdmon/DrbdMon.cpp +index b9ac34d8..2c217416 100644 +--- a/user/drbdmon/DrbdMon.cpp ++++ b/user/drbdmon/DrbdMon.cpp +@@ -34,9 +34,11 @@ extern "C" + const std::string DrbdMon::OPT_HELP_KEY = "help"; + const std::string DrbdMon::OPT_VERSION_KEY = "version"; + const std::string DrbdMon::OPT_FREQ_LMT_KEY = "freqlmt"; ++const std::string DrbdMon::OPT_EVENTS_LOG_KEY = "events-log"; + const ConfigOption DrbdMon::OPT_HELP(true, OPT_HELP_KEY); + const ConfigOption DrbdMon::OPT_VERSION(true, OPT_VERSION_KEY); + const ConfigOption DrbdMon::OPT_FREQ_LMT(false, OPT_FREQ_LMT_KEY); ++const ConfigOption DrbdMon::OPT_EVENTS_LOG(false, OPT_EVENTS_LOG_KEY); + + const char* DrbdMon::ENV_COLOR_MODE = "DRBDMON_COLORS"; + const char* DrbdMon::COLOR_MODE_EXTENDED = "extended"; +@@ -108,11 +110,24 @@ void DrbdMon::run() + { + try + { ++ // Interval timer initialization ++ // Must be constructed before configuring the Configurable instances ++ interval_timer_mgr = std::unique_ptr( ++ new IntervalTimer(log, bounds(0, config.dsp_interval, MAX_INTERVAL)) ++ ); ++ timer_available = config.dsp_interval != 0; ++ timer_armed = false; ++ ++ configurables = std::unique_ptr(new Configurable*[2]); ++ configurables[0] = dynamic_cast (this); ++ configurables[1] = nullptr; ++ configure_options(); ++ + event_props = std::unique_ptr(new PropsMap(&comparators::compare_string)); + + events_source = std::unique_ptr(new EventsSourceSpawner(log)); + +- events_source->spawn_source(); ++ events_source->spawn_source(&(mon_env.events_file_path)); + events_io = std::unique_ptr( + new EventsIo(events_source->get_events_out_fd(), events_source->get_events_err_fd()) + ); +@@ -125,21 +140,6 @@ void DrbdMon::run() + new SubProcessNotification(dynamic_cast (events_io.get())) + ); + +- // Interval timer initialization +- // Must be constructed before configuring the Configurable instances +- interval_timer_mgr = std::unique_ptr( +- new IntervalTimer(log, bounds(0, config.dsp_interval, MAX_INTERVAL)) +- ); +- timer_available = config.dsp_interval != 0; +- timer_armed = false; +- +- configurables = std::unique_ptr(new Configurable*[3]); +- configurables[0] = dynamic_cast (this); +- // configurables[1] = dynamic_cast (display_impl); +- configurables[1] = nullptr; +- configurables[2] = nullptr; +- configure_options(); +- + // Cleanup any zombies that might not have been collected, + // because SIGCHLD is blocked during reinitialization + events_source->cleanup_child_processes(); +@@ -886,6 +886,7 @@ void DrbdMon::announce_options(Configurator& collector) + collector.add_config_option(owner, OPT_HELP); + collector.add_config_option(owner, OPT_VERSION); + collector.add_config_option(owner, OPT_FREQ_LMT); ++ collector.add_config_option(owner, OPT_EVENTS_LOG); + } + + void DrbdMon::options_help() noexcept +@@ -894,6 +895,7 @@ void DrbdMon::options_help() noexcept + std::cerr << DrbdMonConsts::PROGRAM_NAME << " configuration options:\n"; + std::cerr << " --version Display version information\n"; + std::cerr << " --help Display help\n"; ++ std::cerr << " --events-log Display the DRBD state saved in the specified file\n"; + std::cerr << " --freqlmt Set a frequency limit for display updates\n"; + std::cerr << " Minimum delay between display updates [integer]\n"; + std::cerr << " Supported unit suffixes: s (seconds), ms (milliseconds)\n"; +@@ -907,7 +909,7 @@ void DrbdMon::options_help() noexcept + } + + // @throws std::bad_alloc, ConfigurationException +-void DrbdMon::set_flag(std::string& key) ++void DrbdMon::set_flag(const std::string& key) + { + if (key == OPT_HELP.key) + { +@@ -929,7 +931,7 @@ void DrbdMon::set_flag(std::string& key) + } + + // @throws std::bad_alloc, ConfigurationException +-void DrbdMon::set_option(std::string& key, std::string& value) ++void DrbdMon::set_option(const std::string& key, const std::string& value) + { + if (key == OPT_FREQ_LMT.key) + { +@@ -984,6 +986,11 @@ void DrbdMon::set_option(std::string& key, std::string& value) + throw ConfigurationException(); + } + } ++ else ++ if (key == OPT_EVENTS_LOG.key) ++ { ++ mon_env.events_file_path = value; ++ } + } + + uint32_t DrbdMon::get_problem_count() const noexcept +diff --git a/user/drbdmon/DrbdMon.h b/user/drbdmon/DrbdMon.h +index 3515446c..330e4445 100644 +--- a/user/drbdmon/DrbdMon.h ++++ b/user/drbdmon/DrbdMon.h +@@ -42,9 +42,11 @@ class DrbdMon : public DrbdMonCore, public Configurable, public Configurator + static const std::string OPT_HELP_KEY; + static const std::string OPT_VERSION_KEY; + static const std::string OPT_FREQ_LMT_KEY; ++ static const std::string OPT_EVENTS_LOG_KEY; + static const ConfigOption OPT_HELP; + static const ConfigOption OPT_VERSION; + static const ConfigOption OPT_FREQ_LMT; ++ static const ConfigOption OPT_EVENTS_LOG; + + // Environment variable for color mode selection + static const char* ENV_COLOR_MODE; +@@ -120,10 +122,10 @@ class DrbdMon : public DrbdMonCore, public Configurable, public Configurator + virtual void options_help() noexcept override; + + // @throws std::bad_alloc +- virtual void set_flag(std::string& key) override; ++ virtual void set_flag(const std::string& key) override; + + // @throws std::bad_alloc +- virtual void set_option(std::string& key, std::string& value) override; ++ virtual void set_option(const std::string& key, const std::string& value) override; + + virtual uint32_t get_problem_count() const noexcept override; + +diff --git a/user/drbdmon/MonitorEnvironment.h b/user/drbdmon/MonitorEnvironment.h +index 758b2d3e..35e1cd9b 100644 +--- a/user/drbdmon/MonitorEnvironment.h ++++ b/user/drbdmon/MonitorEnvironment.h +@@ -18,8 +18,9 @@ class MonitorEnvironment + std::unique_ptr log; + std::unique_ptr debug_log; + std::unique_ptr config; +- std::unique_ptr node_name_mgr; ++ std::string node_name; + std::string config_file_path; ++ std::string events_file_path; + }; + + #endif /* MONITORENVIRONMENT_H */ +diff --git a/user/drbdmon/drbdmon_main.cpp b/user/drbdmon/drbdmon_main.cpp +index be29b5ac..36c1b518 100644 +--- a/user/drbdmon/drbdmon_main.cpp ++++ b/user/drbdmon/drbdmon_main.cpp +@@ -65,9 +65,9 @@ namespace drbdmon + static void clear_screen() noexcept; + static void cond_print_error_header( + bool& error_header_printed, +- const std::unique_ptr& node_name ++ const std::string& node_name + ) noexcept; +- static void set_window_title(const std::string* const node_name); ++ static void set_window_title(const std::string& node_name); + static void clear_window_title(); + } + +@@ -164,7 +164,7 @@ int main(int argc, char* argv[]) + } + else + { +- drbdmon::cond_print_error_header(mon_env.error_header_printed, mon_env.node_name_mgr); ++ drbdmon::cond_print_error_header(mon_env.error_header_printed, mon_env.node_name); + std::cout << "Application start failed, cannot adjust security settings" << std::endl; + exit_code = drbdmon::EXIT_ERR_SECURITY; + } +@@ -206,15 +206,13 @@ static void drbdmon::monitor_loop( + mon_env.error_header_printed = false; + try + { +- if (mon_env.node_name_mgr == nullptr) ++ if (mon_env.node_name.empty()) + { +- system_api::init_node_name(mon_env.node_name_mgr); ++ system_api::init_node_name(mon_env.node_name); + } +- drbdmon::set_window_title(mon_env.node_name_mgr.get()); ++ drbdmon::set_window_title(mon_env.node_name); + +- const std::unique_ptr dm_instance( +- new DrbdMon(argc, argv, mon_env) +- ); ++ const std::unique_ptr dm_instance(new DrbdMon(argc, argv, mon_env)); + dm_instance->run(); + if (mon_env.fin_action != DrbdMon::finish_action::TERMINATE_NO_CLEAR) + { +@@ -237,7 +235,7 @@ static void drbdmon::monitor_loop( + { + if (mon_env.log->has_entries()) + { +- drbdmon::cond_print_error_header(mon_env.error_header_printed, mon_env.node_name_mgr); ++ drbdmon::cond_print_error_header(mon_env.error_header_printed, mon_env.node_name); + std::cout << "** " << DrbdMonConsts::PROGRAM_NAME << " messages log\n\n"; + mon_env.log->display_messages(std::cout); + std::cout << std::endl; +@@ -246,7 +244,7 @@ static void drbdmon::monitor_loop( + + if (mon_env.fail_data == DrbdMon::fail_info::OUT_OF_MEMORY) + { +- drbdmon::cond_print_error_header(mon_env.error_header_printed, mon_env.node_name_mgr); ++ drbdmon::cond_print_error_header(mon_env.error_header_printed, mon_env.node_name); + std::cout << "** " << DrbdMonConsts::PROGRAM_NAME << + ": Out of memory, trying to restart" << std::endl; + } +@@ -258,7 +256,7 @@ static void drbdmon::monitor_loop( + else + if (mon_env.fin_action == DrbdMon::finish_action::RESTART_DELAYED) + { +- drbdmon::cond_print_error_header(mon_env.error_header_printed, mon_env.node_name_mgr); ++ drbdmon::cond_print_error_header(mon_env.error_header_printed, mon_env.node_name); + std::cout << "** " << DrbdMonConsts::PROGRAM_NAME << ": Reinitializing in " << + (static_cast (drbdmon::DELAY_MSECS) / 1000) << " seconds" << std::endl; + +@@ -282,7 +280,7 @@ static void drbdmon::monitor_loop( + else + if (mon_env.fin_action == DrbdMon::finish_action::RESTART_IMMED) + { +- drbdmon::cond_print_error_header(mon_env.error_header_printed, mon_env.node_name_mgr); ++ drbdmon::cond_print_error_header(mon_env.error_header_printed, mon_env.node_name); + std::cout << "** " << DrbdMonConsts::PROGRAM_NAME << ": Reinitializing immediately" << std::endl; + } + } +@@ -295,26 +293,25 @@ static void drbdmon::clear_screen() noexcept + + static void drbdmon::cond_print_error_header( + bool& error_header_printed, +- const std::unique_ptr& node_name ++ const std::string& node_name + ) noexcept + { + if (!error_header_printed) + { + std::cout << "** " << DrbdMonConsts::PROGRAM_NAME << " v" << DrbdMonConsts::UTILS_VERSION << '\n'; +- if (node_name != nullptr) ++ if (!node_name.empty()) + { +- std::string* node_name_ptr = node_name.get(); +- std::cout << " Node " << *node_name_ptr << '\n'; ++ std::cout << " Node " << node_name << '\n'; + } + error_header_printed = true; + } + } + +-static void drbdmon::set_window_title(const std::string* const node_name) ++static void drbdmon::set_window_title(const std::string& node_name) + { +- if (node_name != nullptr) ++ if (!node_name.empty()) + { +- std::cout << "\x1B]2;" << WINDOW_TITLE_APP << "(Node " << *node_name << ")\x07"; ++ std::cout << "\x1B]2;" << WINDOW_TITLE_APP << "(Node " << node_name << ")\x07"; + } + else + { +diff --git a/user/drbdmon/subprocess/EventsSourceSpawner.cpp b/user/drbdmon/subprocess/EventsSourceSpawner.cpp +index 4f372565..20fa13be 100644 +--- a/user/drbdmon/subprocess/EventsSourceSpawner.cpp ++++ b/user/drbdmon/subprocess/EventsSourceSpawner.cpp +@@ -13,14 +13,15 @@ extern "C" + #include + } + +-const char* EventsSourceSpawner::EVENTS_PROGRAM = "drbdsetup"; +-const char* EventsSourceSpawner::EVENTS_PROGRAM_ARGS[] = ++const char* const EventsSourceSpawner::EVENTS_PROGRAM = "drbdsetup"; ++const char* const EventsSourceSpawner::EVENTS_PROGRAM_ARGS[] = + { + "drbdsetup", + "events2", + "all", + nullptr + }; ++const char* const EventsSourceSpawner::SAVED_EVENTS_PROGRAM = "eventsfeeder"; + + EventsSourceSpawner::EventsSourceSpawner(MessageLog& logRef): + log(logRef) +@@ -73,7 +74,7 @@ int EventsSourceSpawner::get_events_err_fd() + } + + // @throws std::bad_alloc, EventSourceException +-void EventsSourceSpawner::spawn_source() ++void EventsSourceSpawner::spawn_source(const std::string* const save_file_path_ptr) + { + // Initialize the pipes + posix::Pipe out_pipe_mgr(&out_pipe_fd); +@@ -89,7 +90,23 @@ void EventsSourceSpawner::spawn_source() + // Initialize the datastructures for posix_spawn()) + posix::SpawnFileActions pipe_init; + posix::SpawnAttr spawn_attr; +- posix::SpawnArgs spawn_args(EVENTS_PROGRAM_ARGS); ++ std::unique_ptr spawn_args; ++ ++ const char* provider_pgm = nullptr; ++ if (save_file_path_ptr == nullptr || save_file_path_ptr->empty()) ++ { ++ provider_pgm = EVENTS_PROGRAM; ++ spawn_args = std::unique_ptr(new posix::SpawnArgs(EVENTS_PROGRAM_ARGS)); ++ } ++ else ++ { ++ provider_pgm = SAVED_EVENTS_PROGRAM; ++ const char* args[3]; ++ args[0] = SAVED_EVENTS_PROGRAM; ++ args[1] = save_file_path_ptr->c_str(); ++ args[2] = nullptr; ++ spawn_args = std::unique_ptr(new posix::SpawnArgs(args)); ++ } + + // Redirect stdout to the pipes write side + checked_int_rc( +@@ -132,8 +149,8 @@ void EventsSourceSpawner::spawn_source() + checked_int_rc(posix_spawnattr_setflags(spawn_attr.attr, POSIX_SPAWN_SETSIGDEF)); + + // Attempt to spawn the events source program +- int spawn_rc = posix_spawnp(&spawned_pid, EVENTS_PROGRAM, pipe_init.actions, spawn_attr.attr, +- spawn_args.args, environ); ++ int spawn_rc = posix_spawnp(&spawned_pid, provider_pgm, pipe_init.actions, spawn_attr.attr, ++ spawn_args->args, environ); + if (spawn_rc != 0) + { + spawned_pid = -1; +diff --git a/user/drbdmon/subprocess/EventsSourceSpawner.h b/user/drbdmon/subprocess/EventsSourceSpawner.h +index 0c4a1fa3..51902039 100644 +--- a/user/drbdmon/subprocess/EventsSourceSpawner.h ++++ b/user/drbdmon/subprocess/EventsSourceSpawner.h +@@ -3,6 +3,7 @@ + + #include + #include ++#include + #include + + #include +@@ -16,8 +17,9 @@ extern "C" + class EventsSourceSpawner + { + public: +- static const char* EVENTS_PROGRAM; +- static const char* EVENTS_PROGRAM_ARGS[]; ++ static const char* const EVENTS_PROGRAM; ++ static const char* const EVENTS_PROGRAM_ARGS[]; ++ static const char* const SAVED_EVENTS_PROGRAM; + + EventsSourceSpawner(MessageLog& logRef); + virtual ~EventsSourceSpawner(); +@@ -32,7 +34,7 @@ class EventsSourceSpawner + virtual int get_events_err_fd(); + + // @throws std::bad_alloc, EventSourceException +- virtual void spawn_source(); ++ virtual void spawn_source(const std::string* const save_file_path_ptr); + + // @throws EventsSourceException + virtual void cleanup_child_processes(); +diff --git a/user/drbdmon/terminal/ComponentsHub.cpp b/user/drbdmon/terminal/ComponentsHub.cpp +index 94443ccd..5c1a3fd5 100644 +--- a/user/drbdmon/terminal/ComponentsHub.cpp ++++ b/user/drbdmon/terminal/ComponentsHub.cpp +@@ -48,6 +48,7 @@ void ComponentsHub::verify() const + log == nullptr || + debug_log == nullptr || + node_name == nullptr || ++ events_file == nullptr || + ansi_ctl == nullptr || + style_coll == nullptr || + active_color_table == nullptr || +diff --git a/user/drbdmon/terminal/ComponentsHub.h b/user/drbdmon/terminal/ComponentsHub.h +index 28f36a2b..2266214f 100644 +--- a/user/drbdmon/terminal/ComponentsHub.h ++++ b/user/drbdmon/terminal/ComponentsHub.h +@@ -42,6 +42,7 @@ class ComponentsHub + DrbdCommands* drbd_cmd_exec {nullptr}; + const Configuration* config {nullptr}; + const std::string* node_name {nullptr}; ++ const std::string* events_file {nullptr}; + + AnsiControl* ansi_ctl {nullptr}; + DisplayStyleCollection* style_coll {nullptr}; +diff --git a/user/drbdmon/terminal/DisplayCommonImpl.cpp b/user/drbdmon/terminal/DisplayCommonImpl.cpp +index 15babde9..8427b2fc 100644 +--- a/user/drbdmon/terminal/DisplayCommonImpl.cpp ++++ b/user/drbdmon/terminal/DisplayCommonImpl.cpp +@@ -38,6 +38,17 @@ void DisplayCommonImpl::display_header() const + "%s%s%s", clr.title_bar.c_str(), AnsiControl::ANSI_CLEAR_LINE.c_str(), + program_version.c_str() + ); ++ if (dsp_comp_hub.events_file != nullptr && !dsp_comp_hub.events_file->empty()) ++ { ++ dsp_io.write_text(" | "); ++ dsp_io.write_text(clr.alert_label.c_str()); ++ dsp_io.write_text("File "); ++ dsp_io.write_string_field( ++ *(dsp_comp_hub.events_file), ++ dsp_comp_hub.term_cols - program_version.length() - 8, false ++ ); ++ } ++ else + if (dsp_comp_hub.node_name != nullptr) + { + dsp_io.write_text(" | Node "); +diff --git a/user/drbdmon/terminal/DisplayController.cpp b/user/drbdmon/terminal/DisplayController.cpp +index 2eff7be6..ccf3e7bc 100644 +--- a/user/drbdmon/terminal/DisplayController.cpp ++++ b/user/drbdmon/terminal/DisplayController.cpp +@@ -49,6 +49,8 @@ DisplayController::DisplayController( + core_instance(core_instance_ref), + mon_env(mon_env_ref) + { ++ events_file = mon_env.sys_api->file_name_for_path(mon_env.events_file_path); ++ + dsp_map = std::unique_ptr(new DisplayMap(&comparators::compare_string)); + + term_ctl_mgr = mon_env.sys_api->create_terminal_control(); +@@ -62,16 +64,17 @@ DisplayController::DisplayController( + sub_proc_queue_mgr = std::unique_ptr(new SubProcessQueue()); + + dsp_comp_hub_mgr->core_instance = &core_instance; +- dsp_comp_hub_mgr->sys_api = &(mon_env.sys_api); ++ dsp_comp_hub_mgr->sys_api = mon_env.sys_api.get(); + dsp_comp_hub_mgr->dsp_selector = dynamic_cast (this); + dsp_comp_hub_mgr->dsp_io = dsp_io_mgr.get(); + dsp_comp_hub_mgr->dsp_shared = dsp_shared_mgr.get(); + dsp_comp_hub_mgr->term_size = dynamic_cast (term_size_mgr.get()); + dsp_comp_hub_mgr->rsc_map = &rsc_map_ref; + dsp_comp_hub_mgr->prb_rsc_map = &prb_rsc_map_ref; +- dsp_comp_hub_mgr->log = &(mon_env.log); +- dsp_comp_hub_mgr->debug_log = &(mon_env.debug_log); +- dsp_comp_hub_mgr->node_name = mon_env.node_name_mgr.get(); ++ dsp_comp_hub_mgr->log = mon_env.log.get(); ++ dsp_comp_hub_mgr->debug_log = mon_env.debug_log.get(); ++ dsp_comp_hub_mgr->node_name = &(mon_env.node_name); ++ dsp_comp_hub_mgr->events_file = &events_file; + dsp_comp_hub_mgr->style_coll = dsp_styles_mgr.get(); + dsp_comp_hub_mgr->ansi_ctl = ansi_ctl_mgr.get(); + dsp_comp_hub_mgr->sub_proc_queue = sub_proc_queue_mgr.get(); +diff --git a/user/drbdmon/terminal/DisplayController.h b/user/drbdmon/terminal/DisplayController.h +index 4dee5300..8389c2b5 100644 +--- a/user/drbdmon/terminal/DisplayController.h ++++ b/user/drbdmon/terminal/DisplayController.h +@@ -86,6 +86,8 @@ class DisplayController : public GenericDisplay, public DisplaySelector + DrbdMonCore& core_instance; + MonitorEnvironment& mon_env; + ++ std::string events_file; ++ + std::unique_ptr dsp_map; + + std::unique_ptr term_ctl_mgr; +-- +2.33.1.windows.1 + diff --git a/backport-DRBDmon-Pass-through-the-monitor-environment.patch b/backport-DRBDmon-Pass-through-the-monitor-environment.patch new file mode 100644 index 0000000..d75eb14 --- /dev/null +++ b/backport-DRBDmon-Pass-through-the-monitor-environment.patch @@ -0,0 +1,374 @@ +From bc1fbb31f92c2ac59a7e3a9021e044fe6349ec9e Mon Sep 17 00:00:00 2001 +From: Robert Altnoeder +Date: Tue, 19 Mar 2024 14:30:45 +0100 +Subject: [PATCH 081/100] DRBDmon: Pass-through the monitor environment + +--- + user/drbdmon/DrbdMon.cpp | 45 +++++++++---------- + user/drbdmon/DrbdMon.h | 5 +-- + user/drbdmon/drbdmon_main.cpp | 1 - + user/drbdmon/terminal/DisplayController.cpp | 48 ++++++++++----------- + user/drbdmon/terminal/DisplayController.h | 10 ++--- + 5 files changed, 47 insertions(+), 62 deletions(-) + +diff --git a/user/drbdmon/DrbdMon.cpp b/user/drbdmon/DrbdMon.cpp +index 2d27f2a0..b9ac34d8 100644 +--- a/user/drbdmon/DrbdMon.cpp ++++ b/user/drbdmon/DrbdMon.cpp +@@ -71,15 +71,14 @@ DrbdMon::DrbdMon( + char* argv[], + MonitorEnvironment& mon_env_ref + ): +- sys_api(*(mon_env_ref.sys_api)), ++ mon_env(mon_env_ref), + arg_count(argc), + arg_values(argv), +- fail_data(mon_env_ref.fail_data), + log(*(mon_env_ref.log)), + debug_log(*(mon_env_ref.debug_log)), +- node_name(mon_env_ref.node_name_mgr.get()), + config(*(mon_env_ref.config)) + { ++ mon_env.fin_action = DrbdMonCore::finish_action::RESTART_IMMED; + rsc_dir_mgr = std::unique_ptr( + new ResourceDirectory(*(mon_env_ref.log), *(mon_env_ref.debug_log)) + ); +@@ -92,7 +91,7 @@ DrbdMon::~DrbdMon() noexcept + + SystemApi& DrbdMon::get_system_api() const noexcept + { +- return sys_api; ++ return *(mon_env.sys_api); + } + + // @throws std::bad_alloc +@@ -158,14 +157,10 @@ void DrbdMon::run() + ResourcesMap& prb_rsc_map = rsc_dir->get_problem_resources_map(); + display_impl = new DisplayController( + *core_instance, +- sys_api, ++ mon_env, + *sub_proc_obs, + rsc_map, +- prb_rsc_map, +- log, +- debug_log, +- config, +- node_name ++ prb_rsc_map + ); + } + +@@ -239,7 +234,7 @@ void DrbdMon::run() + case CoreIo::signal_type::SIGNAL_EXIT: + { + // Terminate main loop +- fin_action = DrbdMonCore::finish_action::TERMINATE; ++ mon_env.fin_action = DrbdMonCore::finish_action::TERMINATE; + shutdown_flag = true; + break; + } +@@ -257,7 +252,7 @@ void DrbdMon::run() + } + case CoreIo::signal_type::SIGNAL_DEBUG: + { +- fin_action = DrbdMonCore::finish_action::DEBUG_MODE; ++ mon_env.fin_action = DrbdMonCore::finish_action::DEBUG_MODE; + shutdown_flag = true; + break; + } +@@ -346,8 +341,8 @@ void DrbdMon::run() + MessageLog::log_level::ALERT, + "The connection to the DRBD events source failed due to an I/O error" + ); +- fin_action = DrbdMonCore::finish_action::RESTART_DELAYED; +- fail_data = DrbdMonCore::fail_info::EVENTS_IO; ++ mon_env.fin_action = DrbdMonCore::finish_action::RESTART_DELAYED; ++ mon_env.fail_data = DrbdMonCore::fail_info::EVENTS_IO; + } + catch (EventsSourceException& src_exc) + { +@@ -371,8 +366,8 @@ void DrbdMon::run() + *debug_info + ); + } +- fin_action = DrbdMonCore::finish_action::RESTART_DELAYED; +- fail_data = DrbdMonCore::fail_info::EVENTS_SOURCE; ++ mon_env.fin_action = DrbdMonCore::finish_action::RESTART_DELAYED; ++ mon_env.fail_data = DrbdMonCore::fail_info::EVENTS_SOURCE; + } + catch (EventsIoException& io_exc) + { +@@ -396,8 +391,8 @@ void DrbdMon::run() + *debug_info + ); + } +- fin_action = DrbdMonCore::finish_action::RESTART_DELAYED; +- fail_data = DrbdMonCore::fail_info::EVENTS_IO; ++ mon_env.fin_action = DrbdMonCore::finish_action::RESTART_DELAYED; ++ mon_env.fail_data = DrbdMonCore::fail_info::EVENTS_IO; + } + catch (EventException& event_exc) + { +@@ -437,15 +432,15 @@ void DrbdMon::run() + ); + } + +- fin_action = DrbdMonCore::finish_action::RESTART_DELAYED; +- fail_data = DrbdMonCore::fail_info::GENERIC; ++ mon_env.fin_action = DrbdMonCore::finish_action::RESTART_DELAYED; ++ mon_env.fail_data = DrbdMonCore::fail_info::GENERIC; + } + catch (ConfigurationException&) + { + // A ConfigurationException is thrown to abort and exit + // while configuring options + // (--help uses this too) +- fin_action = DrbdMonCore::finish_action::TERMINATE_NO_CLEAR; ++ mon_env.fin_action = DrbdMonCore::finish_action::TERMINATE_NO_CLEAR; + } + } + catch (std::bad_alloc&) +@@ -459,7 +454,7 @@ void DrbdMon::run() + + void DrbdMon::shutdown(const DrbdMonCore::finish_action action) noexcept + { +- fin_action = action; ++ mon_env.fin_action = action; + shutdown_flag = true; + } + +@@ -556,7 +551,7 @@ void DrbdMon::process_event_message( + // Report recovering from errors that triggered reinitialization + // of the DrbdMon instance + +- switch (fail_data) ++ switch (mon_env.fail_data) + { + case DrbdMonCore::fail_info::NONE: + // no-op +@@ -597,7 +592,7 @@ void DrbdMon::process_event_message( + // In case that multiple "exists -" lines are received, + // which is actually not supposed to happen, avoid spamming + // the message log +- fail_data = fail_info::NONE; ++ mon_env.fail_data = fail_info::NONE; + } + } + else +@@ -697,7 +692,7 @@ void DrbdMon::process_event_message( + */ + DrbdMonCore::finish_action DrbdMon::get_fin_action() const + { +- return fin_action; ++ return mon_env.fin_action; + } + + /** +diff --git a/user/drbdmon/DrbdMon.h b/user/drbdmon/DrbdMon.h +index 586417f7..3515446c 100644 +--- a/user/drbdmon/DrbdMon.h ++++ b/user/drbdmon/DrbdMon.h +@@ -137,7 +137,7 @@ class DrbdMon : public DrbdMonCore, public Configurable, public Configurator + } + option_entry; + +- SystemApi& sys_api; ++ MonitorEnvironment& mon_env; + + using OptionsMap = QTree; + +@@ -149,11 +149,8 @@ class DrbdMon : public DrbdMonCore, public Configurable, public Configurator + + std::unique_ptr options; + +- DrbdMonCore::fail_info& fail_data; +- DrbdMonCore::finish_action fin_action {DrbdMonCore::finish_action::RESTART_IMMED}; + MessageLog& log; + MessageLog& debug_log; +- const std::string* const node_name; + Configuration& config; + + bool shutdown_flag {false}; +diff --git a/user/drbdmon/drbdmon_main.cpp b/user/drbdmon/drbdmon_main.cpp +index f92f70ac..be29b5ac 100644 +--- a/user/drbdmon/drbdmon_main.cpp ++++ b/user/drbdmon/drbdmon_main.cpp +@@ -216,7 +216,6 @@ static void drbdmon::monitor_loop( + new DrbdMon(argc, argv, mon_env) + ); + dm_instance->run(); +- mon_env.fin_action = dm_instance->get_fin_action(); + if (mon_env.fin_action != DrbdMon::finish_action::TERMINATE_NO_CLEAR) + { + drbdmon::clear_screen(); +diff --git a/user/drbdmon/terminal/DisplayController.cpp b/user/drbdmon/terminal/DisplayController.cpp +index 6d44e956..2eff7be6 100644 +--- a/user/drbdmon/terminal/DisplayController.cpp ++++ b/user/drbdmon/terminal/DisplayController.cpp +@@ -41,21 +41,17 @@ const std::string DisplayController::INITIAL_WAIT_MSG = "Reading initial DRBD + // @throws std::bad_alloc, std::logic_error + DisplayController::DisplayController( + DrbdMonCore& core_instance_ref, +- SystemApi& sys_api_ref, ++ MonitorEnvironment& mon_env_ref, + SubProcessObserver& sub_proc_obs_ref, + ResourcesMap& rsc_map_ref, +- ResourcesMap& prb_rsc_map_ref, +- MessageLog& log_ref, +- MessageLog& debug_log_ref, +- Configuration& config_ref, +- const std::string* const node_name_ptr ++ ResourcesMap& prb_rsc_map_ref + ): +- core_instance(core_instance_ref) ++ core_instance(core_instance_ref), ++ mon_env(mon_env_ref) + { +- SystemApi& sys_api = core_instance.get_system_api(); + dsp_map = std::unique_ptr(new DisplayMap(&comparators::compare_string)); + +- term_ctl_mgr = sys_api.create_terminal_control(); ++ term_ctl_mgr = mon_env.sys_api->create_terminal_control(); + + dsp_comp_hub_mgr = std::unique_ptr(new ComponentsHub()); + dsp_io_mgr = std::unique_ptr(new DisplayIo(STDOUT_FILENO)); +@@ -66,32 +62,32 @@ DisplayController::DisplayController( + sub_proc_queue_mgr = std::unique_ptr(new SubProcessQueue()); + + dsp_comp_hub_mgr->core_instance = &core_instance; +- dsp_comp_hub_mgr->sys_api = &sys_api_ref; ++ dsp_comp_hub_mgr->sys_api = &(mon_env.sys_api); + dsp_comp_hub_mgr->dsp_selector = dynamic_cast (this); + dsp_comp_hub_mgr->dsp_io = dsp_io_mgr.get(); + dsp_comp_hub_mgr->dsp_shared = dsp_shared_mgr.get(); + dsp_comp_hub_mgr->term_size = dynamic_cast (term_size_mgr.get()); + dsp_comp_hub_mgr->rsc_map = &rsc_map_ref; + dsp_comp_hub_mgr->prb_rsc_map = &prb_rsc_map_ref; +- dsp_comp_hub_mgr->log = &log_ref; +- dsp_comp_hub_mgr->debug_log = &debug_log_ref; +- dsp_comp_hub_mgr->node_name = node_name_ptr; ++ dsp_comp_hub_mgr->log = &(mon_env.log); ++ dsp_comp_hub_mgr->debug_log = &(mon_env.debug_log); ++ dsp_comp_hub_mgr->node_name = mon_env.node_name_mgr.get(); + dsp_comp_hub_mgr->style_coll = dsp_styles_mgr.get(); + dsp_comp_hub_mgr->ansi_ctl = ansi_ctl_mgr.get(); + dsp_comp_hub_mgr->sub_proc_queue = sub_proc_queue_mgr.get(); +- dsp_comp_hub_mgr->config = &config_ref; ++ dsp_comp_hub_mgr->config = mon_env.config.get(); + dsp_comp_hub_mgr->have_term_size = false; + dsp_comp_hub_mgr->term_cols = 100; + dsp_comp_hub_mgr->term_rows = 30; + + { + const DisplayStyleCollection::ColorStyle selected_color_style = +- dsp_styles_mgr->get_color_style_by_numeric_id(config_ref.color_scheme); ++ dsp_styles_mgr->get_color_style_by_numeric_id(mon_env.config->color_scheme); + dsp_comp_hub_mgr->active_color_table = + &(dsp_styles_mgr->get_color_table(selected_color_style)); + + const DisplayStyleCollection::CharacterStyle selected_character_style = +- dsp_styles_mgr->get_character_style_by_numeric_id(config_ref.character_set); ++ dsp_styles_mgr->get_character_style_by_numeric_id(mon_env.config->character_set); + dsp_comp_hub_mgr->active_character_table = + &(dsp_styles_mgr->get_character_table(selected_character_style)); + } +@@ -108,16 +104,16 @@ DisplayController::DisplayController( + dsp_comp_hub_mgr->drbd_cmd_exec = dynamic_cast (drbd_cmd_exec_mgr.get()); + + global_cmd_exec_mgr = std::unique_ptr( +- new GlobalCommandsImpl(*dsp_comp_hub_mgr, config_ref) ++ new GlobalCommandsImpl(*dsp_comp_hub_mgr, *(mon_env.config)) + ); + dsp_comp_hub_mgr->global_cmd_exec = dynamic_cast (global_cmd_exec_mgr.get()); + + dsp_comp_hub_mgr->sub_proc_queue->set_observer(&sub_proc_obs_ref); + + // Sub process queue configuration +- sub_proc_queue_mgr->set_discard_succeeded_tasks(config_ref.discard_succ_tasks); +- sub_proc_queue_mgr->set_discard_finished_tasks(config_ref.discard_fail_tasks); +- dsp_shared_mgr->activate_tasks = !(config_ref.suspend_new_tasks); ++ sub_proc_queue_mgr->set_discard_succeeded_tasks(mon_env.config->discard_succ_tasks); ++ sub_proc_queue_mgr->set_discard_finished_tasks(mon_env.config->discard_fail_tasks); ++ dsp_shared_mgr->activate_tasks = !(mon_env.config->suspend_new_tasks); + + dsp_stack = std::unique_ptr(new DisplayStack(&DisplayController::compare_display_id)); + +@@ -228,23 +224,23 @@ DisplayController::DisplayController( + dynamic_cast (new MDspHelp(dsp_comp_hub)) + ); + log_view_mgr = std::unique_ptr( +- dynamic_cast (new MDspLogViewer(dsp_comp_hub, log_ref)) ++ dynamic_cast (new MDspLogViewer(dsp_comp_hub, *(mon_env.log))) + ); + debug_log_view_mgr = std::unique_ptr( +- dynamic_cast (new MDspLogViewer(dsp_comp_hub, debug_log_ref)) ++ dynamic_cast (new MDspLogViewer(dsp_comp_hub, *(mon_env.debug_log))) + ); + msg_view_mgr = std::unique_ptr( +- dynamic_cast (new MDspMessage(dsp_comp_hub, log_ref)) ++ dynamic_cast (new MDspMessage(dsp_comp_hub, *(mon_env.log))) + ); + debug_msg_view_mgr = std::unique_ptr( +- dynamic_cast (new MDspMessage(dsp_comp_hub, debug_log_ref)) ++ dynamic_cast (new MDspMessage(dsp_comp_hub, *(mon_env.debug_log))) + ); + pgm_info_mgr = std::unique_ptr( + dynamic_cast (new MDspPgmInfo(dsp_comp_hub)) + ); + // Pass a mutable components hub to the configuration display + config_mgr = std::unique_ptr( +- dynamic_cast (new MDspConfiguration(*dsp_comp_hub_mgr, config_ref)) ++ dynamic_cast (new MDspConfiguration(*dsp_comp_hub_mgr, *(mon_env.config))) + ); + + wait_msg_mgr = std::unique_ptr(new MDspWaitMsg(dsp_comp_hub)); +@@ -256,7 +252,7 @@ DisplayController::DisplayController( + DisplayIo* dsp_io = dsp_comp_hub_mgr->dsp_io; + dsp_io->write_text(ansi_ctl->ANSI_ALTBFR_ON.c_str()); + dsp_io->write_text(ansi_ctl->ANSI_CURSOR_OFF.c_str()); +- if (config_ref.enable_mouse_nav) ++ if (mon_env.config->enable_mouse_nav) + { + dsp_io->write_text(ansi_ctl->ANSI_MOUSE_ON.c_str()); + } +diff --git a/user/drbdmon/terminal/DisplayController.h b/user/drbdmon/terminal/DisplayController.h +index 2108faba..4dee5300 100644 +--- a/user/drbdmon/terminal/DisplayController.h ++++ b/user/drbdmon/terminal/DisplayController.h +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -48,14 +49,10 @@ class DisplayController : public GenericDisplay, public DisplaySelector + // @throws std::bad_alloc, std::logic_error + DisplayController( + DrbdMonCore& core_instance_ref, +- SystemApi& sys_api_ref, ++ MonitorEnvironment& mon_env_ref, + SubProcessObserver& sub_proc_obs_ref, + ResourcesMap& rsc_map_ref, +- ResourcesMap& prb_rsc_map_ref, +- MessageLog& log_ref, +- MessageLog& debug_log_ref, +- Configuration& config_ref, +- const std::string* const node_name_ptr ++ ResourcesMap& prb_rsc_map_ref + ); + virtual ~DisplayController() noexcept; + DisplayController(const DisplayController& other) = delete; +@@ -87,6 +84,7 @@ class DisplayController : public GenericDisplay, public DisplaySelector + using DisplayStack = VList; + + DrbdMonCore& core_instance; ++ MonitorEnvironment& mon_env; + + std::unique_ptr dsp_map; + +-- +2.33.1.windows.1 + diff --git a/backport-DRBDmon-SystemApi-methods-update.patch b/backport-DRBDmon-SystemApi-methods-update.patch new file mode 100644 index 0000000..820d60f --- /dev/null +++ b/backport-DRBDmon-SystemApi-methods-update.patch @@ -0,0 +1,176 @@ +From 8daafbc09ac2653a63c5a381e17e844207ea96c6 Mon Sep 17 00:00:00 2001 +From: Robert Altnoeder +Date: Tue, 19 Mar 2024 16:00:22 +0100 +Subject: [PATCH 082/100] DRBDmon: SystemApi methods update + +- Modify node name query +- Add file name extraction from path +- Mark suitable methods const +--- + user/drbdmon/platform/Linux/SystemApiImpl.cpp | 21 +++++++++++++--- + user/drbdmon/platform/Linux/SystemApiImpl.h | 3 ++- + user/drbdmon/platform/NT/SystemApiImpl.cpp | 25 +++++++++++++++---- + user/drbdmon/platform/NT/SystemApiImpl.h | 3 ++- + user/drbdmon/platform/SystemApi.h | 5 ++-- + 5 files changed, 45 insertions(+), 12 deletions(-) + +diff --git a/user/drbdmon/platform/Linux/SystemApiImpl.cpp b/user/drbdmon/platform/Linux/SystemApiImpl.cpp +index 85a31f3a..5017068c 100644 +--- a/user/drbdmon/platform/Linux/SystemApiImpl.cpp ++++ b/user/drbdmon/platform/Linux/SystemApiImpl.cpp +@@ -48,7 +48,7 @@ std::unique_ptr LinuxApi::create_terminal_control() + return std::unique_ptr(dynamic_cast (new TerminalControlImpl())); + } + +-bool LinuxApi::is_file_accessible(const char* const file_path) ++bool LinuxApi::is_file_accessible(const char* const file_path) const + { + struct stat file_info; + std::memset(&file_info, 0, sizeof (file_info)); +@@ -73,6 +73,21 @@ std::string LinuxApi::get_config_file_path() + return path; + } + ++std::string LinuxApi::file_name_for_path(const std::string path) const ++{ ++ std::string file_name; ++ const size_t split_idx = path.rfind('/'); ++ if (split_idx == std::string::npos) ++ { ++ file_name = path; ++ } ++ else ++ { ++ file_name = path.substr(split_idx + 1); ++ } ++ return file_name; ++} ++ + namespace system_api + { + std::unique_ptr create_system_api() +@@ -192,13 +207,13 @@ namespace system_api + return ids_safe; + } + +- void init_node_name(std::unique_ptr& node_name_mgr) ++ void init_node_name(std::string& node_name) + { + std::unique_ptr uname_buffer(new struct utsname); + int rc = uname(uname_buffer.get()); + if (rc == 0) + { +- node_name_mgr = std::unique_ptr(new std::string(uname_buffer->nodename)); ++ node_name = uname_buffer->nodename; + } + } + } +diff --git a/user/drbdmon/platform/Linux/SystemApiImpl.h b/user/drbdmon/platform/Linux/SystemApiImpl.h +index 9bc6a8b0..c476c2e7 100644 +--- a/user/drbdmon/platform/Linux/SystemApiImpl.h ++++ b/user/drbdmon/platform/Linux/SystemApiImpl.h +@@ -22,7 +22,8 @@ class LinuxApi : public SystemApi + virtual std::unique_ptr create_subprocess_handler() override; + virtual std::unique_ptr create_terminal_control() override; + virtual std::string get_config_file_path() override; +- virtual bool is_file_accessible(const char* const file_path) override; ++ virtual std::string file_name_for_path(const std::string path) const override; ++ virtual bool is_file_accessible(const char* const file_path) const override; + + private: + static const char* const CONFIG_FILE_NAME; +diff --git a/user/drbdmon/platform/NT/SystemApiImpl.cpp b/user/drbdmon/platform/NT/SystemApiImpl.cpp +index 2e9ad12e..d39d9b0f 100644 +--- a/user/drbdmon/platform/NT/SystemApiImpl.cpp ++++ b/user/drbdmon/platform/NT/SystemApiImpl.cpp +@@ -51,7 +51,22 @@ std::string NtApi::get_config_file_path() + return path; + } + +-bool NtApi::is_file_accessible(const char* const file_path) ++std::string NtApi::file_name_for_path(const std::string path) const ++{ ++ std::string file_name; ++ const size_t split_idx = path.rfind('\\'); ++ if (split_idx == std::string::npos) ++ { ++ file_name = path; ++ } ++ else ++ { ++ file_name = path.substr(split_idx + 1); ++ } ++ return file_name; ++} ++ ++bool NtApi::is_file_accessible(const char* const file_path) const + { + return PathFileExistsA(file_path) != 0; + } +@@ -72,8 +87,9 @@ namespace system_api + return true; + } + +- void init_node_name(std::unique_ptr& node_name_mgr) ++ void init_node_name(std::string& node_name) + { ++ node_name.clear(); + try + { + std::unique_ptr name_buffer(new char[MAX_COMPUTER_NAME_LENGTH]); +@@ -83,14 +99,13 @@ namespace system_api + { + if (length >= 1 && length < MAX_COMPUTER_NAME_LENGTH) + { +- node_name_mgr = std::unique_ptr(new std::string()); +- node_name_mgr->append(name_buffer.get(), length); ++ node_name->append(name_buffer.get(), length); + } + } + } + catch (std::bad_alloc&) + { +- node_name_mgr = nullptr; ++ // no-op + } + } + } +diff --git a/user/drbdmon/platform/NT/SystemApiImpl.h b/user/drbdmon/platform/NT/SystemApiImpl.h +index e28d6a1b..251f1b48 100644 +--- a/user/drbdmon/platform/NT/SystemApiImpl.h ++++ b/user/drbdmon/platform/NT/SystemApiImpl.h +@@ -13,7 +13,8 @@ class NtApi : public SystemApi + virtual std::unique_ptr create_subprocess_handler() override; + virtual std::unique_ptr create_terminal_control() override; + virtual std::string get_config_file_path() override; +- virtual bool is_file_accessible(const char* const file_path) override; ++ virtual std::string file_name_for_path(const std::string path) const override; ++ virtual bool is_file_accessible(const char* const file_path) const override; + + private: + static const char* const CONFIG_FILE_NAME; +diff --git a/user/drbdmon/platform/SystemApi.h b/user/drbdmon/platform/SystemApi.h +index 21414f4d..691968bd 100644 +--- a/user/drbdmon/platform/SystemApi.h ++++ b/user/drbdmon/platform/SystemApi.h +@@ -26,14 +26,15 @@ class SystemApi + virtual std::unique_ptr create_subprocess_handler() = 0; + virtual std::unique_ptr create_terminal_control() = 0; + virtual std::string get_config_file_path() = 0; +- virtual bool is_file_accessible(const char* const file_path) = 0; ++ virtual std::string file_name_for_path(const std::string path) const = 0; ++ virtual bool is_file_accessible(const char* const file_path) const = 0; + }; + + namespace system_api + { + std::unique_ptr create_system_api(); + bool init_security(MessageLog& log); +- void init_node_name(std::unique_ptr& node_name_mgr); ++ void init_node_name(std::string& node_name); + } + + #endif /* SYSTEMAPI_H */ +-- +2.33.1.windows.1 + diff --git a/drbd.spec b/drbd.spec index 91a3ccd..ea43134 100644 --- a/drbd.spec +++ b/drbd.spec @@ -1,7 +1,7 @@ Name: drbd Summary: DRBD user-land tools and scripts Version: 9.28.0 -Release: 14 +Release: 15 Source0: http://www.linbit.com/downloads/%{name}/utils/%{name}-utils-%{version}.tar.gz Patch0: drbd-utils-9.12.2-disable_xsltproc_network_read.patch Patch1: drbd-utils-9.15.0-make_configure-workaround.patch @@ -60,6 +60,10 @@ Patch36: backport-DRBDmon-Fix-CfgEntryStore-UUID.patch Patch37: backport-DRBDmon-Update-display-interval-field-on-configurati.patch Patch38: backport-DRBDmon-Declare-AnsiControl-destructor-virtual.patch Patch39: backport-DRBDmon-Busy-indicator-debug-log-updates.patch +Patch40: backport-DRBDmon-Pass-through-the-monitor-environment.patch +Patch41: backport-DRBDmon-Enable-loading-saved-DRBD-events-adjust-node.patch +Patch42: backport-DRBDmon-SystemApi-methods-update.patch + License: GPL-2.0-or-later ExclusiveOS: linux @@ -269,6 +273,9 @@ management utility. %systemd_preun drbd.service %changelog +* Wed Nov 20 2024 liupei - 9.28.0-15 +- DRBDmon: Pass-through the monitor environment + * Thu Oct 31 2024 liupei - 9.28.0-14 - DRBDmon: Fix CfgEntryStore UUID - DRBDmon: Update display interval field on configuration load or reset -- Gitee