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
_______________________________________________ Kickstart-list mailing list Kickstart-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/kickstart-list