Filesystem resource script is busted

Bug #174182 reported by .:. brainsik
14
Affects Status Importance Assigned to Milestone
heartbeat (Ubuntu)
Fix Released
Medium
Luca Falavigna

Bug Description

Binary package hint: heartbeat-2

When upgrading from feisty to gutsy, the new heartbeat fails to start because the Filesystem resource script that comes with it is broken:

ResourceManager[6887]: 2007/12/05_07:03:48 info: Running /etc/ha.d/resource.d/Filesystem /dev/drbd0 /mnt/drbd ext3 noatime,nodev,nosuid,noexec start
ResourceManager[6887]: 2007/12/05_07:03:48 debug: Starting /etc/ha.d/resource.d/Filesystem /dev/drbd0 /mnt/drbd ext3 noatime,nodev,nosuid,noexec start
/usr/lib/ocf/resource.d//heartbeat/Filesystem: 478: Syntax error: Bad substitution
Filesystem[6988]: 2007/12/05_07:03:48 ERROR: Illegal argument
ResourceManager[6887]: 2007/12/05_07:03:48 debug: /etc/ha.d/resource.d/Filesystem /dev/drbd0 /mnt/drbd ext3 noatime,nodev,nosuid,noexec start done. RC=2
ResourceManager[6887]: 2007/12/05_07:03:48 ERROR: Return code 2 from /etc/ha.d/resource.d/Filesystem
ResourceManager[6887]: 2007/12/05_07:03:48 CRIT: Giving up resources due to failure of Filesystem::/dev/drbd0::/mnt/drbd::ext3::noatime,nodev,nosuid,noexec

In otherwords, after upgrade, the heartbeat cluster is broken. Pretty bad.

The relevant line seems to be:

/usr/lib/ocf/resource.d//heartbeat/Filesystem: 478: Syntax error: Bad substitution

Revision history for this message
Vitor Choi Feitosa (vchoi) wrote :

heartbeat-2 is a transitional package.

Changed in heartbeat-2:
status: New → Confirmed
Revision history for this message
Vitor Choi Feitosa (vchoi) wrote :

Confirmed this bug in gutsy, heartbeat package version 2.1.2-1

