View previous topic :: View next topic |
Author |
Message |
chrono325 n00b
Joined: 13 Jul 2004 Posts: 39
|
Posted: Thu Feb 03, 2005 4:05 am Post subject: System time reset, dirty hack included |
|
|
I recently had the problem that my system time would set itself to December 13, 1901. This would occur every couple minutes, and the screen would flash black when it reset. Aside from being annoying, it would mess up all sorts of things like ssl websites, portage, and so on. After learning regexps and sed, I hacked together a quick script to sync the system time with the Real Time Clock, which is not affected when a reset occurs. Here it is, in all of its n00bish glory: Code: | #!/bin/bash
# set TIME24 to hh:mm:ss from rtc
TIME24="$(sed "
1!d
s/[^0-9:]//g
s/^://" /proc/driver/rtc)"
# set DATE_DATH to ccyy-mm-dd from rtc
DATE_DASH="$(sed "
2!d
s/[^0-9\-]//g" /proc/driver/rtc)"
date +%F -s $DATE_DASH >/dev/null
date +%T -s $TIME24 >/dev/null
| Obviously, I would like to know the cause of the problem and fix that, rather than having to run a cron job every 2 minutes. If anyone has any suggestions, in addition to critique of my SEDding, please do not hesitate. _________________ Person me = new N00b();
Playing russian roulette with Reiser4 since 9/10/04.
Pentium 4 Northwood 2.4Ghz, NPTL, udev, initng, gentoo-sources-2.6.11-r6 with reiser4: How would you like to hardlock today? |
|
Back to top |
|
|
angoraspruce Apprentice
Joined: 08 Jan 2005 Posts: 193 Location: Minnesota, USA
|
Posted: Thu Feb 03, 2005 6:16 am Post subject: Re: System time reset, dirty hack included |
|
|
You certainly have a unique problem. Myself, I wouldn't rule out hardware problems despite the fact that your mb clock keeps the proper time, especially because your screen goes blank when the time gets reset. Strange.
As an aside, assuming that you have network connection, the most accurate way for the average person to reset the system time is to use ntpdate, usually found in '/usr/sbin/'. And then to keep your system on time you would run '/usr/sbin/ntpd', however an abrupt resetting of your system time to one that's over a hundred years off would shut the deamon down in its tracks. (In fact, just a half minute or so being off would do it!)
Best regards |
|
Back to top |
|
|
chrono325 n00b
Joined: 13 Jul 2004 Posts: 39
|
Posted: Fri Feb 04, 2005 1:57 am Post subject: |
|
|
well, I think I know why the screen blanks, I have Xorg turn off the monitor after a certain amount of time (20 min I think), and I guess 100 years > 20 min so it is trying to power down the monitor.
To make things better, the rtc is now losing lots of time, according to my system clock, it is now 2:00 PM Dec 14 2001. Better than 1901, but could still use some work. Especially frustrating as I had the Mobo replaced last September, took Via a month to get it back to me. _________________ Person me = new N00b();
Playing russian roulette with Reiser4 since 9/10/04.
Pentium 4 Northwood 2.4Ghz, NPTL, udev, initng, gentoo-sources-2.6.11-r6 with reiser4: How would you like to hardlock today? |
|
Back to top |
|
|
chrono325 n00b
Joined: 13 Jul 2004 Posts: 39
|
Posted: Thu Feb 10, 2005 8:03 pm Post subject: |
|
|
Okay, it wasnt the motherboard, I got a new one and there is still the same problem. I doubt two different motherboards would just *happen* to have the same problem. Any idea what it could be? I am not quite ready to emerge -e system yet, so I would like to know whether there could be a program screwing things up. ntpd seems powerless to stop it, and ntp-client doesnt launch for some reason (cannot connect to any timeservers, more on that later.) a quick ps aux yields('frochild' is the name of my regular user sorry for the giant text block) Code: | USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 1348 504 ? S 14:33 0:00 init [3]
root 2 0.0 0.0 0 0 ? SN 14:33 0:00 [ksoftirqd/0]
root 3 0.0 0.0 0 0 ? S< 14:33 0:00 [events/0]
root 4 0.0 0.0 0 0 ? S< 14:33 0:00 [khelper]
root 17 0.0 0.0 0 0 ? S< 14:33 0:00 [kacpid]
root 116 0.0 0.0 0 0 ? S< 14:33 0:00 [kblockd/0]
root 174 0.0 0.0 0 0 ? S 14:33 0:00 [pdflush]
root 175 0.0 0.0 0 0 ? S 14:33 0:00 [pdflush]
root 177 0.0 0.0 0 0 ? S< 14:33 0:00 [aio/0]
root 176 0.2 0.0 0 0 ? S 14:33 0:04 [kswapd0]
root 763 0.0 0.0 0 0 ? S< 14:33 0:00 [vesafb]
root 776 0.0 0.0 0 0 ? S 14:33 0:00 [kseriod]
root 850 0.0 0.0 0 0 ? S< 14:34 0:00 [ata/0]
root 854 0.0 0.0 0 0 ? S 14:34 0:00 [ktxnmgrd:hda4:w]
root 855 0.0 0.0 0 0 ? S 14:34 0:00 [ent:hda4.]
root 967 0.0 0.0 1328 364 ? S<s 14:34 0:00 udevd
root 7553 0.0 0.0 0 0 ? S 14:34 0:00 [khubd]
root 20382 0.0 0.0 1612 564 ? Ss 14:34 0:00 metalog [MASTER]
root 20383 0.0 0.0 1412 480 ? S 14:34 0:00 metalog [KERNEL]
root 20872 0.0 0.3 5720 2508 ? Ss 14:34 0:00 /usr/sbin/cupsd
101 21201 0.0 0.1 3564 1512 ? Ss 14:34 0:00 /usr/bin/dbus-daemon-1 --system
root 21362 0.0 0.0 1420 460 ? Ss 14:34 0:00 /usr/sbin/usbd
root 21983 0.0 0.8 7860 6456 ? Ss 14:34 0:01 /usr/sbin/hald
root 22758 0.0 0.0 1608 712 ? Ss 14:34 0:00 /usr/sbin/cron
root 22844 0.0 0.0 1388 592 tty1 Ss+ 14:34 0:00 /sbin/agetty 38400 tty1 linux
root 22845 0.0 0.0 1388 592 tty2 Ss+ 14:34 0:00 /sbin/agetty 38400 tty2 linux
root 22846 0.0 0.0 1388 592 tty3 Ss+ 14:34 0:00 /sbin/agetty 38400 tty3 linux
root 22847 0.0 0.0 1388 592 tty4 Ss+ 14:34 0:00 /sbin/agetty 38400 tty4 linux
root 22848 0.0 0.0 1388 592 tty5 Ss+ 14:34 0:00 /sbin/agetty 38400 tty5 linux
root 22849 0.0 0.0 1388 592 tty6 Ss+ 14:34 0:00 /sbin/agetty 38400 tty6 linux
root 22975 0.0 0.2 8532 2220 ? Ss 14:34 0:00 /usr/bin/gdm
root 22977 0.0 0.3 9168 2852 ? S 14:34 0:00 /usr/bin/gdm
root 22982 3.7 7.0 58380 54336 ? SL 14:34 0:50 /usr/X11R6/bin/X :0 -audit 0 -auth /var/gdm/:0.Xauth vt7
frochild 23079 0.1 0.5 7352 4520 ? Ss 14:35 0:01 /usr/bin/enlightenment
frochild 23099 0.0 0.1 2812 832 ? Ss 14:35 0:00 /usr/bin/ssh-agent -- /home/frochild/.xsession
frochild 23101 0.0 2.1 25704 16548 ? S 14:35 0:01 /usr/bin/gnome-panel
frochild 23103 0.0 0.9 18344 7688 ? S 14:35 0:00 /usr/libexec/gnome-settings-daemon --oaf-activate-iid=OAFIID:GNOME_SettingsDaemon --oaf-ior-fd=38
frochild 23108 0.0 0.9 8464 7256 ? S 14:35 0:00 /usr/libexec/gconfd-2 13
frochild 23110 0.0 0.3 5272 2800 ? Ss 14:35 0:00 /usr/libexec/bonobo-activation-server --ac-activate --ior-output-fd=17
frochild 23144 0.1 1.2 19400 9940 ? S 14:35 0:01 /usr/libexec/wnck-applet --oaf-activate-iid=OAFIID:GNOME_Wncklet_Factory --oaf-ior-fd=23
frochild 23146 0.0 0.8 17088 6848 ? S 14:35 0:00 /usr/libexec/notification-area-applet --oaf-activate-iid=OAFIID:GNOME_NotificationAreaApplet_Factory --oaf-ior-fd=25
frochild 23148 0.0 1.1 18576 8820 ? S 14:35 0:00 /usr/libexec/mini_commander_applet --oaf-activate-iid=OAFIID:GNOME_MiniCommanderApplet_Factory --oaf-ior-fd=27
frochild 23150 0.1 0.9 17580 7496 ? S 14:35 0:02 /usr/libexec/geyes_applet2 --oaf-activate-iid=OAFIID:GNOME_GeyesApplet_Factory --oaf-ior-fd=29
frochild 23152 0.0 0.9 17240 7048 ? S 14:35 0:00 /usr/libexec/multiload-applet-2 --oaf-activate-iid=OAFIID:GNOME_MultiLoadApplet_Factory --oaf-ior-fd=31
frochild 23154 0.0 1.2 19328 10032 ? S 14:35 0:01 /usr/libexec/clock-applet --oaf-activate-iid=OAFIID:GNOME_ClockApplet_Factory --oaf-ior-fd=33
frochild 23155 0.0 0.1 2324 984 ? Ss 14:35 0:00 /bin/bash /usr/bin/firefox
frochild 23165 9.0 7.0 117212 54516 ? Sl 14:35 1:55 /usr/lib/MozillaFirefox/firefox-bin
frochild 23322 0.1 1.6 32080 13152 ? Sl 14:42 0:01 gnome-terminal
frochild 23323 0.0 0.0 2052 676 ? S 14:42 0:00 gnome-pty-helper
frochild 23324 0.0 0.2 3740 2324 pts/0 Ss 14:42 0:00 -zsh
frochild 32576 0.6 2.1 35484 16808 ? Sl 14:52 0:01 nautilus --no-desktop --browser
frochild 32649 0.0 0.5 17668 4068 ? Sl 14:52 0:00 /usr/libexec/gnome-vfs-daemon --oaf-activate-iid=OAFIID:GNOME_VFS_Daemon_Factory --oaf-ior-fd=39
frochild 32682 0.0 0.0 2032 744 ? S 14:52 0:00 /usr/libexec/mapping-daemon
frochild 32701 0.0 1.0 20444 8060 ? S 14:52 0:00 /usr/libexec/nautilus-throbber --oaf-activate-iid=OAFIID:Nautilus_Throbber_Factory --oaf-ior-fd=41
frochild 32756 0.0 0.0 0 0 ? Zs 14:52 0:00 [ssh] <defunct>
frochild 2295 0.0 0.1 2408 832 pts/0 R+ 14:57 0:00 ps aux
| emerge info: Code: | Gentoo Base System version 1.4.16
Portage 2.0.51-r15 (gcc34-x86-2004.2, gcc-3.3.4, glibc-2.3.4.20041102-r0, 2.6.10-gentoo-r6 i686)
=================================================================
System uname: 2.6.10-gentoo-r6 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz
Python: dev-lang/python-2.3.4 [2.3.4 (#1, Oct 17 2004, 14:00:09)]
distcc 2.16 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
dev-lang/python: 2.3.4
sys-devel/autoconf: 2.13, 2.59-r6
sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.4
sys-devel/binutils: 2.15.92.0.2-r1
sys-devel/libtool: 1.5.10-r4
virtual/os-headers: 2.6.8.1-r1, 2.6.8.1-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/alias /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs candy ccache cvs distlocks makecheck sandbox userpriv usersandbox"
GENTOO_MIRRORS="http://gentoo.mirrors.pair.com http://gentoo.ccccom.com http://gentoo.mirrors.pair.com http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="Massive number of use flags"
Unset: ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL |
anything look particularly offending? _________________ Person me = new N00b();
Playing russian roulette with Reiser4 since 9/10/04.
Pentium 4 Northwood 2.4Ghz, NPTL, udev, initng, gentoo-sources-2.6.11-r6 with reiser4: How would you like to hardlock today? |
|
Back to top |
|
|
das_leid n00b
Joined: 11 Apr 2004 Posts: 63 Location: Bochum / Germany
|
Posted: Sat Mar 26, 2005 11:48 pm Post subject: Strange |
|
|
as I have this problem, too. It happens to a server which runs only for fun as a foldingathome crunsher and serving some files. But it happens not every couple of minutes but only around 10 o'clock pm and 0 o'clock am. Time gets reset to 1901 and my updatedb scripts are running endless. Strange. Seems I got something nasty the last time I synchronized. BTW: IMHO, it's nothing with the kernel. I had a very old one on the server (2.6.8.x) and a newer one (2.6.11) - it happened with both.
OK : Seems like I have the same prob with webmin as these guys do : https://forums.gentoo.org/viewtopic-t-275528-highlight-1901.html
Let's see if it works. _________________ emerge vim
OH EVIL ! |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|