Filesystem agent requires a bash shell

Bug #248737 reported by Florian Hackenberger
4
Affects Status Importance Assigned to Milestone
heartbeat (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: heartbeat

Description: Ubuntu 8.04
Release: 8.04
heartbeat 2.1.3-2

The following code in the OCF Filesystem (starting with line 724) agent does
not seem to be compatible with a plain /bin/sh (like dash):

case $DEVICE in
"") ocf_log err "Please set OCF_RESKEY_device to the device to be managed"
        exit $OCF_ERR_ARGS
        ;;
-*) # Oh... An option to mount instead... Typically -U or -L
        ;;
[^/]*:/*) # An NFS filesystem specification...
        ;;
//[^/]*/*) # An SMB filesystem specification...
        ;;
/dev/null) # Special case for BSC
        blockdevice=yes
        ;;
*) if [ ! -b "$DEVICE" -a ! -d "$DEVICE" -a "X$OP" != Xstart ] ; then
                ocf_log warn "Couldn't find device [$DEVICE]. Expected /dev/???
to exist"
        fi
        if [ ! -d "$DEVICE" ];then
                blockdevice=yes
        fi
        ;;
esac

The case for nfs does not match if the script is invoked with dash, but it does
if it is run with sh.

Revision history for this message
Horms (horms-verge) wrote :

Hi,

The key seems to be to use ! instead of ^ for negation in character clases.
The resources/OCF/Filesystem portion of the attached patch should resolve this problem.
The other portions are probably also needed by the ubuntu package to solve other
as yet unreproted problems of the same nature.

I have commited this change upstream as
http://hg.linux-ha.org/dev/rev/5aea0e314a77

I intend to include it in version 2.1.3-8 of the Debian package.

Revision history for this message
Florian Hackenberger (f-hackenberger) wrote :

Thank you very much for your efforts, Horms!

Cheers,
    Florian

Revision history for this message
Bhavani Shankar (bhavi) wrote :

heartbeat 2.1.3-8 is available in intrepid repos now.

Regards

Revision history for this message
Bhavani Shankar (bhavi) wrote :

Thanks for your work :)

Changed in heartbeat:
status: New → 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.