hostname lookup ...

Mats Karlsson mats.o.karlsson at gmail.com
Wed Jan 30 14:41:37 UTC 2008


On Jan 30, 2008 3:28 PM, Gerrard Geldenhuis <Gerrard.Geldenhuis at datacash.com>
wrote:

>  Hi
>
> I have written a script but it does not work as expected.
>
> The script is a post script with nochroot.
>
> I tested the dnsdomainname command in the console after my script failed
> and saw that it returns localdomain.
>
> Hostname and uname returns localhost.localdomain.
>
> We want the time servers to be different depending on in which DC the
> server is build…
>
> Can anyone suggest a better method of doing what I am trying to achieve
> here?
>
> The script:
>
> # Kickstart PRE Script
>
> # Set time to ensure SSL RHN Activation can complete successfully
>
> echo "starting time sync"
>
> date
>
> /mnt/sysimage/usr/sbin/ntpdate -b ntp.$(/bin/dnsdomainname)
>
> /mnt/sysimage/sbin/hwclock --systohc
>
> date
>
> echo "time sync complete"
>
>
> #backup old file
>
> cp /mnt/sysimage/etc/ntp.conf /mnt/sysimage/tmp/ntp.conf.old
>
>
>
> #create new config file
>
> cat > /tmp/sysimage/etc/ntp.conf <<'EOF'
>
> # /etc/ntp.conf, configuration for ntpd
>
> # ntpd will use syslog() if logfile is not defined #logfile /var/log/ntpd
>
>
>
> driftfile /var/lib/ntp/ntp.drift
>
> statsdir /var/log/ntpstats/
>
>
>
> statistics loopstats peerstats clockstats filegen loopstats file loopstats
> type day enable filegen peerstats file peerstats type day enable filegen
> clockstats file clockstats type day enable
>
> EOF
>
>
>
> echo "server ntp.$(/mnt/sysimage/bin/dnsdomainname)" >> /tmp/ntp.conf
>
> echo "server ntp2.$(/mnt/sysimage/bin/dnsdomainname)" >> /tmp/ntp.conf
>
>
>
> Regards
>

Have you tried to start the network service ?

service network start

/Mats
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/kickstart-list/attachments/20080130/b3682233/attachment.htm>


More information about the Kickstart-list mailing list