[Sussex] Some "Time" questions

Jon Fautley jfautley at redhat.com
Tue Jan 2 12:35:28 UTC 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John David Thompson wrote:

> In Linux, I open a terminal and run the following commands:-
> su (password)
> ntpdate bear.zoo.bt.co.uk
> exit
> 
> Which works a treat! But...
> 
> Questions.  How can I use a simple script to automate the above so that
> I can simply click an icon on my Linux desktop to set the clock?  Can
> this script be given special permissions so that the root password is
> not required?  Can someone write this script for me - 'cause I'm a thickie!!

Don't do this - it's considered bad :)

You should enable the NTP service - depending on your distribution,
there are various ways to do this. In Fedora, for example (as root):

# yum -y install ntp
[... blah ...]

# chkconfig ntpd on
# service ntpd start

This will setup your system so that it will automatically synchronise
the time at boot, and then use NTP to keep it in sync.

The problem with manually resetting the time is that "ntpdate" will
'jump' the clock to the correct time. This can cause badness to occur,
for example, when your computer thinks its 1am, and it's really 11pm the
day before. The day will 'restart' causing lots of weird things to
happen (ok, probably not too much badness on a home system, but on
corporate systems, i.e. billing systems, very bad things can happen!)

It's a good idea to get out of the habit of 'jumping' the clock ASAP :)

I'm sure others on list can help out with other distributions. For
example, from what I've heard of Ubuntu, I'm sure just looking at your
PC and willing it to setup NTP should be enough ;)

Happy New Year, all!

Jon
- --
Jon Fautley RHCE, RHCX <jfautley at redhat.com>   direct: +44 1483 739615
 Technical Account Manager                     office: +44 1483 300169
 Red Hat UK                                    mobile: +44 7841 558683
 10 Alan Turing Road, Surrey Research Park, Guildford, Surrey, GU2 7YF
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFFmlGEkRG1dDyibUQRAiT8AJ0WJLWM2LON2WAfwvWj8yIY3HQVqwCdEs4K
ifWa7Iykpvq8bqsyGtkl1JQ=
=RFrE
-----END PGP SIGNATURE-----




More information about the Sussex mailing list