Don't use tabs in the haresource file!
Alan Robertson
alanr@suse.com
Mon, 24 Jul 2000 11:45:16 -0600
Juri Haberland wrote:
>
> Hi all,
>
> I just discovered the hard way that one shouldn't use tabs in haresource
> file because heartbeat won't start any resource. If blanks are used
> instead of tabs all works fine. This is especially annoying because the
> examples in this file _do_ use tabs!
I always use tabs. Let me go look at the code...
The takeover and giveup stuff is written in the shell. All access to
the haresources file is through the ipres() function. It's sole purpose
in life is to make the file easy for the rest of the code to deal with.
#
# Remove comments and extra blanks from haresources
# translate all white space into single blanks. Each line ends
with
# a blank, making parsing it easier for dumb shell scripts.
#
#
ipres() {
if
[ $# -lt 1 ]
then
arg='.'
else
arg=$1
fi
cat $HA_DIR/haresources |
sed -e 's%#.*%%' -e 's%$% %' -e 's%[ ][ ]*% %'
\
-e 's%^ %%'
|
egrep "$arg"
}
The second -e expression substitutes {blank|tab}{blank|tab}* into a
single blank.
I carefully reread the code, and it looks like it works. Since I wrote
the code and I always use tabs, this isn't too surprising ;-)
Do you still have the haresources file that didn't work for you?
Thanks!
-- Alan Robertson
alanr@suse.com