Skip to content

Conversation

@jirib
Copy link
Contributor

@jirib jirib commented Jul 15, 2025

What about this? To collect config files for defined resources? (I recently had a supportconfig with for Raid1 and the config was missing..., so I've thought it might be good idea to try to collect that...)

...
+ mapfile -t CANDIDATES
++ find /usr/lib/ocf/resource.d/ /usr/lib64/stonith/plugins/external/ -type f -regextype egrep -regex '.*/(Filesystem|LVM-activate|Raid1|controld|external\/sbd|lvmlockd)$' -exec bash -c 'awk_query_reskey_configs "$@"' '{}' +
+ [[ -n Raid1 raidconf  ]]
+ for i in "${CANDIDATES[@]}"
+ read -r ra conf default
+ mapfile -t RA_CUSTOM_CONFIGS
++ xmllint --xpath '//primitive[@type="Raid1"]' /var/lib/pacemaker/cib/cib.xml
++ xmllint --nowarning --html --xpath '//nvpair[@name="raidconf"]/@value' -
++ sed -E 's/ value="([^"]*)"/\1\n/g'
++ sed '/^\s*$/d'
++ sort -u
+ [[ -n /etc/mdadm.cluster.conf ]]
+ RA_CUSTOM_CONFIG_FILES=()
+ for f in "${RA_CUSTOM_CONFIGS[@]}"
+ [[ -f /etc/mdadm.cluster.conf ]]
+ RA_CUSTOM_CONFIG_FILES+=("$f")
+ conf_files ha.txt /etc/mdadm.cluster.conf
...

Let me know what you think about it, thx.

if [[ -n "${CANDIDATES[*]}" ]]; then
for i in "${CANDIDATES[@]}"; do
read -r ra conf default <<< "${i}"
# explicit
Copy link
Contributor Author

@jirib jirib Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here should be probably a test it is not null...

@g23guy g23guy requested a review from Thr3d September 19, 2025 12:43
@Thr3d
Copy link
Collaborator

Thr3d commented Sep 23, 2025

In the current state, this does not work and causes the supportconfig to hang.

@jirib
Copy link
Contributor Author

jirib commented Sep 26, 2025

In the current state, this does not work and causes the supportconfig to hang.

This is a bit vague, could you be more specific, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants