tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* 5.1.b PK4 installation bug/question
@ 2005-11-19 11:38 Örjan Petersson
  0 siblings, 0 replies; only message in thread
From: Örjan Petersson @ 2005-11-19 11:38 UTC (permalink / raw)


Hi,
I have found a small bug in the /usr/sbin/dupatch delivered as part of 5.1.b PK4.
The version is
# @(#)$RCSfile: dupatch.sh,v $ $Revision: 1.1.2.56 $ (DEC) $Date: 2004/06/07 14:40:21 $

and the problem is the following function:

FitsetSetup()
{
	PWD=`pwd`

	DEF_USRRSV=40960
	DEF_ROOTRSV=15360

	DUK=
	HOSTNAME=`/usr/sbin/rcmgr get HOSTNAME`
	[ "$HOSTNAME" ] &&
	{
		HOSTNAME=`Parse . $HOSTNAME | awk '{print $1}'`
		HOSTNAME=`Ucase $HOSTNAME`
		[ -d /usr/sys/$HOSTNAME ] &&
		{
			cd /usr/sys/$HOSTNAME
			DUK=`du -sk . | awk '{print $1}'`
		}
	}
	DUK=`expr $DUK \* 2`
	USRRSV=`FitsetReserve $DEF_USRRSV $DUK`

	DUK=
	[ -f /vmunix ] &&
	{
		cd /
		DUK=`du -sk vmunix | awk '{print $1}'`
	}
	ROOTRSV=`FitsetReserve $DEF_ROOTRSV $DUK`

	cd $PWD

}

Here DUK is first set to "" and it is only if /usr/sys/$HOSTNAME exists that it get
changed to something else. The hostname on the machine I am patching has been changed
and I do not have /usr/sys/$HOSTNAME, only /usr/sys/$THE_OLD_HOSTNAME, so the result
is that the statement
DUK=`expr $DUK \* 2`
fails with a syntax error.

I can fix this problem in various ways, e.g. rename /usr/sys/$THE_OLD_HOSTNAME to
/usr/sys/$HOSTNAME or simply set DUK to something sensible in the script, but I
would like to know if there is any "correct" way of doing this (or if there are
any gotchas). 

-- 
Best regards, 
Örjan Petersson, Logcode SARL, currently with Ericsson Algeria 
24, rue de la Charlière, FR-42270 St-Priest-en-Jarez, France
Phone: +33-4.77.79.65.14, Mobile: +33-6.62.25.37.94
In Algeria: +213-61.699.745, In Sweden: +46-705 135 998






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-11-19 11:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-19 11:38 5.1.b PK4 installation bug/question Örjan Petersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox