Hey guys. I finally figured out how I am going to run my stonitprocess,
it's going to be in a resource that I have created in
/etc/ha.d/resources.d/stonith. This is being called by
/etc/ha.d/haresources. It has a bit of code in there that determines if the
other server started a failover due to a user or it if happened due to a
failure. By default the switch to do the stonith process is on (1), so at
the end of the code, it sets this flag back to 1.
The problem is that the resource is being ran TWICE. So the server that's
failing sets the flag to 0, the process runs, doesn't stonith, and sets the
flag back to 1, then runs again and since the flag is at 1 it does the
stonith process.
Below is some code that demonstrates the logic being applies. Does anyone
know why this would be ran twice? If it didn't run twice this process would
work perfectly :(
- Peter
#!/bin/bash
arg=$1
STONITHCHECK=`cat /etc/ha.d/dostonith`
if [ "$arg" == "start" ]; then
if [ $STONITHCHECK -eq "1" ]; then
echo "STONITH WILL BE PERFORMED" >> /tmp/result;
#insert stonith script here
fi
#check to see if STONITH is supposed to occur
if [ $STONITHCHECK -eq "0" ]; then
echo "STONITH WILL NOT BE PERFORMED" >> /tmp/result;
fi
echo 1 > /etc/ha.d/dostonith;
exit 0;
fi
echo "NO STONITH PROCESS REQUIRED" >> /tmp/result;
exit 0;
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems