MT#5715 use locking before write to fifo

mr3.3.1
Victor Seva 13 years ago
parent c6e3f485e1
commit 36798db53e

@ -0,0 +1,20 @@
--- a/heartbeat/shellfuncs.in
+++ b/heartbeat/shellfuncs.in
@@ -113,10 +113,16 @@
# o Using "cat -" rather than "cat" simply for clarity.
# o The trailing "| cat -" tries to hold things together as a single
# write (which is probably preferable behaviour in this context).
+#
+# use a lockfile to be sure
ha_clustermsg() {
- (echo ">>>"; cat -; echo "<<<") | cat - >> $HA_FIFO
+ (
+ flock -x -w 2 9 || exit 1;
+ (echo ">>>"; cat -; echo "<<<";)| cat - >> $HA_FIFO
+ ) 9>/tmp/clustermsg.lock
}
+
ha_parameter() {
VALUE=`sed -e 's%[ ][ ]*% %' -e 's%^ %%' -e 's%#.*%%' $HA_CF |
grep -i "^$1 " | sed 's%[^ ]* %%'`

@ -15,3 +15,4 @@ IPv6addr-64.patch
o2cb-INITDIR.patch
IPv6addr-background-UA.patch
cherry-pick-upstream-de3074ce2c9718725a374bcd2199ebc.patch
fix_MT5715.patch

Loading…
Cancel
Save