[Linux-HA] Re: LSB Compliant Filesystem Script

Lasantha Marian x72m35 at gmail.com
Tue Sep 18 09:57:50 MDT 2007


Andrew,

It ("/bin/sh") is linked to "/bin/dash". This is how it comes in Ubuntu
(by deduction that I have not changed anything in shell choices).

I removed the "/bin/sh" and it still generated the same error.

Next I replaced the line in Filesystem (not the wrapper) script with
"/bin/bash", it works like a charm with attached results. Now what got
to be changed ? Can the "Filesystem" script be adapted to tackle such
situations while keeping original compatibilities with other
distributions. It is over to you. :-)

Thanks a lot for helping on this issue.

Lasantha.

Case 1
$ /etc/ha.d/resource.d/Filesystem /dev/drbd0 /ha/www ext3 defaults status
+ . /usr/lib/heartbeat/ocf-shellfuncs
++ HA_D=/etc/ha.d
+++ basename /usr/lib/ocf/resource.d/heartbeat/Filesystem
++ __SCRIPT_NAME=Filesystem
++ . /etc/ha.d/shellfuncs
+++ prefix=/usr
+++ exec_prefix=/usr
+++ : /etc/ha.d
+++ : /etc/ha.d/rc.d
+++ : /etc/ha.d/conf
+++ : /etc/ha.d/ha.cf
+++ : /var/lib/heartbeat
+++ : /var/run/heartbeat/rsctmp
+++ : /var/lib/heartbeat/fifo
+++ : /usr/lib/heartbeat
+++ : %Y/%m/%d_%T
+++ : /dev/null
+++ : /etc/ha.d/resource.d
+++ : /usr/share/doc/heartbeat
+++ : Filesystem
+++ : 'Filesystem[5149]'
+++ : /var/run/
+++ : /var/lock/subsys/
+++ export HA_DIR HA_RCDIR HA_FIFO HA_BIN
+++ export HA_DEBUGLOG HA_LOGFILE HA_LOGFACILITY
+++ export HA_DATEFMT HA_RESOURCEDIR HA_DOCDIR
+++ MKTEMP=/bin/mktemp
+++ TESTPROG=/usr/bin/test
++ __ocf_set_defaults status
++ __OCF_ACTION=status
++ unset LANG
++ LC_ALL=C
++ export LC_ALL
++ OCF_SUCCESS=0
++ OCF_ERR_GENERIC=1
++ OCF_ERR_ARGS=2
++ OCF_ERR_UNIMPLEMENTED=3
++ OCF_ERR_PERM=4
++ OCF_ERR_INSTALLED=5
++ OCF_ERR_CONFIGURED=6
++ OCF_NOT_RUNNING=7
++ OCF_RUNNING_MASTER=8
++ OCF_FAILED_MASTER=9
++ '[' -z '' ']'
++ : 0
++ '[' -z /usr/lib/ocf ']'
++ '[' '!' -d /usr/lib/ocf ']'
++ '[' -z Filesystem ']'
++ '[' -z 1 ']'
++ '[' x1 '!=' x1 ']'
++ '[' -z 0 ']'
++ '[' xstatus = xmeta-data ']'
++ '[' -z Filesystem_/dev/drbd0 ']'
+ MODPROBE=/sbin/modprobe
+ FSCK=/sbin/fsck
+ FUSER=/bin/fuser
+ MOUNT=/bin/mount
+ UMOUNT=/bin/umount
+ BLOCKDEV=/sbin/blockdev
+ '[' 1 -ne 1 ']'
+ DEVICE=/dev/drbd0
+ FSTYPE=ext3
+ '[' '!' -z defaults ']'
+ options='-o defaults'
+ OP=status
+ case $OP in
+ blockdevice=no
+ case $DEVICE in
+ '[' '!' -b /dev/drbd0 -a Xstatus '!=' Xstart ']'
+ blockdevice=yes
+ case $FSTYPE in
+ '[' -n '' ']'
+ '[' -z /ha/www ']'
++ echo /ha/www
++ sed 's/\/*$//'
+ MOUNTPOINT=/ha/www
+ : /ha/www
+ check_util /sbin/modprobe
+ '[' '!' -x /sbin/modprobe ']'
+ check_util /sbin/fsck
+ '[' '!' -x /sbin/fsck ']'
+ check_util /bin/fuser
+ '[' '!' -x /bin/fuser ']'
+ check_util /bin/mount
+ '[' '!' -x /bin/mount ']'
+ check_util /bin/umount
+ '[' '!' -x /bin/umount ']'
+ '[' status '!=' monitor ']'
+ ocf_log info 'Running status for /dev/drbd0 on /ha/www'
+ '[' 2 -lt 2 ']'
+ __OCF_PRIO=info
+ shift
+ __OCF_MSG='Running status for /dev/drbd0 on /ha/www'
+ case "${__OCF_PRIO}" in
+ __OCF_PRIO=INFO
+ ha_log 'INFO: Running status for /dev/drbd0 on /ha/www'
+ '[' x = xyes ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
++ hadate
++ date '+%Y/%m/%d_%T '
+ Echo 2007/09/18_20:59:26 'INFO: Running status for /dev/drbd0 on /ha/www'
+ echo 2007/09/18_20:59:26 'INFO: Running status for /dev/drbd0 on /ha/www'
2007/09/18_20:59:26 INFO: Running status for /dev/drbd0 on /ha/www
+ '[' -n /dev/null ']'
+ : appending to /dev/null
++ hadate
++ date '+%Y/%m/%d_%T '
+ Echo 'Filesystem[5149]:       2007/09/18_20:59:26' 'INFO: Running
status for /dev/drbd0 on /ha/www'
+ echo 'Filesystem[5149]:       2007/09/18_20:59:26' 'INFO: Running
status for /dev/drbd0 on /ha/www'
+ case $OP in
+ Filesystem_status
+ list_mounts
+ '[' -f /proc/mounts -a -r /proc/mounts ']'
+ cut '-d ' -f1,2,3
+ grep -q ' /ha/www '
+ rc=7
+ msg='/ha/www is unmounted (stopped)'
+ case "$OP" in
+ ocf_log info '/ha/www is unmounted (stopped)'
+ '[' 2 -lt 2 ']'
+ __OCF_PRIO=info
+ shift
+ __OCF_MSG='/ha/www is unmounted (stopped)'
+ case "${__OCF_PRIO}" in
+ __OCF_PRIO=INFO
+ ha_log 'INFO: /ha/www is unmounted (stopped)'
+ '[' x = xyes ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
++ hadate
++ date '+%Y/%m/%d_%T '
+ Echo 2007/09/18_20:59:26 'INFO: /ha/www is unmounted (stopped)'
+ echo 2007/09/18_20:59:26 'INFO: /ha/www is unmounted (stopped)'
2007/09/18_20:59:26 INFO: /ha/www is unmounted (stopped)
+ '[' -n /dev/null ']'
+ : appending to /dev/null
++ hadate
++ date '+%Y/%m/%d_%T '
+ Echo 'Filesystem[5149]:       2007/09/18_20:59:26' 'INFO: /ha/www is
unmounted (stopped)'
+ echo 'Filesystem[5149]:       2007/09/18_20:59:26' 'INFO: /ha/www is
unmounted (stopped)'
+ return 7
+ exit 7
2007/09/18_20:59:26 INFO: Filesystem Resource is stopped
INFO: Filesystem Resource is stopped

