Don't use tabs in the haresource file!
alanr at suse.com
Tue Jul 25 06:38:54 MDT 2000
Juri Haberland wrote:
> Alan Robertson wrote:
> > 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...
> [code snipped]
> > 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?
> No, but I could reproduce it with the attached file. If I substitute the
> tabs with a blank or if I insert a blank in front of the tab heartbeat
> runs the scripts for IP take-over and the ldirectord script. If I insert
> a blank after the tab it stops working. Actually, it looks like the
> blank or
> blank,tab or
> blank,tab,blank it works
> tab or
> tab,blank does not work
> Seems like there has to be a leading blank...
> PS: I'm not very familiar with sed :-(
I'll walk through the sed expressions here in the mail, to see if I can
see anything wrong. Someone please correct me if I'm mistaken...
sed -e 's%#.*%%' -e 's%$% %' -e 's%[ ][ ]*% %' \
-e 's%^ %%'
The first -e:
Substitute everything after a # into nothing (%%).
This gets rid of comments.
The second -e:
Append a blank to the end of the line
The third -e: 's%[ ][ ]*% %'
Substitute a blank or tab followed by 0 or more blanks
or tabs into a single blank. Asking vi to show control
characters looks like this:
-e 's%[^I ][^I ]*% %' ^I\$
This is the key expression. It replaces all strings
of one or more blanks or tabs with a single blank.
This should eliminate every tab in the file, replacing
them by blanks.
The last -e: 's%^ %%'
Substitute a leading blank into nothing (%%).
So, this is VERY curious, because if there is a leading blank, I get
rid of it, and if there are any tabs, I change them to spaces.
What version of the code are you running?
Could you send me your copy of /usr/lib/heartbeat/ResourceManager
as an attachment?
What version of sed are your running? In my version of SuSE, it's
part of the base package.
Can you send me all four of your logs (2 from each machine) for the case
when it fails?
-- Alan Robertson
alanr at suse.com
More information about the Linux-HA