El 02.09.29 a las 20:15, Michael D. Schleif escribió:
Date: Sun, 29 Sep 2002 20:15:17 -0500 From: Michael D. Schleif
Cc: suse-linux-e List Subject: Re: [SLE] set system time ??? I imagine we're saying the same thing.
cmos is set to utc.
I went into yast/yast2 and changed the configuration to match.
When I exited out of yast/yast2 the system clock is still set to utc. No matter what I changed in yast/yast2, *NO* change is exhibited in the system. Yet, my changes persist in yast/yast2 when I reenter yast/yast2.
Did you remember to close the sesion and login again? For a change in locale you need that. I think you might even need a reboot, if the hwclock is changed, but I'm not sure.
What does work, as I stated in my original post, is the cli hwclock invocation.
Yes, the two (2) date commands work correctly, as you suggest.
You mean that "date" gives the correct local time. Then, what is wrong? Sorry, I don't understand. Sure, the internal clock keeps the time in UTC, but programs will get the correct local time when they ask for it. That is the recomended way, but you may set everything to the local time (hw clock included), if you like.
What is the SuSE way to make this change persist?
In my system, the change persist. I'll try right away. [...] Ok, I changed my local time to "Australia/Melbourne", and it is reflecting at once on all my consoles, even without relogin again. I'm using suse 7.3. cer@nimrodel:~> date Tue Oct 1 04:34:22 EST 2002 cer@nimrodel:~> date -u Mon Sep 30 18:36:15 UTC 2002 cer@nimrodel:~> Of course, the litle clock applet in gnome says it is half past eight, it will not change till I close the sesion. I think I recollect that kde showed the wrong time in my system. Is that what you mean?
On other *NIX'es, there exist init files that make that hwclock invocation, so each time the system boots, cmos and system clocks are synced.
I cannot find any such init script on SuSE.
What am I missing?
It is there, I found it greping with mc on the appropiate dirs O:-) I think the adjustment is in the /etc/localtime file, which is copied from somefile in the /usr/share/zoneinfo/ directory. The time is adjusted during init in /etc/init.d/boot: # set and adjust the CMOS clock if test "$HWCLOCK_ACCESS" = "no" ; then echo -n Setting up the system clock # On s390 the hwclock is set outside Linux currently. The kernel # always assumes it to be set to UTC. So if it is set to local # time, we have to compensate for that. We might achieve this # using this special settimeofday(2) linux feature: # Under Linux there is some peculiar `warp clock' semantics # associated to the settimeofday system call if on the very # first call (after booting) that has a non-NULL tz argu- # ment, the tv argument is NULL and the tz_minuteswest field # is nonzero. In such a case it is assumed that the CMOS # clock is on local time, and that it has to be incremented # by this amount to get UTC system time. No doubt it is a # bad idea to use this feature. (settimeofday(2) man page) # But unless someone complains we simply will use date(1) to shift # the system time by the difference between UTC and local time, if # the system clock is set to local time. This will introduce a # minimal shift due to the delay between gettimeofday and # settimeofday, and it only works as long as $0 is executed # exactly once, at boot. if test "$GMT" = ""; then date $(date -u +'%m%d%H%M%Y') rc_status fi rc_status -v -r else echo -n Setting up the CMOS clock test -f /etc/adjtime || echo "0.0 0 0.0" > /etc/adjtime if test "$GMT" != "YAST_ASK" ; then /sbin/hwclock_wrapper --adjust $GMT rc_status /sbin/hwclock_wrapper --hctosys $GMT rc_status fi rc_status -v -r fi And then, the script "halt" may copy it back from system to CMOS if test "$HWCLOCK_ACCESS" != "no" ; then echo -n "Set Hardware Clock to the current System Time:" if test "$GMT" != "YAST_ASK" -a "$START_XNTPD" = "yes" -a -n "$XNTPD_INITIAL_NTPDATE" ; then # write back to hardware clock and calculate adjtime /sbin/hwclock_wrapper --systohc $GMT rc_status fi rc_status -v -r fi -- Cheers, Carlos Robinson