Case 2
$ /usr/lib/ocf/resource.d/heartbeat/Filesystem
+ . /usr/lib/heartbeat/ocf-shellfuncs
++ HA_D=/etc/ha.d
+++ basename /usr/lib/ocf/resource.d/heartbeat/Filesystem
++ __SCRIPT_NAME=Filesystem
++ . /etc/ha.d/shellfuncs
+++ prefix=/usr
+++ exec_prefix=/usr
+++ : /etc/ha.d
+++ : /etc/ha.d/rc.d
+++ : /etc/ha.d/conf
+++ : /etc/ha.d/ha.cf
+++ : /var/lib/heartbeat
+++ : /var/run/heartbeat/rsctmp
+++ : /var/lib/heartbeat/fifo
+++ : /usr/lib/heartbeat
+++ : '%Y/%m/%d_%T '
+++ : /dev/null
+++ : /etc/ha.d/resource.d
+++ : /usr/share/doc/heartbeat
+++ : Filesystem
+++ : 'Filesystem[6426]'
+++ : /var/run/
+++ : /var/lock/subsys/
+++ export HA_DIR HA_RCDIR HA_FIFO HA_BIN
+++ export HA_DEBUGLOG HA_LOGFILE HA_LOGFACILITY
+++ export HA_DATEFMT HA_RESOURCEDIR HA_DOCDIR
+++ MKTEMP=/bin/mktemp
+++ TESTPROG=/usr/bin/test
++ __ocf_set_defaults
++ __OCF_ACTION=
++ unset LANG
++ LC_ALL=C
++ export LC_ALL
++ OCF_SUCCESS=0
++ OCF_ERR_GENERIC=1
++ OCF_ERR_ARGS=2
++ OCF_ERR_UNIMPLEMENTED=3
++ OCF_ERR_PERM=4
++ OCF_ERR_INSTALLED=5
++ OCF_ERR_CONFIGURED=6
++ OCF_NOT_RUNNING=7
++ OCF_RUNNING_MASTER=8
++ OCF_FAILED_MASTER=9
++ '[' -z '' ']'
++ : 0
++ '[' -z '' ']'
++ : /usr/lib/ocf
++ '[' '!' -d /usr/lib/ocf ']'
++ '[' -z '' ']'
++ : Filesystem
++ '[' -z '' ']'
++ : We are being invoked as an init script.
++ : Fill in some things with reasonable values.
++ : default
++ return 0
+ MODPROBE=/sbin/modprobe
+ FSCK=/sbin/fsck
+ FUSER=/bin/fuser
+ MOUNT=/bin/mount
+ UMOUNT=/bin/umount
+ BLOCKDEV=/sbin/blockdev
+ '[' 0 -ne 1 ']'
+ usage
+ cat
usage: /usr/lib/ocf/resource.d/heartbeat/Filesystem
{start|stop|status|monitor|validate-all|meta-data}
: Filesystem.in,v 1.31 2006/06/22 18:13:53 lars Exp $
+ exit 2

*-------- Original Message --------*
*Subject: * 	[Linux-HA] Re: LSB Compliant Filesystem Script
*Date: * 	Tue, 18/Sep/2007 8:38:39 PM +0550
*From: * 	"Andrew Beekhof" <beekhof at gmail.com>
*To: * 	"General Linux-HA mailing list" <linux-ha at lists.linux-ha.org>


> On 9/18/07, Lasantha Marian <x72m35 at gmail.com> wrote:
>   
>> Andrew,
>>
>> Anything new on the trail of this matter that you were pursuing yesterday ?
>>     
>
> nothing yet... though that line looks suspiciously bash-like... what
> does /bin/sh link to on your system?
>
> does removing just that line help?
> _______________________________________________
> Linux-HA mailing list
> Linux-HA at lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems
>
>   



More information about the Linux-HA mailing list