- Update drbd-utils from 9.25.0 to 9.29.0
OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/drbd-utils?expand=0&rev=142
This commit is contained in:
commit
f41655cb5d
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
## Default LFS
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.osc
|
42
0001-drbd-verify.py-relax-host-key-checking.patch
Normal file
42
0001-drbd-verify.py-relax-host-key-checking.patch
Normal file
@ -0,0 +1,42 @@
|
||||
From c72edcfbb0ec0ea587dd75be7c8fa5a407380ab4 Mon Sep 17 00:00:00 2001
|
||||
From: Philipp Reisner <philipp.reisner@linbit.com>
|
||||
Date: Mon, 4 Nov 2024 18:03:22 +0100
|
||||
Subject: [PATCH 01/12] drbd-verify.py: relax host key checking
|
||||
|
||||
---
|
||||
scripts/drbd-verify.py | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/scripts/drbd-verify.py b/scripts/drbd-verify.py
|
||||
index 3699a1687fa4..4232cd911ecc 100755
|
||||
--- a/scripts/drbd-verify.py
|
||||
+++ b/scripts/drbd-verify.py
|
||||
@@ -8,6 +8,7 @@ import sys
|
||||
import re
|
||||
import os
|
||||
|
||||
+ssh_opts = ['-oStrictHostKeyChecking=no']
|
||||
events_re = re.compile(r'change peer-device name:(\S+) peer-node-id:(\d+) conn-name:(\S+) volume:0 replication:(\w+)->(\w+)')
|
||||
progress_re = re.compile(r'change peer-device name:(\S+) peer-node-id:(\d+) conn-name:(\S+) volume:0 done:(\d+\.\d+)')
|
||||
|
||||
@@ -103,7 +104,7 @@ def verify_res(res_json, peers, mbr_only: bool, level2:bool):
|
||||
if len(diskful_peers) >= 1:
|
||||
for i, peer_json in enumerate(diskful_peers):
|
||||
peer_name = peer_json['name']
|
||||
- args = ['ssh', peer_name, '/tmp/' + this_prog_name, '--json']
|
||||
+ args = ['ssh'] + ssh_opts + [peer_name, '/tmp/' + this_prog_name, '--json']
|
||||
args += ['--resource', res_name, '--level2']
|
||||
peers = [p['name'] for j, p in enumerate(diskful_peers) if j > i]
|
||||
if peers:
|
||||
@@ -114,7 +115,7 @@ def verify_res(res_json, peers, mbr_only: bool, level2:bool):
|
||||
if level2:
|
||||
continue
|
||||
args.append('--mbr-only')
|
||||
- subprocess.run(['scp', '-q', this_prog_path, '{}:/tmp/'.format(peer_name)])
|
||||
+ subprocess.run(['scp'] + ssh_opts + ['-q', this_prog_path, '{}:/tmp/'.format(peer_name)])
|
||||
with subprocess.Popen(args, stdout=subprocess.PIPE) as p:
|
||||
peer_result = json.load(p.stdout)
|
||||
result_json['oos'].update(peer_result[res_name]['oos'])
|
||||
--
|
||||
2.43.0
|
||||
|
@ -0,0 +1,35 @@
|
||||
From e64b8b13435f99ba21a74caeebeb996f76dfd43c Mon Sep 17 00:00:00 2001
|
||||
From: Joel Colledge <joel.colledge@linbit.com>
|
||||
Date: Wed, 26 Jul 2023 10:14:54 +0200
|
||||
Subject: [PATCH] drbdadm,v9: do not segfault when re-configuring proxy with no
|
||||
path
|
||||
|
||||
This prevents a segfault when a resource has a connection with no path,
|
||||
and "adjust" attempts to re-configure proxy.
|
||||
|
||||
This could occur as follows, when drbd-proxy-ctl is not on $PATH:
|
||||
* Bring resource and connection up without proxy.
|
||||
* Add proxy configuration to res file.
|
||||
* "drbdadm adjust <res>" - this causes the existing path to be deleted,
|
||||
but no new path is created because drbd-proxy-ctl cannot be executed.
|
||||
* "drbdadm adjust <res>" - segfault.
|
||||
---
|
||||
user/v9/drbdadm_adjust.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/user/v9/drbdadm_adjust.c b/user/v9/drbdadm_adjust.c
|
||||
index 83df624c4e46..f3d321b9ec65 100644
|
||||
--- a/user/v9/drbdadm_adjust.c
|
||||
+++ b/user/v9/drbdadm_adjust.c
|
||||
@@ -390,7 +390,7 @@ static int proxy_reconf(const struct cfg_ctx *ctx, struct connection *running_co
|
||||
goto redo_whole_conn;
|
||||
|
||||
running_path = STAILQ_FIRST(&running_conn->paths); /* multiple paths via proxy, later! */
|
||||
- if (!running_path->my_proxy)
|
||||
+ if (!running_path || !running_path->my_proxy)
|
||||
goto redo_whole_conn;
|
||||
|
||||
if (running_path->proxy_conn_is_down)
|
||||
--
|
||||
2.35.3
|
||||
|
@ -0,0 +1,59 @@
|
||||
From b37e33525eeff89d03cd6b98862d15f90aee7e15 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Altnoeder <robert.altnoeder@linbit.com>
|
||||
Date: Fri, 26 Jul 2024 08:35:09 +0200
|
||||
Subject: [PATCH 02/12] DRBDmon: Disabled DRBD commands warning only for actual
|
||||
DRBD commands
|
||||
|
||||
---
|
||||
user/drbdmon/terminal/DrbdCommandsImpl.cpp | 26 ++++++++++++----------
|
||||
1 file changed, 14 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/user/drbdmon/terminal/DrbdCommandsImpl.cpp b/user/drbdmon/terminal/DrbdCommandsImpl.cpp
|
||||
index 8b75a2aae8a7..006234f70df6 100644
|
||||
--- a/user/drbdmon/terminal/DrbdCommandsImpl.cpp
|
||||
+++ b/user/drbdmon/terminal/DrbdCommandsImpl.cpp
|
||||
@@ -83,10 +83,10 @@ DrbdCommandsImpl::~DrbdCommandsImpl() noexcept
|
||||
bool DrbdCommandsImpl::execute_command(const std::string& command, StringTokenizer& tokenizer)
|
||||
{
|
||||
bool processed = false;
|
||||
- if (dsp_comp_hub.enable_drbd_actions)
|
||||
+ Entry* const cmd_entry = cmd_map->get(&command);
|
||||
+ if (cmd_entry != nullptr)
|
||||
{
|
||||
- Entry* const cmd_entry = cmd_map->get(&command);
|
||||
- if (cmd_entry != nullptr)
|
||||
+ if (dsp_comp_hub.enable_drbd_actions)
|
||||
{
|
||||
cmd_func_type cmd_func = cmd_entry->cmd_func;
|
||||
try
|
||||
@@ -109,16 +109,18 @@ bool DrbdCommandsImpl::execute_command(const std::string& command, StringTokeniz
|
||||
);
|
||||
}
|
||||
}
|
||||
+ else
|
||||
+ {
|
||||
+ const uint64_t msg_id = dsp_comp_hub.log->add_entry(
|
||||
+ MessageLog::log_level::WARN,
|
||||
+ "DRBD commands are currently disabled"
|
||||
+ );
|
||||
+ dsp_comp_hub.dsp_shared->message_id = msg_id;
|
||||
+ dsp_comp_hub.dsp_selector->switch_to_display(DisplayId::display_page::MSG_VIEWER);
|
||||
+ }
|
||||
+
|
||||
}
|
||||
- else
|
||||
- {
|
||||
- const uint64_t msg_id = dsp_comp_hub.log->add_entry(
|
||||
- MessageLog::log_level::WARN,
|
||||
- "DRBD commands are currently disabled"
|
||||
- );
|
||||
- dsp_comp_hub.dsp_shared->message_id = msg_id;
|
||||
- dsp_comp_hub.dsp_selector->switch_to_display(DisplayId::display_page::MSG_VIEWER);
|
||||
- }
|
||||
+
|
||||
return processed;
|
||||
}
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
45
0002-user-drbrdmon-add-missing-stdint.h-includes.patch
Normal file
45
0002-user-drbrdmon-add-missing-stdint.h-includes.patch
Normal file
@ -0,0 +1,45 @@
|
||||
From feebd378195cf18b06f9fa209586af0c6d32ddb8 Mon Sep 17 00:00:00 2001
|
||||
From: Sam James <sam@gentoo.org>
|
||||
Date: Thu, 27 Jul 2023 06:30:25 +0100
|
||||
Subject: [PATCH] user: drbrdmon: add missing <stdint.h> includes
|
||||
|
||||
GCC 13 drops some transitive includes within libstdc++.
|
||||
|
||||
Explicitly include <stdint.h> for uint32_t etc.
|
||||
|
||||
Note that using <stdint.h> deliberately because we're not using std::-prefixed
|
||||
types.
|
||||
|
||||
Signed-off-by: Sam James <sam@gentoo.org>
|
||||
---
|
||||
user/drbdmon/DrbdMonConsts.h | 1 +
|
||||
user/drbdmon/terminal/DisplayId.h | 1 +
|
||||
2 files changed, 2 insertions(+)
|
||||
|
||||
diff --git a/user/drbdmon/DrbdMonConsts.h b/user/drbdmon/DrbdMonConsts.h
|
||||
index 73d25f28fbeb..f962d0d38a6d 100644
|
||||
--- a/user/drbdmon/DrbdMonConsts.h
|
||||
+++ b/user/drbdmon/DrbdMonConsts.h
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef DRBDMONCONSTS_H
|
||||
#define DRBDMONCONSTS_H
|
||||
|
||||
+#include <stdint.h>
|
||||
#include <string>
|
||||
|
||||
class DrbdMonConsts
|
||||
diff --git a/user/drbdmon/terminal/DisplayId.h b/user/drbdmon/terminal/DisplayId.h
|
||||
index 40d3de488fd9..fa4b744438d4 100644
|
||||
--- a/user/drbdmon/terminal/DisplayId.h
|
||||
+++ b/user/drbdmon/terminal/DisplayId.h
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef DISPLAYID_H
|
||||
#define DISPLAYID_H
|
||||
|
||||
+#include <stdint.h>
|
||||
#include <string>
|
||||
|
||||
class DisplayId
|
||||
--
|
||||
2.35.3
|
||||
|
169
0003-DRBDmon-Integrate-global-local-command-delegation.patch
Normal file
169
0003-DRBDmon-Integrate-global-local-command-delegation.patch
Normal file
@ -0,0 +1,169 @@
|
||||
From 1053b3344c85646bbfbc59233a3d502183c3ea65 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Altnoeder <robert.altnoeder@linbit.com>
|
||||
Date: Fri, 26 Jul 2024 08:37:09 +0200
|
||||
Subject: [PATCH 03/12] DRBDmon: Integrate global/local command delegation
|
||||
|
||||
---
|
||||
user/drbdmon/terminal/DisplayCommon.h | 12 +++++-----
|
||||
user/drbdmon/terminal/DisplayCommonImpl.cpp | 20 ++++++++++-------
|
||||
user/drbdmon/terminal/DisplayCommonImpl.h | 8 +++++--
|
||||
user/drbdmon/terminal/MDspBase.cpp | 25 +++------------------
|
||||
4 files changed, 28 insertions(+), 37 deletions(-)
|
||||
|
||||
diff --git a/user/drbdmon/terminal/DisplayCommon.h b/user/drbdmon/terminal/DisplayCommon.h
|
||||
index 9160c3ddb215..b1b94e43e51f 100644
|
||||
--- a/user/drbdmon/terminal/DisplayCommon.h
|
||||
+++ b/user/drbdmon/terminal/DisplayCommon.h
|
||||
@@ -2,6 +2,7 @@
|
||||
#define DISPLAYCOMMON_H
|
||||
|
||||
#include <default_types.h>
|
||||
+#include <terminal/ModularDisplay.h>
|
||||
|
||||
class DisplayCommon
|
||||
{
|
||||
@@ -16,9 +17,7 @@ class DisplayCommon
|
||||
enum command_state_type : uint8_t
|
||||
{
|
||||
INPUT = 0,
|
||||
- CANCEL = 1,
|
||||
- CMD_LOCAL = 2,
|
||||
- CMD_GLOBAL = 3
|
||||
+ CANCEL = 1
|
||||
};
|
||||
|
||||
virtual ~DisplayCommon() noexcept
|
||||
@@ -47,9 +46,12 @@ class DisplayCommon
|
||||
virtual void display_problem_mode_label(const bool using_problem_mode) const = 0;
|
||||
virtual problem_mode_type get_problem_mode() const noexcept = 0;
|
||||
virtual void toggle_problem_mode() noexcept = 0;
|
||||
- virtual command_state_type command_line_key_pressed(const uint32_t key) const = 0;
|
||||
+ virtual command_state_type command_line_key_pressed(
|
||||
+ const uint32_t key,
|
||||
+ ModularDisplay& display
|
||||
+ ) const = 0;
|
||||
virtual void activate_command_line() const = 0;
|
||||
- virtual bool global_command() const = 0;
|
||||
+ virtual bool execute_command(ModularDisplay& display) const = 0;
|
||||
virtual void application_idle() const = 0;
|
||||
virtual void application_working() const = 0;
|
||||
};
|
||||
diff --git a/user/drbdmon/terminal/DisplayCommonImpl.cpp b/user/drbdmon/terminal/DisplayCommonImpl.cpp
|
||||
index 8427b2fc46a0..f3ceed782e02 100644
|
||||
--- a/user/drbdmon/terminal/DisplayCommonImpl.cpp
|
||||
+++ b/user/drbdmon/terminal/DisplayCommonImpl.cpp
|
||||
@@ -706,7 +706,10 @@ void DisplayCommonImpl::toggle_problem_mode() noexcept
|
||||
}
|
||||
}
|
||||
|
||||
-DisplayCommon::command_state_type DisplayCommonImpl::command_line_key_pressed(const uint32_t key) const
|
||||
+DisplayCommon::command_state_type DisplayCommonImpl::command_line_key_pressed(
|
||||
+ const uint32_t key,
|
||||
+ ModularDisplay& display
|
||||
+) const
|
||||
{
|
||||
DisplayCommon::command_state_type state = DisplayCommon::command_state_type::INPUT;
|
||||
if (key == KeyCodes::FUNC_12)
|
||||
@@ -717,11 +720,8 @@ DisplayCommon::command_state_type DisplayCommonImpl::command_line_key_pressed(co
|
||||
else
|
||||
if (key == KeyCodes::ENTER)
|
||||
{
|
||||
- state = DisplayCommon::command_state_type::CMD_LOCAL;
|
||||
- if (global_command())
|
||||
- {
|
||||
- state = DisplayCommon::command_state_type::CMD_GLOBAL;
|
||||
- }
|
||||
+ const bool processed = execute_command(display);
|
||||
+ state = processed ? DisplayCommon::command_state_type::CANCEL : DisplayCommon::command_state_type::INPUT;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -834,7 +834,7 @@ void DisplayCommonImpl::activate_command_line() const
|
||||
}
|
||||
}
|
||||
|
||||
-bool DisplayCommonImpl::global_command() const
|
||||
+bool DisplayCommonImpl::execute_command(ModularDisplay& display) const
|
||||
{
|
||||
bool processed = false;
|
||||
const std::string& command = dsp_comp_hub.command_line->get_text();
|
||||
@@ -859,7 +859,11 @@ bool DisplayCommonImpl::global_command() const
|
||||
processed = dsp_comp_hub.global_cmd_exec->execute_command(upper_keyword, tokenizer);
|
||||
if (!processed)
|
||||
{
|
||||
- processed = dsp_comp_hub.drbd_cmd_exec->execute_command(upper_keyword, tokenizer);
|
||||
+ processed = display.execute_command(upper_keyword, tokenizer);
|
||||
+ if (!processed)
|
||||
+ {
|
||||
+ processed = dsp_comp_hub.drbd_cmd_exec->execute_command(upper_keyword, tokenizer);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/user/drbdmon/terminal/DisplayCommonImpl.h b/user/drbdmon/terminal/DisplayCommonImpl.h
|
||||
index 1ac7fafa6f96..8e09bfbe1eb7 100644
|
||||
--- a/user/drbdmon/terminal/DisplayCommonImpl.h
|
||||
+++ b/user/drbdmon/terminal/DisplayCommonImpl.h
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <default_types.h>
|
||||
#include <terminal/DisplayCommon.h>
|
||||
+#include <terminal/ModularDisplay.h>
|
||||
#include <terminal/DisplayIo.h>
|
||||
#include <terminal/ComponentsHub.h>
|
||||
#include <string>
|
||||
@@ -35,9 +36,12 @@ class DisplayCommonImpl : public DisplayCommon
|
||||
virtual void display_problem_mode_label(const bool using_problem_mode) const override;
|
||||
virtual problem_mode_type get_problem_mode() const noexcept;
|
||||
virtual void toggle_problem_mode() noexcept;
|
||||
- virtual DisplayCommon::command_state_type command_line_key_pressed(const uint32_t key) const;
|
||||
+ virtual command_state_type command_line_key_pressed(
|
||||
+ const uint32_t key,
|
||||
+ ModularDisplay& display
|
||||
+ ) const override;
|
||||
virtual void activate_command_line() const;
|
||||
- virtual bool global_command() const override;
|
||||
+ virtual bool execute_command(ModularDisplay& display) const override;
|
||||
virtual void application_idle() const override;
|
||||
virtual void application_working() const override;
|
||||
|
||||
diff --git a/user/drbdmon/terminal/MDspBase.cpp b/user/drbdmon/terminal/MDspBase.cpp
|
||||
index 77bc86af6160..f95d3a21ac7f 100644
|
||||
--- a/user/drbdmon/terminal/MDspBase.cpp
|
||||
+++ b/user/drbdmon/terminal/MDspBase.cpp
|
||||
@@ -176,29 +176,10 @@ bool MDspBase::key_pressed(const uint32_t key)
|
||||
else
|
||||
if (base_input_mode == base_input_mode_type::COMMAND)
|
||||
{
|
||||
- const DisplayCommon::command_state_type state = dsp_comp_hub.dsp_common->command_line_key_pressed(key);
|
||||
- bool exit_cmd_mode = false;
|
||||
- if (state == DisplayCommon::command_state_type::CMD_LOCAL)
|
||||
- {
|
||||
- StringTokenizer tokenizer(dsp_comp_hub.command_line->get_text(), DisplayConsts::CMD_TOKEN_DELIMITER);
|
||||
- if (tokenizer.has_next())
|
||||
- {
|
||||
- std::string keyword(tokenizer.next());
|
||||
- if (keyword.length() >= 2)
|
||||
- {
|
||||
- keyword.erase(0, 1);
|
||||
- std::string upper_keyword = string_transformations::uppercase_copy_of(keyword);
|
||||
- exit_cmd_mode = execute_command(upper_keyword, tokenizer);
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
- else
|
||||
+ const DisplayCommon::command_state_type state = dsp_comp_hub.dsp_common->command_line_key_pressed(
|
||||
+ key, *this
|
||||
+ );
|
||||
if (state != DisplayCommon::command_state_type::INPUT)
|
||||
- {
|
||||
- exit_cmd_mode = true;
|
||||
- }
|
||||
-
|
||||
- if (exit_cmd_mode)
|
||||
{
|
||||
base_input_mode = base_input_mode_type::GLOBAL_KEYS;
|
||||
dsp_comp_hub.dsp_io->write_text(dsp_comp_hub.ansi_ctl->ANSI_CURSOR_OFF.c_str());
|
||||
--
|
||||
2.43.0
|
||||
|
1693
0003-Introduce-default_types.h-header.patch
Normal file
1693
0003-Introduce-default_types.h-header.patch
Normal file
File diff suppressed because it is too large
Load Diff
25
0004-DRBDmon-Adjust-events-log-supplier-program-name.patch
Normal file
25
0004-DRBDmon-Adjust-events-log-supplier-program-name.patch
Normal file
@ -0,0 +1,25 @@
|
||||
From 4ecb776ed6b75d326624281b50f0a11adeca2e58 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Altnoeder <robert.altnoeder@linbit.com>
|
||||
Date: Wed, 20 Nov 2024 18:44:19 +0100
|
||||
Subject: [PATCH 04/12] DRBDmon: Adjust events log supplier program name
|
||||
|
||||
---
|
||||
user/drbdmon/subprocess/EventsSourceSpawner.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/user/drbdmon/subprocess/EventsSourceSpawner.cpp b/user/drbdmon/subprocess/EventsSourceSpawner.cpp
|
||||
index 20fa13bec0d8..1b50aa23b6d6 100644
|
||||
--- a/user/drbdmon/subprocess/EventsSourceSpawner.cpp
|
||||
+++ b/user/drbdmon/subprocess/EventsSourceSpawner.cpp
|
||||
@@ -21,7 +21,7 @@ const char* const EventsSourceSpawner::EVENTS_PROGRAM_ARGS[] =
|
||||
"all",
|
||||
nullptr
|
||||
};
|
||||
-const char* const EventsSourceSpawner::SAVED_EVENTS_PROGRAM = "eventsfeeder";
|
||||
+const char* const EventsSourceSpawner::SAVED_EVENTS_PROGRAM = "drbd-events-log-supplier";
|
||||
|
||||
EventsSourceSpawner::EventsSourceSpawner(MessageLog& logRef):
|
||||
log(logRef)
|
||||
--
|
||||
2.43.0
|
||||
|
166
0005-DRBDmon-Add-drbd-events-log-supplier.patch
Normal file
166
0005-DRBDmon-Add-drbd-events-log-supplier.patch
Normal file
@ -0,0 +1,166 @@
|
||||
From 60c3ed545e1c36de25545656f5c6c586e548b852 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Altnoeder <robert.altnoeder@linbit.com>
|
||||
Date: Wed, 20 Nov 2024 18:44:41 +0100
|
||||
Subject: [PATCH 05/12] DRBDmon: Add drbd-events-log-supplier
|
||||
|
||||
---
|
||||
user/drbdmon/drbd-events-log-supplier.cpp | 147 ++++++++++++++++++++++
|
||||
1 file changed, 147 insertions(+)
|
||||
create mode 100644 user/drbdmon/drbd-events-log-supplier.cpp
|
||||
|
||||
diff --git a/user/drbdmon/drbd-events-log-supplier.cpp b/user/drbdmon/drbd-events-log-supplier.cpp
|
||||
new file mode 100644
|
||||
index 000000000000..9fe48f0ccd71
|
||||
--- /dev/null
|
||||
+++ b/user/drbdmon/drbd-events-log-supplier.cpp
|
||||
@@ -0,0 +1,147 @@
|
||||
+#include <cstddef>
|
||||
+#include <iostream>
|
||||
+#include <fstream>
|
||||
+#include <string>
|
||||
+
|
||||
+extern "C"
|
||||
+{
|
||||
+ #include <unistd.h>
|
||||
+}
|
||||
+
|
||||
+constexpr int ERR_OUT_OF_MEMORY = 2;
|
||||
+constexpr int ERR_IO = 3;
|
||||
+
|
||||
+const std::string INIT_STATE_SEPA("exists -");
|
||||
+const size_t INIT_STATE_SEPA_LENGTH = INIT_STATE_SEPA.length();
|
||||
+
|
||||
+int process_events(const std::string& path);
|
||||
+bool is_init_state_sepa(const std::string& event_line);
|
||||
+
|
||||
+/**
|
||||
+ * DRBD events log file supplier for DRBDmon
|
||||
+ */
|
||||
+int main(int argc, char* argv[])
|
||||
+{
|
||||
+ int exit_code = EXIT_FAILURE;
|
||||
+
|
||||
+ try
|
||||
+ {
|
||||
+ if (argc == 2)
|
||||
+ {
|
||||
+ std::string path(argv[1]);
|
||||
+ exit_code = process_events(path);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ std::cerr << "DRBD Events Log File Supplier | Arguments:\n" <<
|
||||
+ " path .......... Path to a file containing DBRD event lines\n";
|
||||
+ }
|
||||
+ }
|
||||
+ catch (std::bad_alloc&)
|
||||
+ {
|
||||
+ std::cerr << "Out of memory" << std::endl;
|
||||
+ exit_code = ERR_OUT_OF_MEMORY;
|
||||
+ }
|
||||
+
|
||||
+ std::cout << std::flush;
|
||||
+ std::cerr << std::flush;
|
||||
+
|
||||
+ return exit_code;
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * Emits event lines from an events log file and appends the initial state separator
|
||||
+ * if it is absent from the file. The output is stdout, which DRBDmon pipes to itself.
|
||||
+ *
|
||||
+ * DRBDmon recovers its events source process by respawning it if it exits for any reason.
|
||||
+ * Therefore, this method does not return if successful, instead, it will
|
||||
+ * suspend indefinitely. DRBDmon will terminate this process when the user exits DRBDmon.
|
||||
+ */
|
||||
+int process_events(const std::string& path)
|
||||
+{
|
||||
+ int rc = ERR_IO;
|
||||
+
|
||||
+ // Internal pipe used for suspending execution
|
||||
+ int pipe_fd[2];
|
||||
+ int pipe_rc = pipe(pipe_fd);
|
||||
+ if (pipe_rc == 0)
|
||||
+ {
|
||||
+ std::ifstream in_file(path);
|
||||
+ if (in_file.good())
|
||||
+ {
|
||||
+ bool have_init_state_sepa = false;
|
||||
+
|
||||
+ // Emit events from the file to DRBDmon
|
||||
+ std::string event_line;
|
||||
+ while (in_file.good())
|
||||
+ {
|
||||
+ std::getline(in_file, event_line);
|
||||
+ if (event_line.length() > 0)
|
||||
+ {
|
||||
+ std::cout << event_line << '\n';
|
||||
+ }
|
||||
+ if (is_init_state_sepa(event_line))
|
||||
+ {
|
||||
+ have_init_state_sepa = true;
|
||||
+ }
|
||||
+
|
||||
+ event_line.clear();
|
||||
+ }
|
||||
+
|
||||
+ if (in_file.eof())
|
||||
+ {
|
||||
+ // If there was no initial state separator in the events log file,
|
||||
+ // emit one to DRBDmon
|
||||
+ if (!have_init_state_sepa)
|
||||
+ {
|
||||
+ std::cout << INIT_STATE_SEPA << '\n';
|
||||
+ }
|
||||
+ std::cout << std::flush;
|
||||
+
|
||||
+ rc = EXIT_SUCCESS;
|
||||
+
|
||||
+ // Suspend execution indefinitely. DRBDmon will terminate this process when it exits.
|
||||
+ char in_char = 0;
|
||||
+ const ssize_t read_count = read(pipe_fd[0], &in_char, 1);
|
||||
+ // Nothing to do with that result...
|
||||
+ static_cast<void> (read_count);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ // I/O failed before the entire file was processed, I/O error.
|
||||
+ std::cerr << "I/O error while reading DRBD events file \"" << path << "\"\n";
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ // Cannot open/read the file. Typically a non-existent path/file or permissions problem.
|
||||
+ std::cerr << "I/O error, cannot read DRBD events file \"" << path << "\"\n";
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ // Cannot create the pipe used for suspending.
|
||||
+ // Typically a resource exhaustion problem, e.g. the OS being out of memory.
|
||||
+ std::cerr << "I/O error, pipe creation failed\n";
|
||||
+ }
|
||||
+
|
||||
+ return rc;
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * Checks whether an events line is the initial state separator
|
||||
+ */
|
||||
+bool is_init_state_sepa(const std::string& event_line)
|
||||
+{
|
||||
+ bool result = false;
|
||||
+ if (event_line.length() >= INIT_STATE_SEPA_LENGTH)
|
||||
+ {
|
||||
+ size_t idx = 0;
|
||||
+ while (idx < INIT_STATE_SEPA_LENGTH && event_line[idx] == INIT_STATE_SEPA[idx])
|
||||
+ {
|
||||
+ ++idx;
|
||||
+ }
|
||||
+ result = idx == INIT_STATE_SEPA_LENGTH;
|
||||
+ }
|
||||
+ return result;
|
||||
+}
|
||||
--
|
||||
2.43.0
|
||||
|
76
0006-DRBDmon-Adjust-Makefile.patch
Normal file
76
0006-DRBDmon-Adjust-Makefile.patch
Normal file
@ -0,0 +1,76 @@
|
||||
From 5611462e6e157e23e9571bfd364cb22ec17b91b6 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Altnoeder <robert.altnoeder@linbit.com>
|
||||
Date: Wed, 20 Nov 2024 18:45:11 +0100
|
||||
Subject: [PATCH 06/12] DRBDmon: Adjust Makefile
|
||||
|
||||
---
|
||||
drbd.spec.in | 1 +
|
||||
user/drbdmon/Makefile.in | 10 ++++++++--
|
||||
2 files changed, 9 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drbd.spec.in b/drbd.spec.in
|
||||
index 0205776f2618..9559e2950e13 100644
|
||||
--- a/drbd.spec.in
|
||||
+++ b/drbd.spec.in
|
||||
@@ -155,6 +155,7 @@ This packages includes the DRBD administration tools.
|
||||
%endif
|
||||
%if %{with drbdmon}
|
||||
%{_sbindir}/drbdmon
|
||||
+%{_sbindir}/drbd-events-log-supplier
|
||||
%endif
|
||||
%if "%{initscripttype}" == "sysv"
|
||||
%{_initddir}/drbd
|
||||
diff --git a/user/drbdmon/Makefile.in b/user/drbdmon/Makefile.in
|
||||
index 36673b19c857..9c5427e9b22a 100644
|
||||
--- a/user/drbdmon/Makefile.in
|
||||
+++ b/user/drbdmon/Makefile.in
|
||||
@@ -16,7 +16,7 @@ else
|
||||
DESTDIR ?= /
|
||||
endif
|
||||
|
||||
-binaries := drbdmon
|
||||
+binaries := drbdmon drbd-events-log-supplier
|
||||
|
||||
ifeq ($(WITH_DRBDMON),yes)
|
||||
all: $(binaries)
|
||||
@@ -28,6 +28,7 @@ PHONY := all
|
||||
|
||||
dsaext-obj := cppdsaext/src/dsaext.o
|
||||
integerparse-obj := cppdsaext/src/integerparse.o
|
||||
+supplier-obj := drbd-events-log-supplier.o
|
||||
|
||||
l-obj := DrbdMon.o DrbdMonConsts.o MessageLog.o IntervalTimer.o SubProcessNotification.o
|
||||
l-obj += MessageLogNotification.o
|
||||
@@ -77,6 +78,9 @@ $(integerparse-obj): $(basename $(integerparse-obj)).cpp $(basename $(integerpar
|
||||
drbdmon: $(ls-obj)
|
||||
$(CXX) -o $@ $(CPPFLAGS) $(CXXFLAGS) $^ $(LIBS)
|
||||
|
||||
+drbd-events-log-supplier: $(supplier-obj)
|
||||
+ $(CXX) -o $@ $(CPPFLAGS) $(CXXFLAGS) $^
|
||||
+
|
||||
# do not try to rebuild Makefile itself
|
||||
Makefile: ;
|
||||
|
||||
@@ -89,16 +93,18 @@ Makefile: ;
|
||||
install:
|
||||
ifeq ($(WITH_DRBDMON),yes)
|
||||
install -m 755 drbdmon $(DESTDIR)$(sbindir)
|
||||
+ install -m 755 drbd-events-log-supplier $(DESTDIR)$(sbindir)
|
||||
endif
|
||||
|
||||
uninstall:
|
||||
ifeq ($(WITH_DRBDMON),yes)
|
||||
rm -f $(DESTDIR)$(sbindir)/drbdmon
|
||||
+ rm -r $(DESTDIR)$(sbindir)/drbd-events-log-supplier
|
||||
endif
|
||||
|
||||
PHONY += clean distclean
|
||||
clean:
|
||||
- rm -f $(local-obj) $(dsaext-obj) $(integerparse-obj) $(binaries)
|
||||
+ rm -f $(local-obj) $(dsaext-obj) $(integerparse-obj) $(supplier-obj) $(binaries)
|
||||
distclean: clean
|
||||
rm -f $(local-dep)
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
24
0007-DRBDmon-Version-V1R4M1.patch
Normal file
24
0007-DRBDmon-Version-V1R4M1.patch
Normal file
@ -0,0 +1,24 @@
|
||||
From 17c3bc04145900b0039a686b4e2cc28f9d5f3859 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Altnoeder <robert.altnoeder@linbit.com>
|
||||
Date: Mon, 4 Nov 2024 19:13:46 +0100
|
||||
Subject: [PATCH 07/12] DRBDmon: Version V1R4M1
|
||||
|
||||
---
|
||||
user/drbdmon/DrbdMonConsts.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/user/drbdmon/DrbdMonConsts.cpp b/user/drbdmon/DrbdMonConsts.cpp
|
||||
index 6b130db93156..5135d636bd2a 100644
|
||||
--- a/user/drbdmon/DrbdMonConsts.cpp
|
||||
+++ b/user/drbdmon/DrbdMonConsts.cpp
|
||||
@@ -7,6 +7,6 @@ extern "C"
|
||||
}
|
||||
|
||||
const std::string DrbdMonConsts::PROGRAM_NAME = "DRBDmon";
|
||||
-const std::string DrbdMonConsts::PROJECT_VERSION = "V1R4M0";
|
||||
+const std::string DrbdMonConsts::PROJECT_VERSION = "V1R4M1";
|
||||
const std::string DrbdMonConsts::UTILS_VERSION = PACKAGE_VERSION;
|
||||
const std::string DrbdMonConsts::BUILD_HASH = GITHASH;
|
||||
--
|
||||
2.43.0
|
||||
|
@ -0,0 +1,95 @@
|
||||
From 9dab78b5822d59a13e767ef20fdffab46f79cb25 Mon Sep 17 00:00:00 2001
|
||||
From: Joel Colledge <joel.colledge@linbit.com>
|
||||
Date: Thu, 21 Nov 2024 09:55:26 +0100
|
||||
Subject: [PATCH 08/12] drbdadm: add proxy options to 'add connection' command
|
||||
|
||||
Some options such as rcvbuf-size must be set before attempting to
|
||||
connect. Proxy v3 used ugly hacks to allow time for the options to
|
||||
arrive before connecting. Proxy v4 does not use this approach. Instead
|
||||
it requires the options to be set on the command line for 'add
|
||||
connection'.
|
||||
|
||||
The additional options are ignored by Proxy v3 with a "trailing garbage"
|
||||
warning.
|
||||
|
||||
We continue to set the properties using 'set' commands as well to retain
|
||||
compatibility with Proxy v3. Proxy v4 ignores 'set' commands which do
|
||||
not change the value of the option.
|
||||
|
||||
So this is compatible with Proxy v3 and v4.
|
||||
---
|
||||
user/v9/drbdadm_main.c | 38 ++++++++++++++++++++++++++++++++++++--
|
||||
1 file changed, 36 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/user/v9/drbdadm_main.c b/user/v9/drbdadm_main.c
|
||||
index 74cf60365a6d..a983a9463fb8 100644
|
||||
--- a/user/v9/drbdadm_main.c
|
||||
+++ b/user/v9/drbdadm_main.c
|
||||
@@ -2043,19 +2043,33 @@ char *_proxy_connection_name(char *conn_name, const struct d_resource *res, cons
|
||||
return conn_name;
|
||||
}
|
||||
|
||||
+#define ADD_CONNECTION_MAX_LEN 4096
|
||||
+
|
||||
static int do_proxy_conn_up(const struct cfg_ctx *ctx)
|
||||
{
|
||||
const char *argv[4] = { drbd_proxy_ctl, "-c", NULL, NULL };
|
||||
struct connection *conn = ctx->conn;
|
||||
struct path *path = STAILQ_FIRST(&conn->paths); /* multiple paths via proxy, later! */
|
||||
char *conn_name;
|
||||
+ char *buffer;
|
||||
+ char *buffer_pos;
|
||||
+ int buffer_remaining;
|
||||
+ int n;
|
||||
+ struct d_option *opt;
|
||||
+ int rv = -1;
|
||||
|
||||
if (!path->my_proxy || !path->peer_proxy)
|
||||
return 0;
|
||||
|
||||
conn_name = proxy_connection_name(ctx->res, conn);
|
||||
|
||||
- argv[2] = ssprintf(
|
||||
+ buffer_remaining = ADD_CONNECTION_MAX_LEN;
|
||||
+ buffer = checked_malloc(buffer_remaining);
|
||||
+ buffer_pos = buffer;
|
||||
+
|
||||
+ n = snprintf(
|
||||
+ buffer_pos,
|
||||
+ buffer_remaining,
|
||||
"add connection %s %s:%s %s:%s %s:%s %s:%s",
|
||||
conn_name,
|
||||
path->my_proxy->inside.addr,
|
||||
@@ -2066,8 +2080,28 @@ static int do_proxy_conn_up(const struct cfg_ctx *ctx)
|
||||
path->my_proxy->outside.port,
|
||||
path->my_address->addr,
|
||||
path->my_address->port);
|
||||
+ if (n < 0 || n >= buffer_remaining)
|
||||
+ goto out;
|
||||
+ buffer_pos += n;
|
||||
+ buffer_remaining -= n;
|
||||
|
||||
- return m_system_ex(argv, SLEEPS_SHORT, ctx->res->name);
|
||||
+ STAILQ_FOREACH(opt, &path->my_proxy->options, link) {
|
||||
+ n = snprintf(
|
||||
+ buffer_pos,
|
||||
+ buffer_remaining,
|
||||
+ " --%s=%s",
|
||||
+ opt->name, opt->value);
|
||||
+ if (n < 0 || n >= buffer_remaining)
|
||||
+ goto out;
|
||||
+ buffer_pos += n;
|
||||
+ buffer_remaining -= n;
|
||||
+ }
|
||||
+
|
||||
+ argv[2] = buffer;
|
||||
+ rv = m_system_ex(argv, SLEEPS_SHORT, ctx->res->name);
|
||||
+out:
|
||||
+ free(buffer);
|
||||
+ return rv;
|
||||
}
|
||||
|
||||
static int do_proxy_conn_plugins(const struct cfg_ctx *ctx)
|
||||
--
|
||||
2.43.0
|
||||
|
309
0009-Do-not-hardcode-paths-in-services-and-scripts.patch
Normal file
309
0009-Do-not-hardcode-paths-in-services-and-scripts.patch
Normal file
@ -0,0 +1,309 @@
|
||||
by heming.zhao@suse.com
|
||||
remove the patch of scripts/.gitignore for following complain msg:
|
||||
```
|
||||
+ /usr/lib/rpm/rpmuncompress /usr/src/packages/SOURCES/0009-Do-not-hardcode-paths-in-services-and-scripts.patch
|
||||
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
|
||||
The text leading up to this was:
|
||||
--------------------------
|
||||
|diff --git a/scripts/.gitignore b/scripts/.gitignore
|
||||
|index a307904047f8..ba121127c341 100644
|
||||
|--- a/scripts/.gitignore
|
||||
|+++ b/scripts/.gitignore
|
||||
--------------------------
|
||||
No file to patch. Skipping patch.
|
||||
1 out of 1 hunk ignored
|
||||
```
|
||||
|
||||
From 080e93bd9bcf546cd3a9870ae1add2469a2a4e24 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Moritz=20Wanzenb=C3=B6ck?= <moritz.wanzenboeck@linbit.com>
|
||||
Date: Fri, 20 Sep 2024 10:30:24 +0200
|
||||
Subject: [PATCH 09/12] Do not hardcode paths in services and scripts
|
||||
|
||||
This fixes issues when drbd-utils get installed to non-standard locations.
|
||||
|
||||
Since the autoconf generated Makefile should still allow override on install,
|
||||
we have to use a new target to do our own expansion. The implementation is
|
||||
lifted from the autconf manual:
|
||||
|
||||
info autoconf "Installation Directory Variables"
|
||||
|
||||
# Conflicts:
|
||||
# scripts/.gitignore
|
||||
# scripts/Makefile.in
|
||||
---
|
||||
configure.ac | 2 +-
|
||||
scripts/.gitignore | 8 +++++++
|
||||
scripts/Makefile.in | 23 +++++++++++++++----
|
||||
...ce => drbd-demote-or-escalate@.service.in} | 2 +-
|
||||
...vice => drbd-graceful-shutdown.service.in} | 2 +-
|
||||
scripts/drbd-promote@.service.in | 4 ++--
|
||||
...-reconfigure-suspend-or-error@.service.in} | 4 ++--
|
||||
...ervice-shim.sh => drbd-service-shim.sh.in} | 18 +++++++--------
|
||||
...rvice => drbd-wait-promotable@.service.in} | 2 +-
|
||||
scripts/{drbd.service => drbd.service.in} | 6 ++---
|
||||
scripts/{drbd@.service => drbd@.service.in} | 6 ++---
|
||||
.../{ocf.ra@.service => ocf.ra@.service.in} | 4 ++--
|
||||
12 files changed, 51 insertions(+), 30 deletions(-)
|
||||
rename scripts/{drbd-demote-or-escalate@.service => drbd-demote-or-escalate@.service.in} (92%)
|
||||
rename scripts/{drbd-graceful-shutdown.service => drbd-graceful-shutdown.service.in} (88%)
|
||||
rename scripts/{drbd-reconfigure-suspend-or-error@.service => drbd-reconfigure-suspend-or-error@.service.in} (71%)
|
||||
rename scripts/{drbd-service-shim.sh => drbd-service-shim.sh.in} (81%)
|
||||
rename scripts/{drbd-wait-promotable@.service => drbd-wait-promotable@.service.in} (84%)
|
||||
rename scripts/{drbd.service => drbd.service.in} (80%)
|
||||
rename scripts/{drbd@.service => drbd@.service.in} (87%)
|
||||
rename scripts/{ocf.ra@.service => ocf.ra@.service.in} (85%)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index cd166bbafbc0..630163cee103 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -525,7 +525,7 @@ fi
|
||||
|
||||
dnl The configuration files we create (from their .in template)
|
||||
if test -z $SPECMODE; then
|
||||
- AC_CONFIG_FILES(Makefile user/shared/Makefile user/v9/Makefile user/v84/Makefile scripts/Makefile scripts/drbd.rules user/windrbd/Makefile user/drbdmon/Makefile documentation/common/Makefile_v84_com documentation/common/Makefile_v9_com)
|
||||
+ AC_CONFIG_FILES(Makefile user/shared/Makefile user/v9/Makefile user/v84/Makefile scripts/Makefile user/windrbd/Makefile user/drbdmon/Makefile documentation/common/Makefile_v84_com documentation/common/Makefile_v9_com)
|
||||
AC_CONFIG_HEADERS(user/shared/config.h)
|
||||
else
|
||||
AC_CONFIG_FILES(drbd.spec)
|
||||
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
|
||||
index 7652ee872500..001d08da54e4 100644
|
||||
--- a/scripts/Makefile.in
|
||||
+++ b/scripts/Makefile.in
|
||||
@@ -67,9 +67,20 @@ SYSTEMD_TEMPLATES += drbd-wait-promotable@.service
|
||||
SYSTEMD_UNITS = drbd.service
|
||||
SYSTEMD_UNITS += drbd-graceful-shutdown.service
|
||||
|
||||
-SERVICE_TEMPLATES = drbd-promote@.service
|
||||
+UDEV_TEMPLATES = drbd.rules
|
||||
|
||||
-TEMPLATES := $(SERVICE_TEMPLATES)
|
||||
+SERVICE_TEMPLATES = drbd.service
|
||||
+SERVICE_TEMPLATES += drbd@.service
|
||||
+SERVICE_TEMPLATES += drbd-demote-or-escalate@.service
|
||||
+SERVICE_TEMPLATES += drbd-graceful-shutdown.service
|
||||
+SERVICE_TEMPLATES += drbd-promote@.service
|
||||
+SERVICE_TEMPLATES += drbd-reconfigure-suspend-or-error@.service
|
||||
+SERVICE_TEMPLATES += drbd-wait-promotable@.service
|
||||
+SERVICE_TEMPLATES += ocf.ra@.service
|
||||
+
|
||||
+SCRIPT_TEMPLATES = drbd-service-shim.sh
|
||||
+
|
||||
+TEMPLATES := $(SCRIPT_TEMPLATES) $(SERVICE_TEMPLATES) $(UDEV_TEMPLATES)
|
||||
|
||||
# variables meant to be overridden from the make command line
|
||||
ifeq ($(WITH_WINDRBD),yes)
|
||||
@@ -82,7 +93,7 @@ all: $(TEMPLATES)
|
||||
|
||||
install: install-utils install-udev install-xen install-heartbeat install-pacemaker install-rgmanager install-bashcompletion
|
||||
|
||||
-install-utils: $(SERVICE_TEMPLATES)
|
||||
+install-utils: $(SERVICE_TEMPLATES) $(SCRIPT_TEMPLATES)
|
||||
install -d $(DESTDIR)$(LIBDIR)
|
||||
# "sysv" or "both"
|
||||
ifeq ($(subst both,sysv,$(initscripttype)),sysv)
|
||||
@@ -172,7 +183,7 @@ ifeq ($(WITH_XEN),yes)
|
||||
install -m 755 block-drbd $(DESTDIR)$(sysconfdir)/xen/scripts
|
||||
endif
|
||||
|
||||
-install-udev:
|
||||
+install-udev: $(UDEV_TEMPLATES)
|
||||
ifeq ($(WITH_UDEV),yes)
|
||||
mkdir -p $(DESTDIR)$(udevrulesdir)
|
||||
install -m 644 drbd.rules $(DESTDIR)$(udevrulesdir)/65-drbd.rules$(UDEV_RULE_SUFFIX)
|
||||
@@ -214,7 +225,9 @@ Makefile.in: ;
|
||||
Makefile: Makefile.in ../config.status
|
||||
cd .. && ./config.status scripts/Makefile
|
||||
|
||||
-edit = sed -e ''
|
||||
+edit = sed -e '' \
|
||||
+ -e 's|@sbindir[@]|$(sbindir)|g' \
|
||||
+ -e 's|@libdir[@]|$(LIBDIR)|g' \
|
||||
|
||||
ifeq ($(SYSTEMD_EXEC_CONDITION),no)
|
||||
edit += -e 's|^ExecCondition=|ExecStart=|'
|
||||
diff --git a/scripts/drbd-demote-or-escalate@.service b/scripts/drbd-demote-or-escalate@.service.in
|
||||
similarity index 92%
|
||||
rename from scripts/drbd-demote-or-escalate@.service
|
||||
rename to scripts/drbd-demote-or-escalate@.service.in
|
||||
index 2093223847b4..f5e123199323 100644
|
||||
--- a/scripts/drbd-demote-or-escalate@.service
|
||||
+++ b/scripts/drbd-demote-or-escalate@.service.in
|
||||
@@ -28,5 +28,5 @@ TimeoutSec=60
|
||||
# "Type=forking" would be an option to have it retry a number of times,
|
||||
# and then only escalate to FailureAction if that did not help.
|
||||
Type=oneshot
|
||||
-ExecStart=/lib/drbd/scripts/drbd-service-shim.sh secondary-or-escalate %I
|
||||
+ExecStart=@libdir@/scripts/drbd-service-shim.sh secondary-or-escalate %I
|
||||
ExecStopPost=-/bin/journalctl --sync
|
||||
diff --git a/scripts/drbd-graceful-shutdown.service b/scripts/drbd-graceful-shutdown.service.in
|
||||
similarity index 88%
|
||||
rename from scripts/drbd-graceful-shutdown.service
|
||||
rename to scripts/drbd-graceful-shutdown.service.in
|
||||
index b6e8a149d051..6118d880d8fb 100644
|
||||
--- a/scripts/drbd-graceful-shutdown.service
|
||||
+++ b/scripts/drbd-graceful-shutdown.service.in
|
||||
@@ -13,4 +13,4 @@ Before=drbd.service drbd@.service
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
|
||||
-ExecStop=/lib/drbd/scripts/drbd-service-shim.sh down all
|
||||
+ExecStop=@libdir@/scripts/drbd-service-shim.sh down all
|
||||
diff --git a/scripts/drbd-promote@.service.in b/scripts/drbd-promote@.service.in
|
||||
index 71345d9b723d..23e74c282250 100644
|
||||
--- a/scripts/drbd-promote@.service.in
|
||||
+++ b/scripts/drbd-promote@.service.in
|
||||
@@ -24,5 +24,5 @@ RemainAfterExit=yes
|
||||
# (ab)using systemd features
|
||||
# if we cannot configure and promote, that's a condition, not a failure
|
||||
# See the comment above wrt. FailureAction vs OnFailure
|
||||
-ExecCondition=/lib/drbd/scripts/drbd-service-shim.sh primary %I
|
||||
-ExecStop=/lib/drbd/scripts/drbd-service-shim.sh secondary %I
|
||||
+ExecCondition=@libdir@/scripts/drbd-service-shim.sh primary %I
|
||||
+ExecStop=@libdir@/scripts/drbd-service-shim.sh secondary %I
|
||||
diff --git a/scripts/drbd-reconfigure-suspend-or-error@.service b/scripts/drbd-reconfigure-suspend-or-error@.service.in
|
||||
similarity index 71%
|
||||
rename from scripts/drbd-reconfigure-suspend-or-error@.service
|
||||
rename to scripts/drbd-reconfigure-suspend-or-error@.service.in
|
||||
index c0e59e5e72d3..6a0a2584e3a6 100644
|
||||
--- a/scripts/drbd-reconfigure-suspend-or-error@.service
|
||||
+++ b/scripts/drbd-reconfigure-suspend-or-error@.service.in
|
||||
@@ -10,5 +10,5 @@ RefuseManualStop=yes
|
||||
SyslogIdentifier=drbd-%I
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
-ExecStop=-/usr/sbin/drbdsetup resource-options --on-no-quorum io-error --on-no-data io-error %I
|
||||
-ExecStart=-/usr/sbin/drbdsetup resource-options --on-no-quorum suspend-io --on-no-data suspend-io %I
|
||||
+ExecStop=-@sbindir@/drbdsetup resource-options --on-no-quorum io-error --on-no-data io-error %I
|
||||
+ExecStart=-@sbindir@/drbdsetup resource-options --on-no-quorum suspend-io --on-no-data suspend-io %I
|
||||
diff --git a/scripts/drbd-service-shim.sh b/scripts/drbd-service-shim.sh.in
|
||||
similarity index 81%
|
||||
rename from scripts/drbd-service-shim.sh
|
||||
rename to scripts/drbd-service-shim.sh.in
|
||||
index 786387463891..56029bdcebe2 100755
|
||||
--- a/scripts/drbd-service-shim.sh
|
||||
+++ b/scripts/drbd-service-shim.sh.in
|
||||
@@ -14,7 +14,7 @@ secondary_check() {
|
||||
local ex_secondary current_state opts
|
||||
opts="$1"
|
||||
|
||||
- /usr/sbin/drbdsetup secondary $opts "$res"
|
||||
+ @sbindir@/drbdsetup secondary $opts "$res"
|
||||
ex_secondary=$?
|
||||
case $ex_secondary in
|
||||
0)
|
||||
@@ -26,7 +26,7 @@ secondary_check() {
|
||||
# any other special treatment for special exit codes?
|
||||
*)
|
||||
# double check for "resource does not exist"
|
||||
- current_state=$(/usr/sbin/drbdsetup events2 --now "$res")
|
||||
+ current_state=$(@sbindir@/drbdsetup events2 --now "$res")
|
||||
if [[ $current_state = "exists -" ]]; then
|
||||
echo >&2 "<7>not even configured"
|
||||
return 0
|
||||
@@ -40,23 +40,23 @@ secondary_check() {
|
||||
|
||||
case "$cmd" in
|
||||
adjust)
|
||||
- exec /usr/sbin/drbdadm adjust "$res"
|
||||
+ exec @sbindir@/drbdadm adjust "$res"
|
||||
;;
|
||||
down)
|
||||
- exec /usr/sbin/drbdsetup down "$res"
|
||||
+ exec @sbindir@/drbdsetup down "$res"
|
||||
;;
|
||||
primary)
|
||||
- exec /usr/sbin/drbdsetup primary "$res"
|
||||
+ exec @sbindir@/drbdsetup primary "$res"
|
||||
;;
|
||||
secondary)
|
||||
- exec /usr/sbin/drbdsetup secondary "$res"
|
||||
+ exec @sbindir@/drbdsetup secondary "$res"
|
||||
;;
|
||||
secondary-force)
|
||||
- exec /usr/sbin/drbdsetup secondary --force=yes "$res"
|
||||
+ exec @sbindir@/drbdsetup secondary --force=yes "$res"
|
||||
;;
|
||||
secondary-secondary-force)
|
||||
- /usr/sbin/drbdsetup secondary "$res" && exit 0
|
||||
- exec /usr/sbin/drbdsetup secondary --force=yes "$res"
|
||||
+ @sbindir@/drbdsetup secondary "$res" && exit 0
|
||||
+ exec @sbindir@/drbdsetup secondary --force=yes "$res"
|
||||
;;
|
||||
secondary*-or-escalate)
|
||||
# Log something and try to get journald to flush its logs
|
||||
diff --git a/scripts/drbd-wait-promotable@.service b/scripts/drbd-wait-promotable@.service.in
|
||||
similarity index 84%
|
||||
rename from scripts/drbd-wait-promotable@.service
|
||||
rename to scripts/drbd-wait-promotable@.service.in
|
||||
index 81c3789f5a4c..f416274839e9 100644
|
||||
--- a/scripts/drbd-wait-promotable@.service
|
||||
+++ b/scripts/drbd-wait-promotable@.service.in
|
||||
@@ -10,7 +10,7 @@ Type=oneshot
|
||||
|
||||
# on first start, wait for access to "good data"
|
||||
# let systemd handle timeouts
|
||||
-ExecStart=/lib/drbd/scripts/drbd-wait-promotable.sh %I
|
||||
+ExecStart=@libdir@/scripts/drbd-wait-promotable.sh %I
|
||||
RemainAfterExit=yes
|
||||
|
||||
[Install]
|
||||
diff --git a/scripts/drbd.service b/scripts/drbd.service.in
|
||||
similarity index 80%
|
||||
rename from scripts/drbd.service
|
||||
rename to scripts/drbd.service.in
|
||||
index 96c599e75042..8bfeb17cb91d 100644
|
||||
--- a/scripts/drbd.service
|
||||
+++ b/scripts/drbd.service.in
|
||||
@@ -12,11 +12,11 @@ RemainAfterExit=yes
|
||||
# A check for INIT_VERSION already exists, just set it to something.
|
||||
Environment=INIT_VERSION=systemd
|
||||
|
||||
-ExecStart=/lib/drbd/scripts/drbd start
|
||||
-ExecStop=/lib/drbd/scripts/drbd stop
|
||||
+ExecStart=@libdir@/scripts/drbd start
|
||||
+ExecStop=@libdir@/scripts/drbd stop
|
||||
|
||||
# Re-adjust everything on reload
|
||||
-ExecReload=/lib/drbd/scripts/drbd reload
|
||||
+ExecReload=@libdir@/scripts/drbd reload
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
diff --git a/scripts/drbd@.service b/scripts/drbd@.service.in
|
||||
similarity index 87%
|
||||
rename from scripts/drbd@.service
|
||||
rename to scripts/drbd@.service.in
|
||||
index 0fad10be237e..ab1c044cdeb1 100644
|
||||
--- a/scripts/drbd@.service
|
||||
+++ b/scripts/drbd@.service.in
|
||||
@@ -35,8 +35,8 @@ RemainAfterExit=yes
|
||||
|
||||
# depends... do we want this as ExecCondition or as ExecStart
|
||||
# failed start is "failed", failed condition is just "not startable yet"
|
||||
-ExecStart=/lib/drbd/scripts/drbd-service-shim.sh adjust %I
|
||||
-ExecReload=/lib/drbd/scripts/drbd-service-shim.sh adjust %I
|
||||
+ExecStart=@libdir@/scripts/drbd-service-shim.sh adjust %I
|
||||
+ExecReload=@libdir@/scripts/drbd-service-shim.sh adjust %I
|
||||
|
||||
# can only succeed, if you first stop all depending services
|
||||
-ExecStopPost=/lib/drbd/scripts/drbd-service-shim.sh down %I
|
||||
+ExecStopPost=@libdir@/scripts/drbd-service-shim.sh down %I
|
||||
diff --git a/scripts/ocf.ra@.service b/scripts/ocf.ra@.service.in
|
||||
similarity index 85%
|
||||
rename from scripts/ocf.ra@.service
|
||||
rename to scripts/ocf.ra@.service.in
|
||||
index 9c2268a615a7..4779706a8853 100644
|
||||
--- a/scripts/ocf.ra@.service
|
||||
+++ b/scripts/ocf.ra@.service.in
|
||||
@@ -22,5 +22,5 @@ Environment=monitor_inverval=30
|
||||
# Only the first argument is used by the wrapper,
|
||||
# the %n is just to identify which is which in the process list.
|
||||
# All parameterization is done via Environment= in per instance override.conf
|
||||
-ExecStart=/lib/drbd/scripts/ocf.ra.wrapper.sh start-and-monitor %n
|
||||
-ExecStopPost=/lib/drbd/scripts/ocf.ra.wrapper.sh stop %n
|
||||
+ExecStart=@libdir@/scripts/ocf.ra.wrapper.sh start-and-monitor %n
|
||||
+ExecStopPost=@libdir@/scripts/ocf.ra.wrapper.sh stop %n
|
||||
--
|
||||
2.43.0
|
||||
|
@ -0,0 +1,25 @@
|
||||
From ee3ab4a67f15fadff72995e45defcbf1e944c9bd Mon Sep 17 00:00:00 2001
|
||||
From: Ulf 'Tiggi' Tigerstedt <ulf.tigerstedt@csc.fi>
|
||||
Date: Mon, 16 Dec 2024 15:54:37 +0200
|
||||
Subject: [PATCH 10/12] Fix typo in warning, there is no po4a-translage command
|
||||
|
||||
---
|
||||
configure.ac | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 630163cee103..4377f3c24a08 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -332,7 +332,7 @@ else
|
||||
fi
|
||||
|
||||
if test -z $PO4A_TRANSLATE; then
|
||||
- AC_MSG_WARN([Cannot build man pages without po4a-translage. You may safely ignore this warning when building from a tarball.])
|
||||
+ AC_MSG_WARN([Cannot build man pages without po4a-translate. You may safely ignore this warning when building from a tarball.])
|
||||
dnl default to some sane value at least,
|
||||
dnl so the error message about command not found makes sense
|
||||
PO4A_TRANSLATE=po4a-translate
|
||||
--
|
||||
2.43.0
|
||||
|
115
0011-drbd.ocf-explicitly-timeout-crm_master-IPC-early.patch
Normal file
115
0011-drbd.ocf-explicitly-timeout-crm_master-IPC-early.patch
Normal file
@ -0,0 +1,115 @@
|
||||
From 077a313e9fcacf0b12a35e8094bfdba6ac8aa0d4 Mon Sep 17 00:00:00 2001
|
||||
From: Lars Ellenberg <lars.ellenberg@linbit.com>
|
||||
Date: Fri, 6 Dec 2024 15:31:01 +0100
|
||||
Subject: [PATCH 11/12] drbd.ocf: explicitly timeout crm_master IPC early
|
||||
|
||||
Some environments are notorious for timing out in crm_master
|
||||
one out of ten thousand times. You don't want to know the details.
|
||||
|
||||
That would then cause a timeout on the monitor action,
|
||||
and pacemaker would feel the need to "recover" from "resource failure",
|
||||
spuriously restarting everything that depends on the DRBD resources.
|
||||
|
||||
If we fail to update the "master score" in time,
|
||||
we can still report the operation result.
|
||||
|
||||
The next monitor action will happen,
|
||||
and we get an other attempt at updating the master score.
|
||||
|
||||
If that update was relevant, worst case it is now delayed.
|
||||
Better than the previous worst case, operation timeout
|
||||
interpreted as resource failure.
|
||||
---
|
||||
scripts/drbd.ocf | 44 +++++++++++++++++++++++++++++++++++++++-----
|
||||
1 file changed, 39 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/scripts/drbd.ocf b/scripts/drbd.ocf
|
||||
index 1d051baa550d..c31858343ba4 100755
|
||||
--- a/scripts/drbd.ocf
|
||||
+++ b/scripts/drbd.ocf
|
||||
@@ -53,6 +53,7 @@
|
||||
# OCF_RESKEY_CRM_meta_master_max
|
||||
# OCF_RESKEY_CRM_meta_master_node_max
|
||||
#
|
||||
+# OCF_RESKEY_CRM_meta_timeout
|
||||
# OCF_RESKEY_CRM_meta_interval
|
||||
#
|
||||
# OCF_RESKEY_CRM_meta_notify
|
||||
@@ -515,22 +516,55 @@ if $USE_DEBUG_LOG ; then
|
||||
fi
|
||||
|
||||
do_cmd_success_log_level=""
|
||||
-do_cmd() {
|
||||
+do_cmd() { __do_cmd_with_timeout "" "$@"; }
|
||||
+do_cmd_CRM_meta_timeout()
|
||||
+{
|
||||
+ local timeout=$(( ($OCF_RESKEY_CRM_meta_timeout - 500 - $SECONDS*1000) / 1000 ))
|
||||
+ # if we are short on time already,
|
||||
+ # try to get away with whatever time is left
|
||||
+ (( timeout > 0 )) || timeout=0
|
||||
+ __do_cmd_with_timeout "$timeout" "$@";
|
||||
+}
|
||||
+__do_cmd_with_timeout() {
|
||||
# Run a command, return its exit code, capture any output, and log
|
||||
# everything if appropriate.
|
||||
+ # use coreutils "timeout", if timeout is != 0.
|
||||
+ local timeout=$1; shift
|
||||
local cmd="$*" cmd_out cmd_err ret=125
|
||||
local success_log_level=${do_cmd_success_log_level:-debug}
|
||||
local failure_log_level=${do_cmd_failure_log_level:-err}
|
||||
ocf_log debug "$DRBD_RESOURCE: Calling $cmd"
|
||||
|
||||
+ if [[ $timeout =~ ^[1-9][0-9]*$ ]]; then
|
||||
+ timeout="-t $timeout"
|
||||
+ else
|
||||
+ timeout=""
|
||||
+ fi
|
||||
+
|
||||
+ local pipe
|
||||
+ local pipe_pid
|
||||
+ local result
|
||||
+
|
||||
# capture stdout, stderr, and exit code
|
||||
- eval "$(exec 3>&1;
|
||||
+ if exec {pipe}< <(exec 3>&1;
|
||||
printf "cmd_err=%q\n" \
|
||||
"$( exec 2>&1 1>&3 3>&-; \
|
||||
out=$( "$@" ); \
|
||||
ex=$?; \
|
||||
printf "cmd_out=%q\nret=%q\n" "$out" "$ex" )"
|
||||
- )"
|
||||
+ )
|
||||
+ then
|
||||
+ pipe_pid=$!
|
||||
+
|
||||
+ read -r -d "" -u $pipe $timeout result
|
||||
+ if (( $? > 128 )) ; then
|
||||
+ kill -KILL $pipe_pid
|
||||
+ # wait $pipe_pid
|
||||
+ fi
|
||||
+ exec {pipe}<&-
|
||||
+
|
||||
+ eval "$result"
|
||||
+ fi
|
||||
|
||||
if [ $ret != 0 ]; then
|
||||
ocf_log $failure_log_level "$DRBD_RESOURCE: Called $cmd"
|
||||
@@ -585,13 +619,13 @@ set_master_score() {
|
||||
if [[ $1 -le 0 ]]; then
|
||||
remove_master_score
|
||||
else
|
||||
- do_cmd ${HA_SBIN_DIR}/crm_master -Q -l reboot -v $1 &&
|
||||
+ do_cmd_CRM_meta_timeout ${HA_SBIN_DIR}/crm_master -Q -l reboot -v $1 &&
|
||||
current_master_score=$1
|
||||
fi
|
||||
}
|
||||
|
||||
remove_master_score() {
|
||||
- do_cmd ${HA_SBIN_DIR}/crm_master -l reboot -D
|
||||
+ do_cmd_CRM_meta_timeout ${HA_SBIN_DIR}/crm_master -l reboot -D
|
||||
current_master_score=""
|
||||
}
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
@ -0,0 +1,32 @@
|
||||
From 0a014f290802e0221d06bb52a74c2e29f11ef02e Mon Sep 17 00:00:00 2001
|
||||
From: Lars Ellenberg <lars.ellenberg@linbit.com>
|
||||
Date: Fri, 6 Dec 2024 15:35:58 +0100
|
||||
Subject: [PATCH 12/12] drbd.ocf: the text output of "crm_resource --locate"
|
||||
has changed
|
||||
|
||||
"Recent" Pacemaker reports "Promoted" instead of "Master" for promoted resources.
|
||||
Recognize that.
|
||||
|
||||
This change was made quite a while ago, but the resource agent parameter
|
||||
remove_master_score_if_peer_primary=unexpected
|
||||
is little known and rarely in use, so no-one noticed.
|
||||
---
|
||||
scripts/drbd.ocf | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/scripts/drbd.ocf b/scripts/drbd.ocf
|
||||
index c31858343ba4..34d208f22dd5 100755
|
||||
--- a/scripts/drbd.ocf
|
||||
+++ b/scripts/drbd.ocf
|
||||
@@ -1021,7 +1021,7 @@ crm_resource_locate_master()
|
||||
called_crm_resource_locate=true
|
||||
DRBD_PRIMARY_PEER_according_to_pcmk=$(
|
||||
crm_resource --resource "$OCF_RESOURCE_INSTANCE" --locate 2>/dev/null |
|
||||
- sed -ne 's/^.*is running on: \([^ ]*\) Master.*$/\1/p' |
|
||||
+ sed -ne 's/^.*is running on: \([^ ]*\) \(Master\|Promoted\).*$/\1/p' |
|
||||
grep -vix -m1 -e "$HOSTNAME")
|
||||
}
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
23
_service
Normal file
23
_service
Normal file
@ -0,0 +1,23 @@
|
||||
<services>
|
||||
<service name="tar_scm" mode="disabled">
|
||||
<param name="url">https://github.com/LINBIT/drbd-utils.git</param>
|
||||
<param name="scm">git</param>
|
||||
<param name="filename">drbd-utils</param>
|
||||
<!--
|
||||
build service using release drbd-utils atm.
|
||||
<param name="version">9.19.0</param>
|
||||
Using release tarball instead of git since need buildtag.c/h
|
||||
-->
|
||||
<param name="versionformat">9.19.0+git.%h</param>
|
||||
<param name="revision">master</param>
|
||||
</service>
|
||||
|
||||
<service name="recompress" mode="disabled">
|
||||
<param name="file">*drbd-utils*.tar</param>
|
||||
<param name="compression">gz</param>
|
||||
</service>
|
||||
|
||||
<service name="set_version" mode="disabled">
|
||||
<param name="basename">drbd-utils</param>
|
||||
</service>
|
||||
</services>
|
11
bsc-1032142_Disable-quorum-in-default-configuration.patch
Normal file
11
bsc-1032142_Disable-quorum-in-default-configuration.patch
Normal file
@ -0,0 +1,11 @@
|
||||
diff -Naur drbd-utils-9.0.0+git.98b6340c.orig/scripts/global_common.conf drbd-utils-9.0.0+git.98b6340c/scripts/global_common.conf
|
||||
--- drbd-utils-9.0.0+git.98b6340c.orig/scripts/global_common.conf 2017-06-07 16:04:14.063680274 +0800
|
||||
+++ drbd-utils-9.0.0+git.98b6340c/scripts/global_common.conf 2017-06-07 16:04:45.519644428 +0800
|
||||
@@ -42,6 +42,7 @@
|
||||
|
||||
# RECOMMENDED for three or more storage nodes with DRBD 9:
|
||||
# quorum majority;
|
||||
+ quorum off;
|
||||
# on-no-quorum suspend-io | io-error;
|
||||
}
|
||||
|
@ -0,0 +1,64 @@
|
||||
From 6d5cb4c97031f28ae70406145aa437b3107246e6 Mon Sep 17 00:00:00 2001
|
||||
From: Su Yue <glass.su@suse.com>
|
||||
Date: Sun, 3 Mar 2024 16:36:54 +0800
|
||||
Subject: [PATCH 1/2] crm-fence-peer.9.sh: fix parsing in_ccm crmd fields of
|
||||
node_state with Pacemaker 2.1.7
|
||||
|
||||
If pacemaker version < 2.1.7, in_ccm of node_state is "true" or "false"
|
||||
and crmd is "online" or "offline".
|
||||
|
||||
pacemaker 2.1.7 changed the two fields into timestamps.
|
||||
For in_ccm, the value is timestamp since when node has been a cluster
|
||||
member("true"). A value 0 of means the node is not a cluster member("false").
|
||||
For crmd, the value is timestamp since when peer has been online in
|
||||
CPG("online"). A value 0 means the peer is offline in CPG("offline").
|
||||
|
||||
The original code doesn't handle these fields in timestamp format.
|
||||
Since there are many comprare of strings in context, converting in_ccm and crmd
|
||||
from timestamps/0 to old strings is simpler and clearer.
|
||||
|
||||
Link: https://github.com/ClusterLabs/pacemaker/blob/Pacemaker-2.1.7/lib/pengine/unpack.c#L1581
|
||||
Signed-off-by: Su Yue <glass.su@suse.com>
|
||||
---
|
||||
scripts/crm-fence-peer.9.sh | 25 +++++++++++++++++++++++++
|
||||
1 file changed, 25 insertions(+)
|
||||
|
||||
diff --git a/scripts/crm-fence-peer.9.sh b/scripts/crm-fence-peer.9.sh
|
||||
index 44da6516bf3f..a3353a7354a6 100755
|
||||
--- a/scripts/crm-fence-peer.9.sh
|
||||
+++ b/scripts/crm-fence-peer.9.sh
|
||||
@@ -888,6 +888,31 @@ guess_if_pacemaker_will_fence()
|
||||
esac
|
||||
done
|
||||
|
||||
+ # Copied from pacemaker-2.1.7:lib/pengine/unpack.c:
|
||||
+ # Since crm_feature_set 3.18.0 (pacemaker-2.1.7):
|
||||
+ #
|
||||
+ # - in_ccm ::= <timestamp>|0
|
||||
+ # Since when node has been a cluster member. A value 0 of means the
|
||||
+ # node is not a cluster member.
|
||||
+ # - crmd ::= <timestamp>|0
|
||||
+ # Since when peer has been online in CPG. A value 0 means the peer
|
||||
+ # is offline in CPG.
|
||||
+ if [[ $in_ccm =~ ^[0-9]+$ ]]; then
|
||||
+ if [[ $in_ccm = "0" ]]; then
|
||||
+ in_ccm="false"
|
||||
+ else
|
||||
+ in_ccm="true"
|
||||
+ fi
|
||||
+ fi
|
||||
+
|
||||
+ if [[ $crmd =~ ^[0-9]+$ ]]; then
|
||||
+ if [[ $crmd = "0" ]]; then
|
||||
+ crmd="offline"
|
||||
+ else
|
||||
+ crmd="online"
|
||||
+ fi
|
||||
+ fi
|
||||
+
|
||||
# if it is not enabled, no point in waiting for it.
|
||||
if ! $stonith_enabled ; then
|
||||
# "normalize" the rest of the logic
|
||||
--
|
||||
2.44.0
|
||||
|
@ -0,0 +1,30 @@
|
||||
From 922e6702cb7a089102f4843b2994ef0749c41573 Mon Sep 17 00:00:00 2001
|
||||
From: Su Yue <glass.su@suse.com>
|
||||
Date: Sun, 3 Mar 2024 16:56:38 +0800
|
||||
Subject: [PATCH 2/2] crm-fence-peer.9.sh: use join of node_state to judge
|
||||
whether node is banned
|
||||
|
||||
crmd in node_state can't be "banned". join should be used instead
|
||||
of crmd.
|
||||
|
||||
Signed-off-by: Su Yue <glass.su@suse.com>
|
||||
---
|
||||
scripts/crm-fence-peer.9.sh | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/scripts/crm-fence-peer.9.sh b/scripts/crm-fence-peer.9.sh
|
||||
index a3353a7354a6..b326a1656c15 100755
|
||||
--- a/scripts/crm-fence-peer.9.sh
|
||||
+++ b/scripts/crm-fence-peer.9.sh
|
||||
@@ -934,7 +934,7 @@ guess_if_pacemaker_will_fence()
|
||||
|
||||
# for further inspiration, see pacemaker:lib/pengine/unpack.c, determine_online_status_fencing()
|
||||
[[ -z $in_ccm ]] && will_fence=true
|
||||
- [[ $crmd = "banned" ]] && will_fence=true
|
||||
+ [[ $join = "banned" ]] && will_fence=true
|
||||
if [[ ${expected-down} = "down" && $in_ccm = "false" && $crmd != "online" ]]; then
|
||||
: "pacemaker considers this as clean down"
|
||||
elif [[ $in_ccm = false ]] || [[ $crmd != "online" ]]; then
|
||||
--
|
||||
2.44.0
|
||||
|
@ -0,0 +1,74 @@
|
||||
From a1fbba9b5b5cd41eb8623ede4e7f89b0f65602c8 Mon Sep 17 00:00:00 2001
|
||||
From: Su Yue <glass.su@suse.com>
|
||||
Date: Sun, 7 Jul 2024 15:22:49 +0800
|
||||
Subject: [PATCH 1/3] drbd.ocf: replace crm_master with ocf_promotion_score
|
||||
|
||||
The crm_master command has been deprecated and replaced with a new
|
||||
crm_attribute --promotion option that defaults to --lifetime=reboot
|
||||
(example: crm_master -l reboot -v 10 becomes
|
||||
crm_attribute --promotion -v 10. The old command will still work for
|
||||
now, but the new one should be used if available. The new option is
|
||||
available as of CRM feature set 3.9.0).
|
||||
|
||||
Also define ocf_promotion_score() as
|
||||
resource-agents/heartbeat/ocf-shellfuncs.in if it doesn't exist.
|
||||
|
||||
Signed-off-by: Su Yue <glass.su@suse.com>
|
||||
---
|
||||
scripts/drbd.ocf | 20 ++++++++++++++++----
|
||||
1 file changed, 16 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/scripts/drbd.ocf b/scripts/drbd.ocf
|
||||
index 1d051baa550d..133aff737455 100755
|
||||
--- a/scripts/drbd.ocf
|
||||
+++ b/scripts/drbd.ocf
|
||||
@@ -104,6 +104,18 @@ if ! command -v ocf_is_true &> /dev/null ; then
|
||||
}
|
||||
fi
|
||||
|
||||
+if ! command -v ocf_promotion_score &> /dev/null ; then
|
||||
+ ocf_promotion_score() {
|
||||
+ ocf_version_cmp "$OCF_RESKEY_crm_feature_set" "3.10.0"
|
||||
+ res=$?
|
||||
+ if [ $res -eq 2 ] || [ $res -eq 1 ] || ! have_binary "crm_master"; then
|
||||
+ ${HA_SBIN_DIR}/crm_attribute -p ${OCF_RESOURCE_INSTANCE} $@
|
||||
+ else
|
||||
+ ${HA_SBIN_DIR}/crm_master -l reboot $@
|
||||
+ fi
|
||||
+ }
|
||||
+fi
|
||||
+
|
||||
# Defaults
|
||||
OCF_RESKEY_drbdconf_default="/etc/drbd.conf"
|
||||
OCF_RESKEY_unfence_extra_args_default="--quiet --flock-required --flock-timeout 0 --unfence-only-if-owner-match"
|
||||
@@ -570,9 +582,9 @@ do_drbdadm() {
|
||||
unset current_master_score
|
||||
get_current_master_score()
|
||||
{
|
||||
- # only call crm_master once
|
||||
+ # only call get crm master once
|
||||
[[ ${current_master_score+set} ]] ||
|
||||
- current_master_score=$(crm_master -q -l reboot -G 2>/dev/null)
|
||||
+ current_master_score=$(ocf_promotion_score -q -G 2>/dev/null)
|
||||
# return value of this function:
|
||||
# true if master_score is present
|
||||
# false if master_score is not present
|
||||
@@ -585,13 +597,13 @@ set_master_score() {
|
||||
if [[ $1 -le 0 ]]; then
|
||||
remove_master_score
|
||||
else
|
||||
- do_cmd_CRM_meta_timeout ${HA_SBIN_DIR}/crm_master -Q -l reboot -v $1 &&
|
||||
+ do_cmd_CRM_meta_timeout ocf_promotion_score -Q -v $1 &&
|
||||
current_master_score=$1
|
||||
fi
|
||||
}
|
||||
|
||||
remove_master_score() {
|
||||
- do_cmd_CRM_meta_timeout ${HA_SBIN_DIR}/crm_master -l reboot -D
|
||||
+ do_cmd_CRM_meta_timeout ocf_promotion_score -D
|
||||
current_master_score=""
|
||||
}
|
||||
|
||||
--
|
||||
2.45.2
|
||||
|
78
bsc-1233273_drbd.ocf-update-for-OCF-1.1.patch
Normal file
78
bsc-1233273_drbd.ocf-update-for-OCF-1.1.patch
Normal file
@ -0,0 +1,78 @@
|
||||
From 3baaf88af512492dd5315a50cf421fbcf51ef9b8 Mon Sep 17 00:00:00 2001
|
||||
From: Su Yue <glass.su@suse.com>
|
||||
Date: Sun, 7 Jul 2024 16:52:18 +0800
|
||||
Subject: [PATCH 3/3] drbd.ocf: update for OCF 1.1
|
||||
|
||||
According to [1], the commit
|
||||
1. bumps drbd ocf version to 1.5
|
||||
2. updates the <version> element to 1.1 for declare support OCF 1.1.
|
||||
3. uses unique-group attribute but keeps deprecated unique attribute.
|
||||
4. advertises new role names 'Unpromoted' and 'Unpromoted' instead of
|
||||
'Master' and 'Slave'.
|
||||
|
||||
Because of change[4], the drbd ocf RA won't be able to support old
|
||||
names so we need to bump version of the RA.
|
||||
|
||||
Links: https://projects.clusterlabs.org/w/development/update_resource_agent_for_ocf_1.1/
|
||||
Signed-off-by: Su Yue <glass.su@suse.com>
|
||||
---
|
||||
scripts/drbd.ocf | 16 ++++++++--------
|
||||
1 file changed, 8 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/scripts/drbd.ocf b/scripts/drbd.ocf
|
||||
index bbe25f38edda..5b213640ec38 100755
|
||||
--- a/scripts/drbd.ocf
|
||||
+++ b/scripts/drbd.ocf
|
||||
@@ -233,13 +233,13 @@ meta_data() {
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
|
||||
<!-- version attribute is version of this resource agent -->
|
||||
-<resource-agent name="drbd" version="LINBIT 1.4">
|
||||
+<resource-agent name="drbd" version="LINBIT 1.5">
|
||||
|
||||
<!-- Version number of the standard this agent complies with -->
|
||||
-<version>1.0</version>
|
||||
+<version>1.1</version>
|
||||
|
||||
<longdesc lang="en">
|
||||
-This resource agent manages a DRBD resource as a master/slave resource.
|
||||
+This resource agent manages a DRBD resource as a promotable resource.
|
||||
DRBD is a shared-nothing replicated storage device.
|
||||
|
||||
NOTE:
|
||||
@@ -253,10 +253,10 @@ See the DRBD User's Guide for more information.
|
||||
https://docs.linbit.com/
|
||||
</longdesc>
|
||||
|
||||
-<shortdesc lang="en">Manages a DRBD device as a Master/Slave resource</shortdesc>
|
||||
+<shortdesc lang="en">Manages a DRBD device as a promotable resource</shortdesc>
|
||||
|
||||
<parameters>
|
||||
-<parameter name="drbd_resource" unique="1" required="1">
|
||||
+<parameter name="drbd_resource" unique="1" unique-group="name" required="1">
|
||||
<longdesc lang="en">
|
||||
The name of the drbd resource from the drbd.conf file.
|
||||
</longdesc>
|
||||
@@ -483,8 +483,8 @@ to be generated after the failover of a "healthy" DRBD.
|
||||
<action name="demote" timeout="90" />
|
||||
<action name="notify" timeout="90" />
|
||||
<action name="stop" timeout="100" />
|
||||
-<action name="monitor" timeout="20" interval="20" role="Slave" />
|
||||
-<action name="monitor" timeout="20" interval="10" role="Master" />
|
||||
+<action name="monitor" timeout="20" interval="20" role="Unpromoted" />
|
||||
+<action name="monitor" timeout="20" interval="10" role="Promoted" />
|
||||
<action name="meta-data" timeout="5" />
|
||||
<action name="validate-all" />
|
||||
</actions>
|
||||
@@ -974,7 +974,7 @@ drbd_monitor() {
|
||||
fi
|
||||
|
||||
case $status in
|
||||
- (0) : "OCF_SUCCESS aka 'running/slave'" ;;
|
||||
+ (0) : "OCF_SUCCESS aka 'running/unpromotable'" ;;
|
||||
(1) : "OCF_ERR_GENERIC" ;;
|
||||
(2) : "OCF_ERR_ARGS" ;;
|
||||
(3) : "OCF_ERR_UNIMPLEMENTED" ;;
|
||||
--
|
||||
2.45.2
|
||||
|
@ -0,0 +1,35 @@
|
||||
From 4efed473e70c91487f7834f8bf536970e9389f3f Mon Sep 17 00:00:00 2001
|
||||
From: Su Yue <glass.su@suse.com>
|
||||
Date: Sun, 7 Jul 2024 16:05:42 +0800
|
||||
Subject: [PATCH 2/3] drbd.ocf: update regex of sed for new output from
|
||||
crm_resource
|
||||
|
||||
Since Pacemaker-2.1.0
|
||||
crm_resource --resource "$OCF_RESOURCE_INSTANCE" --locate outputs
|
||||
'resource promotable-clone is running on: cluster02 Promoted'
|
||||
was
|
||||
'resource promotable-clone is running on: cluster02 Master'.
|
||||
|
||||
So update the regular expression.
|
||||
|
||||
Signed-off-by: Su Yue <glass.su@suse.com>
|
||||
---
|
||||
scripts/drbd.ocf | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/scripts/drbd.ocf b/scripts/drbd.ocf
|
||||
index 133aff737455..bbe25f38edda 100755
|
||||
--- a/scripts/drbd.ocf
|
||||
+++ b/scripts/drbd.ocf
|
||||
@@ -999,7 +999,7 @@ crm_resource_locate_master()
|
||||
called_crm_resource_locate=true
|
||||
DRBD_PRIMARY_PEER_according_to_pcmk=$(
|
||||
crm_resource --resource "$OCF_RESOURCE_INSTANCE" --locate 2>/dev/null |
|
||||
- sed -ne 's/^.*is running on: \([^ ]*\) Master.*$/\1/p' |
|
||||
+ sed -ne 's/^.*is running on: \([^ ]*\) \(Master\|Promoted\).*$/\1/p' |
|
||||
grep -vix -m1 -e "$HOSTNAME")
|
||||
}
|
||||
|
||||
--
|
||||
2.45.2
|
||||
|
BIN
drbd-utils-9.25.0.tar.gz
(Stored with Git LFS)
Normal file
BIN
drbd-utils-9.25.0.tar.gz
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
drbd-utils-9.29.0.tar.gz
(Stored with Git LFS)
Normal file
BIN
drbd-utils-9.29.0.tar.gz
(Stored with Git LFS)
Normal file
Binary file not shown.
2123
drbd-utils.changes
Normal file
2123
drbd-utils.changes
Normal file
File diff suppressed because it is too large
Load Diff
1
drbd-utils.rpmlintrc
Normal file
1
drbd-utils.rpmlintrc
Normal file
@ -0,0 +1 @@
|
||||
addFilter("missing-call-to-setgroups-before-setuid /usr/sbin/drbdmon")
|
249
drbd-utils.spec
Normal file
249
drbd-utils.spec
Normal file
@ -0,0 +1,249 @@
|
||||
#
|
||||
# spec file for package drbd-utils
|
||||
#
|
||||
# Copyright (c) 2025 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
%define services drbd.service drbd-graceful-shutdown.service drbd-lvchange@.service drbd-promote@.service drbd-demote-or-escalate@.service drbd-reconfigure-suspend-or-error@.service drbd-services@.target drbd-wait-promotable@.service drbd@.service drbd@.target ocf.ra@.service
|
||||
%if 0%{?suse_version} < 1550
|
||||
# for SLEs
|
||||
%define sbindir /sbin
|
||||
# see bsc#1203220 & usrmerge_move_lib_to_prefix_lib.patch for %{libdir}
|
||||
%define libdir /usr/lib
|
||||
%else
|
||||
# for opensuse
|
||||
%define sbindir %{_sbindir}
|
||||
%define libdir %{_prefix}/lib
|
||||
%endif
|
||||
%bcond_without drbdmon
|
||||
# Man pages are included in the released tarball.
|
||||
# Only need po4a to build man from git source code
|
||||
%bcond_without prebuiltman
|
||||
Name: drbd-utils
|
||||
Version: 9.29.0
|
||||
Release: 0
|
||||
Summary: Distributed Replicated Block Device
|
||||
License: GPL-2.0-or-later
|
||||
Group: Productivity/Clustering/HA
|
||||
URL: https://linbit.com/linbit-software-download-page-for-linstor-and-drbd-linux-driver/
|
||||
Source: https://pkg.linbit.com//downloads/drbd/utils/%{name}-%{version}.tar.gz
|
||||
Source100: %{name}.rpmlintrc
|
||||
|
||||
#############################################
|
||||
# Upstream patches
|
||||
Patch0001: 0001-drbd-verify.py-relax-host-key-checking.patch
|
||||
Patch0002: 0002-DRBDmon-Disabled-DRBD-commands-warning-only-for-actu.patch
|
||||
Patch0003: 0003-DRBDmon-Integrate-global-local-command-delegation.patch
|
||||
Patch0004: 0004-DRBDmon-Adjust-events-log-supplier-program-name.patch
|
||||
Patch0005: 0005-DRBDmon-Add-drbd-events-log-supplier.patch
|
||||
Patch0006: 0006-DRBDmon-Adjust-Makefile.patch
|
||||
Patch0007: 0007-DRBDmon-Version-V1R4M1.patch
|
||||
Patch0008: 0008-drbdadm-add-proxy-options-to-add-connection-command.patch
|
||||
Patch0009: 0009-Do-not-hardcode-paths-in-services-and-scripts.patch
|
||||
Patch0010: 0010-Fix-typo-in-warning-there-is-no-po4a-translage-comma.patch
|
||||
Patch0011: 0011-drbd.ocf-explicitly-timeout-crm_master-IPC-early.patch
|
||||
Patch0012: 0012-drbd.ocf-the-text-output-of-crm_resource-locate-has-.patch
|
||||
|
||||
# SUSE specific patches
|
||||
Patch1001: init-script-fixes.diff
|
||||
Patch1002: fence-after-pacemaker-down.patch
|
||||
Patch1003: bsc-1032142_Disable-quorum-in-default-configuration.patch
|
||||
Patch1004: move_fencing_from_disk_to_net_in_example.patch
|
||||
Patch1005: pie-fix.patch
|
||||
Patch1006: bsc-1233273_drbd.ocf-replace-crm_master-with-ocf_promotion_score.patch
|
||||
Patch1007: bsc-1233273_drbd.ocf-update-for-OCF-1.1.patch
|
||||
Patch1008: rpmlint-build-error.patch
|
||||
#############################################
|
||||
|
||||
Provides: drbd-bash-completion = %{version}
|
||||
Provides: drbd-pacemaker = %{version}
|
||||
Provides: drbd-udev = %{version}
|
||||
Obsoletes: drbd-bash-completion < %{version}
|
||||
Obsoletes: drbd-pacemaker < %{version}
|
||||
Obsoletes: drbd-udev < %{version}
|
||||
# drbd-utils first split from drbd-8.4.5(only driver)
|
||||
# and suse let drbd driver goes in-kernel
|
||||
# Provides: drbd = 8.4.5
|
||||
# Obsoletes: drbd < 8.4.5
|
||||
%ifarch %{ix86} x86_64
|
||||
Provides: drbd-xen = %{version}
|
||||
Obsoletes: drbd-xen < %{version}
|
||||
%endif
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: automake
|
||||
BuildRequires: bison
|
||||
BuildRequires: docbook-xsl-stylesheets
|
||||
BuildRequires: flex
|
||||
BuildRequires: gcc
|
||||
BuildRequires: glibc-devel
|
||||
BuildRequires: libxslt
|
||||
BuildRequires: make
|
||||
BuildRequires: pkgconfig
|
||||
BuildRequires: pkgconfig(systemd)
|
||||
BuildRequires: pkgconfig(udev)
|
||||
%if %{with drbdmon}
|
||||
BuildRequires: gcc-c++
|
||||
%endif
|
||||
%if %{without prebuiltman}
|
||||
BuildRequires: po4a
|
||||
%endif
|
||||
Provides: drbd-control
|
||||
Provides: drbdsetup
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
%description
|
||||
Drbd is a distributed replicated block device. It mirrors a block
|
||||
device over the network to another machine. Think of it as networked
|
||||
raid 1. It is a building block for setting up clusters.
|
||||
|
||||
%prep
|
||||
%autosetup -p1
|
||||
|
||||
%build
|
||||
export WANT_DRBD_REPRODUCIBLE_BUILD=1
|
||||
./autogen.sh
|
||||
PATH=/sbin:$PATH ./configure \
|
||||
--with-udev \
|
||||
--with-distro=suse \
|
||||
--without-heartbeat \
|
||||
--with-pacemaker \
|
||||
--with-xen \
|
||||
--with-bashcompletion \
|
||||
--with-initscripttype=systemd \
|
||||
--with-systemdunitdir=%{_prefix}/lib/systemd/system \
|
||||
%if 0%{?suse_version} < 1550
|
||||
--sbindir=/sbin \
|
||||
%else
|
||||
--sbindir=%{_sbindir} \
|
||||
%endif
|
||||
--prefix=%{_prefix} \
|
||||
--localstatedir=%{_localstatedir} \
|
||||
--mandir=%{_mandir} \
|
||||
--sysconfdir=%{_sysconfdir} \
|
||||
--datarootdir=%{_datadir} \
|
||||
--datadir=%{_datadir} \
|
||||
--libdir=%{_prefix}/lib \
|
||||
--exec_prefix=%{_prefix}/lib \
|
||||
%{?with_drbdmon: --with-drbdmon} \
|
||||
%{?with_prebuiltman: --with-prebuiltman} \
|
||||
--with-tmpfilesdir=%{_tmpfilesdir} \
|
||||
--without-83support \
|
||||
--without-84support
|
||||
|
||||
%make_build OPTFLAGS="%{optflags}"
|
||||
|
||||
%install
|
||||
%make_install
|
||||
|
||||
%ifnarch %{ix86} x86_64
|
||||
rm -rf %{buildroot}%{_sysconfdir}/xen
|
||||
%endif
|
||||
|
||||
rm -rf %{buildroot}%{libdir}/drbd/crm-*fence-peer.sh # bsc#1204276
|
||||
|
||||
%pre
|
||||
%service_add_pre %{services}
|
||||
|
||||
%post
|
||||
%tmpfiles_create %{_tmpfilesdir}/drbd.conf
|
||||
%service_add_post %{services}
|
||||
|
||||
#May also overlap the $MAN_LINK in documentation/v9/Makefile.in
|
||||
for f in drbd drbdadm drbdmeta drbdsetup; do
|
||||
ln -sf $f-9.0.8.gz %{_mandir}/man8/$f.8.gz
|
||||
ln -sf $f-9.0.8.gz %{_mandir}/ja/man8/$f.8.gz
|
||||
done
|
||||
ln -sf drbd.conf-9.0.5.gz %{_mandir}/man5/drbd.conf.5.gz
|
||||
ln -sf drbd.conf-9.0.5.gz %{_mandir}/ja/man5/drbd.conf.5.gz
|
||||
%if %{with drbdmon}
|
||||
ln -sf drbdmon-9.0.8.gz %{_mandir}/man8/drbdmon.8.gz
|
||||
ln -sf drbdmon-9.0.8.gz %{_mandir}/ja/man8/drbdmon.8.gz
|
||||
%endif
|
||||
|
||||
%preun
|
||||
%service_del_preun %{services}
|
||||
|
||||
%postun
|
||||
%service_del_postun %{services}
|
||||
|
||||
%if 0%{?suse_version} < 1550
|
||||
if [ -d /lib/drbd ]; then
|
||||
rm -rf /lib/drbd.rpmmoved
|
||||
mv /lib/drbd /lib/drbd.rpmmoved
|
||||
elif [ ! -e %{libdir}/drbd ] && [ -L /lib/drbd ]; then
|
||||
rm /lib/drbd
|
||||
fi
|
||||
%endif
|
||||
|
||||
%posttrans
|
||||
%if 0%{?suse_version} < 1550
|
||||
if [ ! -e /lib/drbd ]; then
|
||||
ln -sf %{libdir}/drbd /lib/drbd
|
||||
fi
|
||||
%endif
|
||||
|
||||
%files -n drbd-utils
|
||||
%config(noreplace) %{_sysconfdir}/drbd.conf
|
||||
%config(noreplace) %{_sysconfdir}/drbd.d/global_common.conf
|
||||
%config(noreplace) %{_sysconfdir}/multipath/conf.d/drbd.conf
|
||||
%{_datadir}/bash-completion/completions/drbdadm
|
||||
%{_tmpfilesdir}/drbd.conf
|
||||
%{_mandir}/man5/drbd.*
|
||||
%{_mandir}/man8/drbd*
|
||||
%{_mandir}/man7/ocf*
|
||||
%{_mandir}/man7/drbd*
|
||||
%{_mandir}/ja/man5/drbd.*
|
||||
%{_mandir}/ja/man8/drbd*
|
||||
%license COPYING
|
||||
%doc README.md
|
||||
%doc ChangeLog
|
||||
%doc scripts/drbd.conf.example
|
||||
%dir %{_sysconfdir}/drbd.d
|
||||
%dir %{_sysconfdir}/multipath
|
||||
%dir %{_sysconfdir}/multipath/conf.d
|
||||
%{libdir}/drbd
|
||||
%{sbindir}/drbdadm
|
||||
%{sbindir}/drbdsetup
|
||||
%{sbindir}/drbdmeta
|
||||
%if %{with drbdmon}
|
||||
%{sbindir}/drbdmon
|
||||
%{sbindir}/drbd-events-log-supplier
|
||||
%endif
|
||||
%ifarch %{ix86} x86_64
|
||||
%dir %attr(700,root,root) %{_sysconfdir}/xen
|
||||
%dir %{_sysconfdir}/xen/scripts
|
||||
%attr(755,root,root) %{_sysconfdir}/xen/scripts/block-drbd
|
||||
%endif
|
||||
%{_prefix}/lib/ocf/resource.d/linbit/drbd
|
||||
%{_prefix}/lib/ocf/resource.d/linbit/drbd-attr
|
||||
%{_prefix}/lib/ocf/resource.d/linbit/drbd.shellfuncs.sh
|
||||
%{_udevrulesdir}/65-drbd.rules
|
||||
%{_unitdir}/drbd.service
|
||||
%{_unitdir}/drbd-graceful-shutdown.service
|
||||
%{_unitdir}/drbd-lvchange@.service
|
||||
%{_unitdir}/drbd-promote@.service
|
||||
%{_unitdir}/drbd-demote-or-escalate@.service
|
||||
%{_unitdir}/drbd-reconfigure-suspend-or-error@.service
|
||||
%{_unitdir}/drbd-services@.target
|
||||
%{_unitdir}/drbd-wait-promotable@.service
|
||||
%{_unitdir}/drbd@.service
|
||||
%{_unitdir}/drbd@.target
|
||||
%{_unitdir}/ocf.ra@.service
|
||||
%dir %{_prefix}/lib/ocf
|
||||
%dir %{_prefix}/lib/ocf/resource.d
|
||||
%dir %{_prefix}/lib/ocf/resource.d/linbit
|
||||
%dir %{_localstatedir}/lib/drbd
|
||||
|
||||
%changelog
|
29
fence-after-pacemaker-down.patch
Normal file
29
fence-after-pacemaker-down.patch
Normal file
@ -0,0 +1,29 @@
|
||||
diff -Naur drbd-utils-8.9.6.orig/scripts/crm-fence-peer.sh drbd-utils-8.9.6/scripts/crm-fence-peer.sh
|
||||
--- drbd-utils-8.9.6.orig/scripts/crm-fence-peer.sh 2016-03-14 15:54:38.701360775 +0800
|
||||
+++ drbd-utils-8.9.6/scripts/crm-fence-peer.sh 2016-03-14 16:00:06.333338664 +0800
|
||||
@@ -531,6 +531,25 @@
|
||||
[[ $join = "banned" ]] && will_fence=true
|
||||
if [[ ${expected-down} = "down" && $in_ccm = "false" && $crmd != "online" ]]; then
|
||||
: "pacemaker considers this as clean down"
|
||||
+ elif [[ $crmd/$join/$expected = "offline/down/down" ]] ; then
|
||||
+ # Check if pacemaker is simply shutdown, but membership/quorum is
|
||||
+ # possibly still established (corosync2/cman)
|
||||
+ # 1.1.11 will set expected="down" on a clean shutdown too
|
||||
+ # Look for "shutdown" transient node attribute
|
||||
+ local node_attributes=$(set +x; echo "$cib_xml" |
|
||||
+ awk "/<node_state [^\n]*uname=\"$DRBD_PEER\"/,/<\/instance_attributes>/"|
|
||||
+ grep -F -e "<nvpair ")
|
||||
+ if [ -n "${node_attributes}" ] ; then
|
||||
+ local shut_down=$(set +x; echo "$node_attributes" |
|
||||
+ awk '/ name="shutdown"/ {if (match($0, /value=\"([[:digit:]]+)\"/, values)) {print values[1]} }')
|
||||
+ if [ -n "${shut_down}" ] ; then
|
||||
+ : "pacemaker considers this as clean down"
|
||||
+ else
|
||||
+ will_fence=true
|
||||
+ fi
|
||||
+ else
|
||||
+ will_fence=true
|
||||
+ fi
|
||||
elif [[ $in_ccm = false ]] || [[ $crmd != "online" ]]; then
|
||||
will_fence=true
|
||||
fi
|
38
init-script-fixes.diff
Normal file
38
init-script-fixes.diff
Normal file
@ -0,0 +1,38 @@
|
||||
diff -Naur drbd-utils-8.9.9.orig/scripts/drbd drbd-utils-8.9.9/scripts/drbd
|
||||
--- drbd-utils-8.9.9.orig/scripts/drbd 2016-10-24 17:37:12.893292307 +0800
|
||||
+++ drbd-utils-8.9.9/scripts/drbd 2016-10-24 17:38:56.728938286 +0800
|
||||
@@ -9,14 +9,14 @@
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: drbd
|
||||
-# Required-Start: $local_fs $network $syslog
|
||||
-# Required-Stop: $local_fs $network $syslog
|
||||
+# Required-Start: $remote_fs $network $syslog
|
||||
+# Required-Stop: $remote_fs $network $syslog
|
||||
# Should-Start: sshd multipathd
|
||||
# Should-Stop: sshd multipathd
|
||||
# Default-Start:
|
||||
# Default-Stop: 0 1 6
|
||||
-# X-Start-Before: heartbeat corosync
|
||||
-# X-Stop-After: heartbeat corosync
|
||||
+# X-Start-Before: pacemaker corosync
|
||||
+# X-Stop-After: pacemaker corosync
|
||||
# X-Interactive: true
|
||||
# Short-Description: Control DRBD resources.
|
||||
# Description: Control all DRBD resources.
|
||||
@@ -184,7 +184,6 @@
|
||||
done
|
||||
done
|
||||
|
||||
- [ -d /var/lock/subsys ] && touch /var/lock/subsys/drbd # for RedHat
|
||||
run_hook start_before-wait
|
||||
$DRBDADM wait-con-int # User interruptible version of wait-connect all
|
||||
run_hook start
|
||||
@@ -256,7 +255,6 @@
|
||||
fi
|
||||
done
|
||||
run_hook stop
|
||||
- [ -f /var/lock/subsys/drbd ] && rm /var/lock/subsys/drbd
|
||||
log_end_msg 0
|
||||
;;
|
||||
status)
|
25
move_fencing_from_disk_to_net_in_example.patch
Normal file
25
move_fencing_from_disk_to_net_in_example.patch
Normal file
@ -0,0 +1,25 @@
|
||||
diff -Naur drbd-utils-9.0.0.orig/scripts/global_common.conf drbd-utils-9.0.0/scripts/global_common.conf
|
||||
--- drbd-utils-9.0.0.orig/scripts/global_common.conf 2017-10-16 17:02:55.715528259 +0800
|
||||
+++ drbd-utils-9.0.0/scripts/global_common.conf 2017-10-16 17:07:49.755636558 +0800
|
||||
@@ -47,10 +47,10 @@
|
||||
}
|
||||
|
||||
disk {
|
||||
- # size on-io-error fencing disk-barrier disk-flushes
|
||||
+ # on-io-error disk-barrier disk-flushes
|
||||
# disk-drain md-flushes resync-rate resync-after al-extents
|
||||
- # c-plan-ahead c-delay-target c-fill-target c-max-rate
|
||||
- # c-min-rate disk-timeout
|
||||
+ # c-plan-ahead c-delay-target c-fill-target c-max-rate
|
||||
+ # c-min-rate disk-timeout
|
||||
}
|
||||
|
||||
net {
|
||||
@@ -60,6 +60,6 @@
|
||||
# after-sb-1pri after-sb-2pri always-asbp rr-conflict
|
||||
# ping-timeout data-integrity-alg tcp-cork on-congestion
|
||||
# congestion-fill congestion-extents csums-alg verify-alg
|
||||
- # use-rle
|
||||
+ # use-rle fencing
|
||||
}
|
||||
}
|
13
pie-fix.patch
Normal file
13
pie-fix.patch
Normal file
@ -0,0 +1,13 @@
|
||||
Index: drbd-utils-9.14.0/user/drbdmon/Makefile.in
|
||||
===================================================================
|
||||
--- drbd-utils-9.14.0.orig/user/drbdmon/Makefile.in
|
||||
+++ drbd-utils-9.14.0/user/drbdmon/Makefile.in
|
||||
@@ -1,6 +1,7 @@
|
||||
CXXFLAGS=-std=c++11 -I. -I../shared -Icppdsaext/src -Wall -Werror -pedantic-errors -fPIC -O2 \
|
||||
-Wsign-compare -Wpointer-arith -Wswitch-default -Wswitch-enum -Wtype-limits \
|
||||
--Wmissing-declarations -Wshadow
|
||||
+-Wmissing-declarations -Wshadow \
|
||||
+-pie
|
||||
CXX = @CXX@
|
||||
LIBS = @LIBS@
|
||||
|
47
rpmlint-build-error.patch
Normal file
47
rpmlint-build-error.patch
Normal file
@ -0,0 +1,47 @@
|
||||
Fix rpmlint Errors:
|
||||
1. non-executable-script /usr/lib/ocf/resource.d/linbit/drbd.shellfuncs.sh 644 /bin/bash
|
||||
2. filelist-forbidden-bashcomp-userdirs /etc/bash_completion.d/drbdadm.sh
|
||||
3. dir-or-file-in-run /run/drbd
|
||||
|
||||
diff -Naur drbd-utils-9.19.0.orig/scripts/drbdadm.bash_completion drbd-utils-9.19.0/scripts/drbdadm.bash_completion
|
||||
--- drbd-utils-9.19.0.orig/scripts/drbdadm.bash_completion 2021-10-11 18:44:02.906467704 +0800
|
||||
+++ drbd-utils-9.19.0/scripts/drbdadm.bash_completion 2021-10-11 18:48:24.653422443 +0800
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
-# /etc/bash_completion.d/drbdadm
|
||||
+# /usr/share/bash-completion/completions/drbdadm
|
||||
#
|
||||
# Bash completion for the DRBD top-level management application, drbdadm.
|
||||
#
|
||||
diff -Naur drbd-utils-9.19.0.orig/scripts/Makefile.in drbd-utils-9.19.0/scripts/Makefile.in
|
||||
--- drbd-utils-9.19.0.orig/scripts/Makefile.in 2021-10-11 18:44:02.906467704 +0800
|
||||
+++ drbd-utils-9.19.0/scripts/Makefile.in 2021-10-11 18:51:21.716712860 +0800
|
||||
@@ -147,7 +147,7 @@
|
||||
mkdir -p $(DESTDIR)/usr/lib/ocf/resource.d/linbit
|
||||
install -m 755 drbd.ocf $(DESTDIR)/usr/lib/ocf/resource.d/linbit/drbd
|
||||
install -m 755 drbd-attr $(DESTDIR)/usr/lib/ocf/resource.d/linbit/drbd-attr
|
||||
- install -m 644 drbd.shellfuncs.sh $(DESTDIR)/usr/lib/ocf/resource.d/linbit/
|
||||
+ install -m 755 drbd.shellfuncs.sh $(DESTDIR)/usr/lib/ocf/resource.d/linbit/
|
||||
endif
|
||||
|
||||
install-rgmanager:
|
||||
@@ -173,8 +173,8 @@
|
||||
|
||||
install-bashcompletion:
|
||||
ifeq ($(WITH_BASHCOMPLETION),yes)
|
||||
- mkdir -p $(DESTDIR)$(sysconfdir)/bash_completion.d
|
||||
- install -m 644 drbdadm.bash_completion $(DESTDIR)$(sysconfdir)/bash_completion.d/drbdadm$(BASH_COMPLETION_SUFFIX)
|
||||
+ mkdir -p $(DESTDIR)$(datadir)/bash-completion/completions
|
||||
+ install -m 644 drbdadm.bash_completion $(DESTDIR)$(datadir)/bash-completion/completions/drbdadm
|
||||
endif
|
||||
|
||||
clean:
|
||||
@@ -195,7 +195,7 @@
|
||||
rm -f $(DESTDIR)$(sysconfdir)/ha.d/resource.d/drbddisk
|
||||
rm -f $(DESTDIR)$(sysconfdir)/ha.d/resource.d/drbdupper
|
||||
rm -f $(DESTDIR)$(sysconfdir)/xen/scripts/block-drbd
|
||||
- rm -f $(DESTDIR)$(sysconfdir)/bash_completion.d/drbdadm$(BASH_COMPLETION_SUFFIX)
|
||||
+ rm -f $(DESTDIR)$(datadir)/bash-completion/completions/drbdadm
|
||||
! test -L $(DESTDIR)/sbin/rcdrbd || rm $(DESTDIR)/sbin/rcdrbd
|
||||
|
||||
.PHONY: install uninstall clean distclean
|
68
usrmerge_move_lib_to_prefix_lib.patch
Normal file
68
usrmerge_move_lib_to_prefix_lib.patch
Normal file
@ -0,0 +1,68 @@
|
||||
https://en.opensuse.org/openSUSE:Usr_merge
|
||||
|
||||
diff -Naur drbd-utils-9.19.0.orig/scripts/Makefile.in drbd-utils-9.19.0/scripts/Makefile.in
|
||||
--- drbd-utils-9.19.0.orig/scripts/Makefile.in 2021-10-11 17:59:20.189282860 +0800
|
||||
+++ drbd-utils-9.19.0/scripts/Makefile.in 2021-10-11 18:01:25.988786913 +0800
|
||||
@@ -39,6 +39,7 @@
|
||||
UDEV_RULE_SUFFIX = @UDEV_RULE_SUFFIX@
|
||||
INITDIR = @INITDIR@
|
||||
LIBDIR = @prefix@/lib/@PACKAGE_TARNAME@
|
||||
+LIBSCRIPTDIR = @prefix@/lib/@PACKAGE_TARNAME@/scripts
|
||||
LN_S = @LN_S@
|
||||
|
||||
# features enabled or disabled by configure
|
||||
@@ -87,11 +88,11 @@
|
||||
install -d $(DESTDIR)$(systemdunitdir)
|
||||
install -m 644 drbd.service $(DESTDIR)$(systemdunitdir)/
|
||||
install -m 644 $(SYSTEMD_TEMPLATES) $(DESTDIR)$(systemdunitdir)/
|
||||
- install -d $(DESTDIR)/lib/drbd/scripts
|
||||
- install -m 755 drbd $(DESTDIR)/lib/drbd/scripts
|
||||
- install -m 755 drbd-service-shim.sh $(DESTDIR)/lib/drbd/scripts
|
||||
- install -m 755 drbd-wait-promotable.sh $(DESTDIR)/lib/drbd/scripts
|
||||
- install -m 755 ocf.ra.wrapper.sh $(DESTDIR)/lib/drbd/scripts
|
||||
+ install -d $(DESTDIR)$(LIBSCRIPTDIR)
|
||||
+ install -m 755 drbd $(DESTDIR)$(LIBSCRIPTDIR)
|
||||
+ install -m 755 drbd-service-shim.sh $(DESTDIR)$(LIBSCRIPTDIR)
|
||||
+ install -m 755 drbd-wait-promotable.sh $(DESTDIR)$(LIBSCRIPTDIR)
|
||||
+ install -m 755 ocf.ra.wrapper.sh $(DESTDIR)$(LIBSCRIPTDIR)
|
||||
install -d $(DESTDIR)$(tmpfilesdir)/
|
||||
install -m 444 drbd.tmpfiles.conf $(DESTDIR)$(tmpfilesdir)/drbd.conf
|
||||
endif
|
||||
diff -Naur drbd-utils-9.19.0.orig/user/v83/Makefile.in drbd-utils-9.19.0/user/v83/Makefile.in
|
||||
--- drbd-utils-9.19.0.orig/user/v83/Makefile.in 2021-10-11 17:59:20.217282750 +0800
|
||||
+++ drbd-utils-9.19.0/user/v83/Makefile.in 2021-10-11 18:07:39.967312613 +0800
|
||||
@@ -98,11 +98,11 @@
|
||||
install -d $(DESTDIR)$(localstatedir)/lock
|
||||
install -d $(DESTDIR)/lib/drbd/
|
||||
if getent group haclient > /dev/null 2> /dev/null ; then \
|
||||
- install -g haclient -m 4750 drbdsetup-83 $(DESTDIR)/lib/drbd/ ; \
|
||||
- install -m 755 drbdadm-83 $(DESTDIR)/lib/drbd/ ; \
|
||||
+ install -g haclient -m 4750 drbdsetup-83 $(DESTDIR)$(LIBDIR) ; \
|
||||
+ install -m 755 drbdadm-83 $(DESTDIR)$(LIBDIR) ; \
|
||||
else \
|
||||
- install -m 755 drbdsetup-83 $(DESTDIR)/lib/drbd/ ; \
|
||||
- install -m 755 drbdadm-83 $(DESTDIR)/lib/drbd/ ; \
|
||||
+ install -m 755 drbdsetup-83 $(DESTDIR)$(LIBDIR) ; \
|
||||
+ install -m 755 drbdadm-83 $(DESTDIR)$(LIBDIR) ; \
|
||||
fi
|
||||
endif
|
||||
|
||||
diff -Naur drbd-utils-9.19.0.orig/user/v84/Makefile.in drbd-utils-9.19.0/user/v84/Makefile.in
|
||||
--- drbd-utils-9.19.0.orig/user/v84/Makefile.in 2021-10-11 17:59:20.221282734 +0800
|
||||
+++ drbd-utils-9.19.0/user/v84/Makefile.in 2021-10-11 18:07:39.967312613 +0800
|
||||
@@ -112,11 +112,11 @@
|
||||
install -d $(DESTDIR)$(localstatedir)/lock
|
||||
install -d $(DESTDIR)/lib/drbd/
|
||||
if getent group haclient > /dev/null 2> /dev/null ; then \
|
||||
- install -g haclient -m 4750 drbdsetup-84 $(DESTDIR)/lib/drbd/ ; \
|
||||
- install -m 755 drbdadm-84 $(DESTDIR)/lib/drbd/ ; \
|
||||
+ install -g haclient -m 4750 drbdsetup-84 $(DESTDIR)$(LIBDIR) ; \
|
||||
+ install -m 755 drbdadm-84 $(DESTDIR)$(LIBDIR) ; \
|
||||
else \
|
||||
- install -m 755 drbdsetup-84 $(DESTDIR)/lib/drbd/ ; \
|
||||
- install -m 755 drbdadm-84 $(DESTDIR)/lib/drbd/ ; \
|
||||
+ install -m 755 drbdsetup-84 $(DESTDIR)$(LIBDIR) ; \
|
||||
+ install -m 755 drbdadm-84 $(DESTDIR)$(LIBDIR) ; \
|
||||
fi
|
||||
endif
|
||||
|
Loading…
Reference in New Issue
Block a user