Attached is a workaround script. Put it in resource.d while this bug isn`t resolved to get your cluster up and running. Be careful because the script only supports 2 parameters (device and mount point).

Revision history for this message
.:. brainsik (brainsik) wrote :

I ended up quickly porting the old Filesystem resource from heartbeat 1 and am using that for now. I'll use that until I see a patch for the OCF script. I'm wary of posting my ported file since it's a bit hackish and is certainly not a solution to the real problem.

Revision history for this message
Rafael Proença (cypherbios) wrote :

Confirmed in gutsy.
This workaround script proposed by Vitor does work.

Revision history for this message
Vitor Choi Feitosa (vchoi) wrote :

Beware that it's not a nice hack... it doesn't check for errors and I wouldn't recommend it for production.

Revision history for this message
Rafael Proença (cypherbios) wrote :

Unfortunately does not seem to solve completely. After some tests I realized that.

When I turn off the primary server the secondary take control and mounts the /dev/drbd0 and everything seems fine, but about 10 seconds later I get this:

/var/log/ha-log:
ResourceManager[4421]: 2008/01/04_15:18:33 info: Running /etc/ha.d/resource.d/filesystem /dev/drbd0 /replicado start
ResourceManager[4421]: 2008/01/04_15:18:33 ERROR: Return code 32 from /etc/ha.d/resource.d/filesystem
ResourceManager[4421]: 2008/01/04_15:18:33 CRIT: Giving up resources due to failure of filesystem::/dev/drbd0::/replicado

And then heartbeat goes down stopping all services/filesystems, and then I got no working server.
I guess it is a problem with the filesystem script that Vitor posted (sorry, I know I am not supposed to rely on this one).
Any ideas of how to get an Filesystem script that works?

Revision history for this message
Rafael Proença (cypherbios) wrote :

OK, got working!

Just add 'exit 0' at the end of Vitor's script and Filesystems is always return OK. I know, it is not a clever solution but it works for now.

Revision history for this message
Buddy (hoffmann-ellumination) wrote :

I was in the linux-ha channel today, and talked with the guys over the bug, and they suggested not to use the above script, but to rather use the file from the current CVS/SVN. Here is what I have recorded.

[12:01] <milestone> nevermind, found https://bugs.launchpad.net/ubuntu/+source/heartbeat-2/+bug/174182
[12:01] [470] #java ##java Forwarding to another channel
[12:01] [Notice] -ChanServ- [##java] Please read the topic for basic channel guidelines. Thanks.
[12:32] <dejanm> milestone: that workaround is dreadful
[12:32] <milestone> dejanm: and what should i do instead? And why is it posted there?
[12:33] <dejanm> milestone: don't know why was it posted, suppose that anybody can post anything
[12:33] <dejanm> milestone: i think that that bug was fixed recently
[12:33] <dejanm> milestone: you can fetch Filesystem from the repository
[12:35] <dejanm> http://hg.linux-ha.org/dev/raw-file/667542dd39f2/resources/OCF/Filesystem
[12:40] <lmb> 2.1.2? They should use 2.1.3 anyway ;-)
[12:40] <dejanm> unfortunately, that bug is present in 2.1.3 too
[12:41] <lmb> build issue?
[12:42] <dejanm> no
[12:42] <dejanm> take a look at: http://hg.linux-ha.org/dev/rev/667542dd39f2
[12:46] <lmb> That's weird, how did that ever work?
[12:46] <dejanm> no idea
[12:47] * lmb 's very convinced it did work, because there's production systems running said code ...
[12:52] <dejanm> milestone: if you have an account over there, can you please ask people not to use that substitute script
[12:53] <lmb> beekhof: Hey, are you still updating the interim releases in OBS?
[12:53] <lmb> I'm thinking about what I should be doing with the daily builds now ...
[12:53] <dejanm> milestone: thx

Revision history for this message
RonanG (ronan-nosafety) wrote :

Solved??
It seems to be a bash/dash issue.

Change #!/bin/sh to #!/bin/bash in Filesystem and all appears well!

Though If anyone can help with Mysql resource scripts I'd like to talk. /etc/ha.d/resource.d/mysql seems to be missing!

Revision history for this message
Attila Darázs (darazs) wrote :

I confirm that it's a bash/dash issue.

It's working after I changed the first line of "/usr/lib/ocf/resource.d/heartbeat/Filesystem" from "#!/bin/sh" to "#!/bin/bash"

Patch attached (for the comfort of the maintainer :).

Revision history for this message
Kris Lowet (krislowet) wrote :

I'm sorry, Zumi, but changing "#!/bin/sh" to "#!/bin/bash" does not work for me.

I'm using:
Ubuntu 7.10 (server edition)
Heartbeat 2 (2.0.2-5)
-- I was mounting a partition from DRBD (8.0.3-2) but it does not work.

Kris

Revision history for this message
Kris Lowet (krislowet) wrote :

Again sorry, Zumi, your solution works well!
My mistake... I had edited a wrong file: /etc/ha.d/resource.d/Filesystem (the same, but in a other direcotry).

Thanks!
Kris

Changed in heartbeat:
assignee: nobody → dktrkranz
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package heartbeat - 2.1.3-6ubuntu1

---------------
heartbeat (2.1.3-6ubuntu1) intrepid; urgency=low

  * debian/patches/more_bashisms.patch:
    - Fix some bashisms (LP: #174182, #230653).
  * debian/control:
    - Update Maintainer field as per spec.

 -- Luca Falavigna <email address hidden> Thu, 19 Jun 2008 22:55:57 +0200

Changed in heartbeat:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.