Homepage Wiki Forum Buy

NTP Client

From GNUBLIN

Contents

For Beginners

The easier way to set up a NTP client, is to use rdate.


For this purpose you have to accomplish the following steps:

1. apt-get install rdate

2. rdate time.fu-berlin.de

3. export TZ=CET

If you now enter date into your console and hit enter, the right date should be displayed

Unfortunately the TZ variable gets lost after reboot. To prevent this, we statically set the TZ variable to CET:


ln -sf /usr/share/zoneinfo/CET /etc/localtime
reboot


For advanced users

installing a NTP client

Since gnublin doesn't have a hardwareclock, it may be interesting to set the systemtime automatically per NTP while booting. Therefore you need the debian package "ntpdate"

http://ftp.de.debian.org/debian/pool/main/n/ntp/ntpdate_4.2.6.p2+dfsg-1+b1_armel.deb

  • old ELDK

like in "Debian Package installation" you convert the package with "alien -t ntpdate_4.2.6.p2+dfsg-1+b1_armel.deb" in a tar.gz. Then you transfer the file into / on the GNUBLIN and install it with "tar xvzf ntpdate_4.2.6.p2+dfsg-1+b1_armel.deb".

  • Gnublin Distribution

The package can easy be installed with the integrated Debian package manager

dpkg -i ntpdate_4.2.6.p2+dfsg-1+b1_armel.deb


Configuration

"nano /etc/default/ntpdate"

to change the configuration. Edit the following line

NTPDATE_USE_NTP_CONF=yes

to "no". now you can add any server of your choice e.g.

NTPSERVERS="ptbtime1.ptb.de ptbtime2.ptb.de ptbtime3.ptb.de"

now test it with

ntpdate-debian

and the systemtime should be correctly set.

From UTC to CET

Now the clock still displays UTC. To set the clock to CET you must set a link:

ln -sf /usr/share/zoneinfo/CET /etc/localtime

after a reboot, the time should be on CET


Get the time automatically via WLAN after booting

To set the systemtime directly after booting you just extend the "autonet" script:

echo "...ntp Zeit wird abgerufen"
ntpdate-debian
In other languages