Ok, now here i come with the very interesting details:
After a lot of debugging, i found out that in fact the script is correctly called, but at one point in the script it does not seem to work.
At the beginning of /usr/lib/drbd/crm-fence-peer.sh, you see the following lines:
sed_rsc_location_suitable_for_string_compare()
5 {
6 # expected input: exactly one tag per line: "^[[:space:]]*<.*/?>$"
7 sed -ne '
8 # within the rsc_location constraint with that id,
9 /<rsc_location .*\bid="'"$1"'"/, /<\/rsc_location>/ {
10 /<\/rsc_location>/q # done, if closing tag is found
11 s/^[[:space:]]*// # trim spaces
12 s/ *\bid="[^"]*"// # remove id tag
13 # print each attribute on its own line, by
14 : attr
15 h # remember the current (tail of the) line
16 # remove all but the first attribute, and print,
17 s/^\([^[:space:]]*[[:space:]][^= ]*="[^"]*"\).*$/\1/p
18 g # then restore the remembered line,
19 # and remove the first attribute.
20 s/^\([^[:space:]]*\)[[:space:]][^= ]*="[^"]*"\(.*\)$/\1\2/
21 # then repeat, until no more attributes are left
22 t attr
23 }' | sort
24 }
What the script do is the following:
1) get the output of cibadmin -Ql in the variable cib_xml
2) run the output into the given code above, called like this
have_constraint=$(set +x; echo "$cib_xml" |
sed_rsc_location_suitable_for_string_compare "$id_prefix-$master_id")
The result would be some attributes in have_constraint, filtered out and formatted by SED.
Problem is: even if the string in
"$id_prefix-$master_id" is correct, the result set is always empty.
So i have one little question: Does the used SED in BusyBox, that is used in ESOS, behave different that in other distributions?
Maybe different enough to break the functionality here?