SUMMARY: 5.1.b PK4 installation bug/question

From: Örjan Petersson (orjan.petersson@logcode.com)
Date: Sat Nov 19 2005 - 14:15:43 EST


Johan Brusche suggested running 'doconfig -c New-HOSTNAME'.
This certainly fixed the problem (thanks Johan) but I still think there is a bug
in dupatch... Also, the "best practice document "Changing the Host Name Permanently"
does not mention that a kernel rebuild is necessary.

-- 
 Örjan
> From: Brusche, Johan [mailto:johan.brusche@...]
[...]
> 
> The correct solution is to run 'doconfig -c New-HOSTNAME', copy the new kernel in place
> and reboot..  The HOSTNAME is also stored in the kernel. Having another hostname in the
> kernel would also cause problems when logging in on the graphics console, especially DT ToolTalk
> will fail on it.
> 
My original question:
> 
> 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
> 
> 
> 
> 
> 


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:50:26 EDT