problem with hostname

Siggy Brentrup ubuntu at psycho.i21k.de
Thu Jul 9 18:52:58 UTC 2009


On Thu, Jul 09, 2009 at 11:50:02AM +0000, pkaplan1 at comcast.net wrote:

[snip]

> So, still, I'm stumped. My hostname is not being read following
> reboot, so I have to manually define it after each boot.

Did you look into /var/log/syslog? Every line starts with
<date> <time> <hostname>
This can give you a clue when your hostname gets lost - but only
after sysklogd is started.

If this doesn't help, try install the following shell script at a
convenient place on your root FS e.g. as /root/check_my_hostname

--- snip ---
#! /bin/sh -e
logfile="/root/myhostname" # /tmp gets cleaned during boot
if [ ! -e $logfile ]; then
  ( cd /etc/rc2.d && ls -l S* ) >$logfile 
  echo ============== >>$logfile
fi
echo $(date -Is) - $(basename $0) - \
 [$(cat /proc/sys/kernel/hostname)] >>$logfile
exit 0
--- snip ---

and give it execute permissions.

In order to run it during system startup place symbolic links
in /etc/rc2.d (assuming init and runlevel 2)

# cd /etc/rc2.d
# ln -s /root/check_my_hostname S00check_my_hostname
... some more Snncheck_my_hostname links at strategic places.
# ln -s /root/check_my_hostname S99check_my_hostname

If you're still stuck, come back with the contents of
/root/myhostname.

HTH
 Siggy
--
Please don't Cc: me when replying to the list. 
    bsb-at-psycho-dot-informationsanarchistik-dot-de
or:                    bsb-at-psycho-dot-i21k-dot-de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20090709/c4ae06c6/attachment.sig>


More information about the ubuntu-users mailing list