On Wednesday 29 November 2006 17:46, Arthur Sherman wrote:
> > > > Hisao, Brian,
> > > >
> > > > Can one of you commit the following patch into the codebase ?
> > > > This applies at least to Centos 4 build. This patch fixes the
> > > > problem that
> > > > the timezone is reset to the installation default after a
> >
> > reboot, by
> >
> > > > applying the timezone also in /etc/sysconfig/clock
> > > >
> > > > With regards,
> > > >
> > > > Taco
> > > >
> > > > diff -u /usr/sausalito/handlers/base/time/time.pl-orig
> > > > /usr/sausalito/handlers/base/time/time.pl
> > > > --- /usr/sausalito/handlers/base/time/time.pl-orig 2005-11-29
> > > > 15:15:09.0000 00000 +0100
> > > > +++ /usr/sausalito/handlers/base/time/time.pl 2006-11-17
> > > > 18:02:20.000000000 +0 100
> > > > @@ -7,6 +7,7 @@
> > > > $cce->connectfd();
> > > >
> > > > my $localtime = '/etc/localtime';
> > > > +my $clock = '/etc/sysconfig/clock';
> > > > my $oid = $cce->event_oid();
> > > > my $time_obj = $cce->event_object();
> > > > my $old = $cce->event_old();
> > > > @@ -32,6 +33,29 @@
> > > > symlink($link, '/etc/localtime');
> > > > }
> > > >
> > > > + # update /etc/sysconfig/clock
> > > > + my $fn = sub
> > > > + {
> > > > + my ($fin, $fout) = (shift,shift);
> > > > + my ($text) = (shift);
> > > > +
> > > > + while (<$fin>)
> > > > + {
> > > > + if(m/^ZONE/) {
> > > > + # print out the CCE maintained section
> > > > + print $fout "ZONE=\"$text\"\n";
> > > > + } else {
> > > > + print $fout $_;
> > > > + }
> > > > + }
> > > > +
> > > > + return 1;
> > > > + };
> > > > +
> > > > + if (!Sauce::Util::editfile($clock, $fn, $zone)) {
> > > > +
> > > > $cce->warn("[[base-time.errorWritingConfFile]]");
> > > > + }
> > > > +
> > > > # set the time if necessary.
> > > > my $time = $time_obj->{epochTime};
> > >
> > > My server gets time problems all the time: once it jumps
> >
> > back 6 hours,
> >
> > > another time it jumps forward ~12 hours...
> > > What a mess!
> > > I have no clue how it decides what time is it now...
> > >
> > > Will your patch address this issue as well?
> > >
> > > Thanks for your efforts.
> >
> > Ran into similar issues here with two boxes (others seem to
> > be working fine).
> >
> > /etc/sysconfig/clock should have the "correct" timezone
> > information in it
> >
> > > EG: US/Central
> >
> > file /etc/localtime should be a link to /usr/share/zoneinfo/<timezone>
> > where <timezone> is the same as what you have in /etc/sysconfig/clock
> > for the timezone - EG /usr/share/zoneinfo/US/Central
> >
> > Once these are set, restart ntpd (if you use it) and after
> > about ten minutes
> > (it takes a while to sync itself) run command "ntpq -c
> > associations". This
> > will list the servers (by index code) and their status
> > (condition column).
> > If all servers show "reject" then ntp is not going to sync
> > this way. If any
> > show sys.peer or candidat or some such, then it should work
> > and keep correct
> > time using ntpd.
> >
> > That failing, create a small shell script in /etc/cron.hourly
> > (I called mine
> > clock_set) with the following:
> >
> >
> > # #!/bin/sh
> > # /usr/sbin/ntpd -q > /dev/null 2>&1
> > # exit
> >
> > This will "update" the clock once an hour and should keep the
> > server within a
> > minute of "true" time (basically just does the ntpdate set
> > part that ntpd
> > does during init and then exits).
> >
> > --
> > Larry Smith
> > SysAd ECSIS.NET
> > sysad (at mark) ecsis.net
>
> Thank you very much, Larry.
>
> I'll try it tomorrow and inform the list about results, in case someone
> else run in this.
>
Cool beans, remember to take the hash marks (#) from in front of the three
lines. I did that solely for the list.
--
Larry Smith
SysAd ECSIS.NET
sysad (at mark) ecsis.net