1832777 Members
3200 Online
110045 Solutions
New Discussion

Re: bug in dodisk

 
marc seguin
Regular Advisor

bug in dodisk

I noticed a bug in the script /usr/sbin/acct/dodisk.

If you get a message like :
"Syntax error at line 1 : `(' is not expected"
the error comes from the line :
"# See fstab(4) and sam(1M) for further details on configuring devices."
in /etc/fstab which is not treated well by the awk script in dodisk. (cf. note 1)

You can modify the dodisk script :
replace "if (access(diskusg))" [line 64 on HP 11.11]
by "if (access(diskusg)==1)"

But there is another BIGGER BUG. This script shouldn't look for commented lines but it does it. And, as a result, if you comment out a line in the middle of /etc/fstab, you can't get the diskusage for file systems under this line (cf. note 2).

So, instead of the correction above, it is better to do this one :
After the line
"\$3 !~ /swap/ \" [line 51 on HP 11.11]
you can add :
"&& \$1 !~ /^#/ \"

It can help before HP correct it.
Will HP be inform on the bug through this forum, or should I use another procedure ?

HTH
Marc.
2 REPLIES 2
marc seguin
Regular Advisor

Re: bug in dodisk

Note 1 :

The line :
"# See fstab(4) and sam(1M) for further details on configuring devices."
leads the awk script to test if the command :
"/usr/lbin/fs/fstab(4)/diskusg"
exists, which is not true of course. And it should return a 0 code. But, because of the '(', it returns code 2, which is non null, so the test is OK.
And the script tries to execute it !!!

CQFD
marc seguin
Regular Advisor

Re: bug in dodisk

Note 2 :

If your /etc/fstab looks like :

/dev/vg00/lvol4 /opt vxfs delaylog 0 2
/dev/vg00/lvol5 /tmp vxfs delaylog 0 2
#/dev/vg00/lvol6 /usr vxfs delaylog 0 2
/dev/vg00/lvol7 /var vxfs delaylog 0 2

[it is an exemple, it is not realistic]

So the awk script will try to execute :
/usr/lbin/fs/vxfs/diskusg /dev/vg00/lvol4 /dev/vg00/lvol5 #/dev/vg00/lvol6 /dev/vg00/lvol7
And because of the '#', the end of the line won't be concerned, though it should.

And you'll get disk usage of two file systems instead of three available !!!

CQFD