Hey Group; Has SuSE been screwing around with the UTC and localtime again. Around SuSE 6 or 7 they had a problem which caused the clock to be set wrong every time you booted up again. If you set it with netdate or something and then shut it down. When you booted back up it was 6 hours off. It is 10:06PM (22:06) here right now. But the KDE clock is showing 19:36. I have since the last setting the time turned this machine off and back on several time. I have forgotten what I did to fix it! Central Standard Timeq ___________________________ netdate now.cis.okstate.edu hwclock --systohc ___________________________ Now KDE shows 22:11 -- 73 de Donn Washburn Hpage: " http://www.hal-pc.org/~n5xwb " Ham Callsign N5XWB Email: " n5xwb@hal-pc.org " 307 Savoy St. " n5xwb@arrl.net " Sugar Land, TX 77478 LL# 1.281.242.3256 " http://counter.li.org " #279316
On Sun, 2005-01-23 at 23:15, Donn Washburn wrote:
Hey Group;
Has SuSE been screwing around with the UTC and localtime again. Around SuSE 6 or 7 they had a problem which caused the clock to be set wrong every time you booted up again. If you set it with netdate or something and then shut it down. When you booted back up it was 6 hours off. It is 10:06PM (22:06) here right now. But the KDE clock is showing 19:36. I have since the last setting the time turned this machine off and back on several time.
I have forgotten what I did to fix it!
Central Standard Timeq ___________________________ netdate now.cis.okstate.edu hwclock --systohc ___________________________
Now KDE shows 22:11
-- 73 de Donn Washburn Hpage: " http://www.hal-pc.org/~n5xwb " Ham Callsign N5XWB Email: " n5xwb@hal-pc.org " 307 Savoy St. " n5xwb@arrl.net " Sugar Land, TX 77478 LL# 1.281.242.3256 " http://counter.li.org " #279316
I always set mine to localtime and use xntpd to keep it straight. Rarely have a problem. US EST -- Ken Schneider UNIX since 1989, linux since 1994, SuSE since 1998 * Only reply to the list please* "The day Microsoft makes something that doesn't suck is probably the day they start making vacuum cleaners." -Ernst Jan Plugge
On Monday 24 January 2005 06:18, Ken Schneider wrote:
I always set mine to localtime and use xntpd to keep it straight. Rarely have a problem. US EST
The right way to have it is this: * Linux only machine: hardware clock UTC + timezone set correctly * Linux and Windows dual boot: hardware clock localtime and timezones set correctly in Linux and Windows, also set Windows to "daylight save time" Tip: to avoid running xntpd all the time on machines that don't need a very precise time synchronization, I have this script: /etc/cron.weekly/synctime ntpdate ntp.pick.a.server.close.to.you hwclock --systohc --utc Make it executable with chmod a+x /etc/cron.weekly/synctime Running xntpd continously takes up a few MB of RAM. IMHO it only makes sense in a few cases (servers).
Silviu Marin-Caea wrote:
Running xntpd continously takes up a few MB of RAM. IMHO it only makes sense in a few cases (servers).
Personally I don't think it matters a lot. An entry-level workstation has at least 256Mb - the 1-2mb that xntpd used hardly upsets anything - especially when xntpd is mostly swapped out anyway. We use xntpd on all systems - not that we have any requirement for ultra-reliable time, it's just convenient. /Per Jessen, Zürich -- http://www.spamchek.ch/freetrial - jetzt für 30 Tage ausprobieren - kostenlos und unverbindlich!
Hi, On Mon, 24 Jan 2005 13:11:55 +0200 Silviu Marin-Caea <.> wrote:
Tip: to avoid running xntpd all the time on machines that don't need a very precise time synchronization, I have this script:
/etc/cron.weekly/synctime
ntpdate ntp.pick.a.server.close.to.you hwclock --systohc --utc
I made my own version of the above idea you kindly provided us. I wrote this, while sitting on a machine having a medium-frequency dial-up and quite rare LAN connection, sowishing to update my time 100% manually:
#!/bin/sh
/etc/init.d/xntpd start date ntpdate xxx hwclock --systohc --utc date /etc/init.d/xntpd stop
(Of course xxx is actually a correct domain-name, where the time-service is constantly running by my provider.) After attempting to run the script, I usually get this error-message I couldn't decypher: khazad-dum:/home/oscar # synctime Starting network time protocol daemon (NTPD) done Tue Jan 25 09:29:38 CET 2005 25 Jan 09:29:39 ntpdate[6373]: the NTP socket is in use, exiting Tue Jan 25 09:29:41 CET 2005 Shutting network time protocol daemon (NTPD) done khazad-dum:/home/oscar Do you have an idea, what do these few lines exactly mean, and how to avoid this kind of error? Thanks is advance, Pelibali
* pelibali <pelibali@freemail.hu> [01-25-05 04:23]:
#!/bin/sh
/etc/init.d/xntpd start date ntpdate xxx hwclock --systohc --utc date /etc/init.d/xntpd stop
(Of course xxx is actually a correct domain-name, where the time-service is constantly running by my provider.) After attempting to run the script, I usually get this error-message I couldn't decypher:
khazad-dum:/home/oscar # synctime Starting network time protocol daemon (NTPD) done Tue Jan 25 09:29:38 CET 2005 25 Jan 09:29:39 ntpdate[6373]: the NTP socket is in use, exiting Tue Jan 25 09:29:41 CET 2005 Shutting network time protocol daemon (NTPD) done khazad-dum:/home/oscar
Do you have an idea, what do these few lines exactly mean, and how to avoid this kind of error?
xntpd is using the socket, therefore ntpdate cannot. You may run one or the other, but not both at the same time. AIUI, you do not want to run both anyway. xntpd keeps variation from correct time and system and tries to maintain correct time even when the signal is not available. ntpdate is like setting your watch manually while looking at the clock on the wall, then, when you think that the variation is too much, setting it again. -- Patrick Shanahan Registered Linux User #207535 http://wahoo.no-ip.org @ http://counter.li.org HOG # US1244711 Photo Album: http://wahoo.no-ip.org/photos
On Tue, 25 Jan 2005 06:08:25 -0500 Patrick Shanahan <.> wrote: ...
AIUI, you do not want to run both anyway. xntpd keeps variation from correct time and system and tries to maintain correct time even when the signal is not available. ntpdate is like setting your watch manually while looking at the clock on the wall, then, when you think that the variation is too much, setting it again.
Thanks Patrick; that was the hint solving my problems:) Concerning the same topic I still would have a (for me) too advanced question: how to automatize that? I mean half-automatically, when I'm online through my dial-up (I use Kinternet to connect); or I ride our LAN, how to setup the script you corrected to run_once_ after the connection was made, or the net-cable was attached?! Thanks in advance, Pelibali
* pelibali <pelibali@freemail.hu> [01-25-05 15:35]:
Concerning the same topic I still would have a (for me) too advanced question: how to automatize that? I mean half-automatically, when I'm online through my dial-up (I use Kinternet to connect); or I ride our LAN, how to setup the script you corrected to run_once_ after the connection was made, or the net-cable was attached?!
here is a perl script written for isdn, but dialup works the same: edited /etc/ppp/ip-up.local to #!/usr/bin/perl $max_diff = 86400; $touchfile = "/tmp/ntp-update"; $t_diff = $max_diff; $now = time; if( -e $touchfile ){ my @fileinfo = stat $touchfile; $t_diff = $now - $fileinfo[9]; } if( $t_diff ge $max_diff ){ system( "/usr/sbin/ntpdate ntp.fully.qualified.domain.name" ); system( "touch $touchfile" ); } this will correct the time once a day when connecting. disclaimer: I did not write the script, do not know perl. Someone else more knowledgable may offer a better solution. another that updated the clock every time I got online when I was on dial-up #!/bin/bash sleep 15 until host <your isp name>; do # check for connect & sleep 3 # wait until confirm done sudo /usr/sbin/ntpdate <ntp.server> fetchmail -d 600 exit -- Patrick Shanahan Registered Linux User #207535 http://wahoo.no-ip.org @ http://counter.li.org HOG # US1244711 Photo Album: http://wahoo.no-ip.org/photos
On Tue, 25 Jan 2005 16:47:17 -0500 Patrick Shanahan <.> wrote: ...
disclaimer: I did not write the script, do not know perl. Someone else more knowledgable may offer a better solution. ...
Hi Patrick, Thanks for your answer again! I will look at the code you have sent me carefully; most likely this weekend... Actually PERL is good friend of mine. Pelibali
The Wednesday 2005-01-26 at 10:08 +0100, pelibali wrote:
Hi Patrick,
Thanks for your answer again! I will look at the code you have sent me carefully; most likely this weekend... Actually PERL is good friend of mine.
I'll send you mine as well - this one in bash ;-) SERVICE_NAME=ip-up.local VOLUMEN=--volume=0.7 # Esta bandera se usará en los script de conexion para sincronizar el # reloj por lo menos una vez despues de arrancar. # Se borra en '/etc/init.d/boot.local', y en éste guion se creará. FLAG_BOOTED_PPP=/etc/ppp/SYSTEM_WAS_SYNCRONIZED function SincronizarTiempo_UnaVez() { # Sincronizar la hora solo si es la primera vez que conectamos despues de arancar. # Tambien interesaria hacerlo si ya han pasado, pe, 4 horas desde la ultima sincronizacion. if ! test -f $FLAG_BOOTED_PPP ; then /bin/logger -t $SERVICE_NAME -p user.info " --> Synchronizing time" /usr/bin/play $VOLUMEN /usr/share/sounds/wav/clock.wav &> /dev/null & /etc/init.d/xntpd ntptimeset &> $FLAG_BOOTED_PPP . /etc/sysconfig/clock /sbin/hwclock --systohc $HWCLOCK /bin/logger -t $SERVICE_NAME -p user.info -f $FLAG_BOOTED_PPP fi } .... SincronizarTiempo_UnaVez & And then, in /etc/init.d/boot.local I have: FLAG_BOOTED_PPP=/etc/ppp/SYSTEM_WAS_SYNCRONIZED # Esta bandera se usará en los script de conexion para sincronizar el # reloj por lo menos una vez despues de arrancar. # En este guion se borra, y luego se creará. if test -f $FLAG_BOOTED_PPP ; then rm $FLAG_BOOTED_PPP fi The effect is that it only synchronizes the first time I connect after booting. I still have to add a modification to resync after so many hours after last time. But I feel lazy ;-) -- Cheers, Carlos Robinson
On Wed, 26 Jan 2005 20:13:02 +0100 (CET) "Carlos E. R." <.> wrote:
The Wednesday 2005-01-26 at 10:08 +0100, pelibali wrote:
Hi Patrick,
Thanks for your answer again! I will look at the code you have sent me carefully; most likely this weekend... Actually PERL is good friend of mine.
I'll send you mine as well - this one in bash ;-)
Hi Carlos, Was nice to see your alternative solution; thanks for taking your time, and posting :) The only thing "disturbed" me a little was, that being extreme green to this topic: I would really appreciate English comments in the script, in case I get stuck while I will checkup your code deeper during the weekend, or would like to 'learn'... I had 5 years of Spanish at the elementary school, but it was really long time ago together with Russian; then the Latin-German-English combo erased most it:( Additional question would be still, that which SUSE version you have the attached time-sync code running?! Thanks anyway, Pelibali
The Thursday 2005-01-27 at 21:09 +0100, pelibali wrote:
Was nice to see your alternative solution; thanks for taking your time, and posting :)
Welcome :-)
The only thing "disturbed" me a little was, that being extreme green to this topic: I would really appreciate English comments in the script, in case I get stuck while I will checkup your code deeper during the weekend, or would like to 'learn'... I had 5 years of Spanish at the elementary school, but it was really long time ago together with Russian; then the Latin-German-English combo erased most it:(
X'-) I just copy-pasted my script, but the relevant explanation was below. In fact, it is only part of it, I do a few things more. Ok, I'll translate the rest, but it is not really needed. # Esta bandera se usará en los script de conexion para sincronizar el # reloj por lo menos una vez despues de arrancar. # Se borra en '/etc/init.d/boot.local', y en éste guion se creará. This flag will be used in the connection scripts to synchronize the clock at least once after booting. It will be deleted in '/etc/init.d/boot.local' and created in this script. # Sincronizar la hora solo si es la primera vez que conectamos despues de arancar. # Tambien interesaria hacerlo si ya han pasado, pe, 4 horas desde la ultima sincronizacion. Synchronize time only if it is the first time we connect after booting up. It would be interesting do it again if it is, say, four hours after the last synchronization. # Esta bandera se usará en los script de conexion para sincronizar el # reloj por lo menos una vez despues de arrancar. # En este guion se borra, y luego se creará. This flag will be used in the connection scripts to synchronize the clock at least once after booting. It will be deleted in this script and created later on. Ok? ;-) Ah... there are many manual pages in Linux only available in English. Some programs do not even allow translation. Internationalization in Linux seems to be low key. Pity.
Additional question would be still, that which SUSE version you have the attached time-sync code running?!
Any. I have it running on a 7.3, and later. The difference there is that the '/etc/init.d/xntpd ntptimeset' call has to be substituted with a direct call to '/usr/sbin/ntpdate' instead. The advantage of calling suse's script '/etc/init.d/xntpd' is that it uses the configuration file '/etc/ntp.conf', instead of giving the list of servers manually; then, if you choose to run the daemon instead, you don't need to change configurations. Another setting to know about is in '/etc/sysconfig/xntp': #XNTPD_INITIAL_NTPDATE="AUTO-2" XNTPD_INITIAL_NTPDATE="AUTO" With the default setting, only the first two servers will be polled. I prefer using all. Ah, I almost forgot. My script "plays" a cute clock tick-tack sound while syncing. The sound files come from an older SuSE distro, perhaps 6.4. Choose any sound file of your liking, or just comment out the line. As the script runs in the background, automatically, I like to know what it is doing O:-) -- Cheers, Carlos Robinson
# rpmbuild -bb vlc.spec ------------------------------------------------------------------------------- ../lib/libvlc_pic.a -shared \ `top_builddir=".." ../vlc-config --libs vlc mozilla builtin pic` /usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../../i586-suse-linux/bin/ld: cannot find -lxpcom collect2: ld returned 1 exit status make[3]: *** [libvlcplugin.so] Error 1 make[3]: Leaving directory `/usr/src/packages/BUILD/vlc-0.8.1/mozilla' make[2]: *** [all] Error 2 make[2]: Leaving directory `/usr/src/packages/BUILD/vlc-0.8.1/mozilla' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/src/packages/BUILD/vlc-0.8.1' make: *** [all] Error 2 error: Bad exit status from /var/tmp/rpm-tmp.8388 (%build) ------------------------------------------------------------------------------- Cannot find xpcom library?? But I have it under /opt/mozilla/include/xpcom/ Any ideas? Do I need to set any environment lib dirs? -- Bojan Hribernik http://hribb.homelinux.com/
Hi Patrick, On Tue, 25 Jan 2005 16:47:17 -0500 Patrick Shanahan <.> wrote:
* pelibali <.> [01-25-05 15:35]:
Concerning the same topic I still would have a (for me) too advanced question: how to automatize that? I mean half-automatically, when I'm online through my dial-up (I use Kinternet to connect); or I ride our LAN, how to setup the script you corrected to run_once_ after the connection was made, or the net-cable was attached?!
here is a perl script written for isdn, but dialup works the same:
edited /etc/ppp/ip-up.local to ... if( $t_diff ge $max_diff ){ ...
this will correct the time once a day when connecting.
During the weekend I had time to evaluate your code more carefully, and I'm extremely sorry, but have to send now even a bugfix for it:( You emphasized, that you don't know PERL too much; but I have to correct this for the archive, and for the sake of newbies (similar to me), who like just copy&paste... While running the first script, I realized, that the program _always_ updates the time, and not only once per 24 hours! Checking the code again and again, I found, that in the line I quoted now the usage of 'ge' is not correct. It should be rather '>=', because we compare numbers with PERL, where it really does matter. Thanks again for taking your time, and sending me answers/scripts; and please don't take the above to seriously. -- Best regards, Pelibali
Donn Washburn wrote:
Hey Group;
Has SuSE been screwing around with the UTC and localtime again. Around SuSE 6 or 7 they had a problem which caused the clock to be set wrong every time you booted up again. If you set it with netdate or something and then shut it down. When you booted back up it was 6 hours off. It is 10:06PM (22:06) here right now. But the KDE clock is showing 19:36. I have since the last setting the time turned this machine off and back on several time.
I have all systems running UTC, local is CET, works just fine. /Per Jessen, Zürich -- http://www.spamchek.com/freetrial - sign up for your free 30-day trial now!
Hi, On Monday 24 January 2005 05:15, Donn Washburn wrote:
Has SuSE been screwing around with the UTC and localtime again. Around SuSE 6 or 7 they had a problem which caused the clock to be set wrong every time you booted up again. If you set it with netdate or something and then shut it down. When you booted back up it was 6 hours off. It is 10:06PM (22:06) here right now. But the KDE clock is showing 19:36. I have since the last setting the time turned this machine off and back on several time.
Do you dual-boot with Windows on the same machine? If so, don't set Linux to use UTC but localtime (at least I have never seen an option in Windows that would have allowed me to leave the hardware clock at UTC). If it's a Linux only machine, than UTC should work fine. Greetings from Stuhr hartmut
The Sunday 2005-01-23 at 22:15 -0600, Donn Washburn wrote:
Has SuSE been screwing around with the UTC and localtime again. Around SuSE 6 or 7 they had a problem which caused the clock to be set wrong every time you booted up again.
delete /etc/adjtime Explanation: http://susefaq.sourceforge.net/howto/time.html and several times on this list. -- Cheers, Carlos Robinson
Carlos E. R. wrote:
The Sunday 2005-01-23 at 22:15 -0600, Donn Washburn wrote:
Has SuSE been screwing around with the UTC and localtime again. Around SuSE 6 or 7 they had a problem which caused the clock to be set wrong every time you booted up again.
delete /etc/adjtime
Explanation: http://susefaq.sourceforge.net/howto/time.html
and several times on this list.
Tried your suggestion "cp /dev/null /etc/adjtime" I then ran my time setting script. So, we shall see if that fixes it. Which will come Tuesday about 5PM. -- 73 de Donn Washburn Hpage: " http://www.hal-pc.org/~n5xwb " Ham Callsign N5XWB Email: " n5xwb@hal-pc.org " 307 Savoy St. " n5xwb@arrl.net " Sugar Land, TX 77478 LL# 1.281.242.3256 " http://counter.li.org " #279316
The Monday 2005-01-24 at 21:46 -0600, Donn Washburn wrote:
delete /etc/adjtime
Explanation: http://susefaq.sourceforge.net/howto/time.html
and several times on this list.
Tried your suggestion "cp /dev/null /etc/adjtime" I then ran my time setting script. So, we shall see if that fixes it. Which will come Tuesday about 5PM.
I said "delete", not that. But have a look at that link for the longer answer - I wrote it, it just saves me time to point you to it instead of writing it again O:-) As a matter of fact... you have to delete that file _after_ running your time setting script or commands. -- Cheers, Carlos Robinson
participants (10)
-
Bojan Hribernik
-
Carl E. Hartung
-
Carlos E. R.
-
Donn Washburn
-
Hartmut Meyer
-
Ken Schneider
-
Patrick Shanahan
-
pelibali
-
Per Jessen
-
Silviu Marin-Caea