Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google site



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Closed Thread
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rate Thread Display Modes
  #8 (permalink)  
Old 12-13-2005
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 6,162
All command line utilities use time() which reads the kernel's internal timestamp - it is accurate to one second, it returns a time_t value of the the elapsed seconds since the start of the epoch.

Does this affect file times as well?

Code:
date ; touch t.lis; ls -l t.lis

If so, then something is wrong.
Sponsored Links
  #9 (permalink)  
Old 12-13-2005
Registered User
 

Join Date: Dec 2005
Location: MD
Posts: 18
Here's the output, file times are not affected.
Quote:
SHELL=/bin/bash
TERM=xterm
HISTSIZE=1000
USER=root
USERNAME=root
MAIL=/var/spool/mail/root
PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib/courier-imap/sbin:/usr/lib/courier-imap/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
INPUTRC=/etc/inputrc
PWD=/root
LANG=en_US.UTF-8
SHLVL=1
HOME=/root
BASH_ENV=/root/.bashrc
LOGNAME=root
LESSOPEN=|/usr/bin/lesspipe.sh %s
G_BROKEN_FILENAMES=1
_=/bin/env

[root@system root]# type ps ; type date
ps is hashed (/bin/ps)
date is hashed (/bin/date)

[root@system root]# date ; date -u
Tue Dec 13 12:41:54 EST 2005
Tue Dec 13 17:41:54 UTC 2005

[root@system root]# date ; perl -e 'print time(), " ", localtime(time()), "\n"'
Tue Dec 13 12:41:54 EST 2005
1134495715 554112131110523460

[root@system root]# touch fubar ; date ; ls -l fubar
Tue Dec 13 12:41:55 EST 2005
-rw-r--r-- 1 root root 0 Dec 13 12:41 fubar

[root@system root]# { sleep 1000 & } ; ps -fp $! ; ls -l /proc/$! ; kill $!
[1] 16681
UID PID PPID C STIME TTY TIME CMD
root 16681 12733 0 12:54 pts/83 00:00:00 sleep 1000
total 0
dr-xr-xr-x 2 root root 0 Dec 13 12:44 attr
-r-------- 1 root root 0 Dec 13 12:44 auxv
-r--r--r-- 1 root root 0 Dec 13 12:44 cmdline
lrwxrwxrwx 1 root root 0 Dec 13 12:44 cwd -> /root
-r-------- 1 root root 0 Dec 13 12:44 environ
lrwxrwxrwx 1 root root 0 Dec 13 12:44 exe -> /bin/sleep
dr-x------ 2 root root 0 Dec 13 12:44 fd
-r-------- 1 root root 0 Dec 13 12:44 maps
-rw------- 1 root root 0 Dec 13 12:44 mem
-r--r--r-- 1 root root 0 Dec 13 12:44 mounts
lrwxrwxrwx 1 root root 0 Dec 13 12:44 root -> /
-r--r--r-- 1 root root 0 Dec 13 12:44 stat
-r--r--r-- 1 root root 0 Dec 13 12:44 statm
-r--r--r-- 1 root root 0 Dec 13 12:44 status
dr-xr-xr-x 3 root root 0 Dec 13 12:44 task
-r--r--r-- 1 root root 0 Dec 13 12:44 wchan
[1]+ Terminated sleep 1000
I would say that something is pretty wrong even though files are affected This is not good!
  #10 (permalink)  
Old 12-13-2005
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,150
It looks like Linux tracks the number of clock ticks (called jiffies on linux ) since the system boot. Processes are time stamped with this count. ps obtains the boottime and adds in the clock ticks to get a process' start time. Somehow that calculation is wrong in your case. Since your system was booted, you seem to have had at least 9 minutes and 38 seconds worth too many clock ticks.

How long has your system been up? Maybe the clock is just running way too fast. Are you using ntp to keep it in sync? Or do you manually reset the clock when it is off? Ideally, ntp is supposed to detect a clock that has a consistently incorrect frequency and compensate for it. Maybe your ntpd is broken. Or you might have some jiffie-wrap. Or you might have some kernel bug that corrupted your boottime variable. All I can suggest is a reboot.
  #11 (permalink)  
Old 12-13-2005
Registered User
 

Join Date: Dec 2005
Location: MD
Posts: 18
Yeah syncing with ntp doesnt seem to have any effect. My system has only been up 45 days, so to be that out of sync seems crazy in such a short time. Hopefully its not a kernel bug, but I wont rule it out. In fact its probably a good place to start searching for a fix if a reboot doesnt do it. Thanks all.
  #12 (permalink)  
Old 01-02-2006
Registered User
 

Join Date: Dec 2005
Location: MD
Posts: 18
I just wanted to let you all know that I have rebooted the server (about a week ago) and am still having the same issue.


Code:
date;ps -ef|grep date
Mon Jan  2 10:37:12 EST 2006
root     13993 13851  0 10:39 pts/38   00:00:00 grep date

Kernel: 2.6.5-1.358smp

I dont think it will be impacting anything, but its just not nice to see. I will probably be looking to upgrade my kernel sooner than expected. Thanks again fellas!
  #13 (permalink)  
Old 01-02-2006
bakunin bakunin is offline Forum Staff  
Bughunter Extraordinaire
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 1,670
This is just a suggestion and i don't know really much about Linux, but:

On AIX ntp writes to the files /etc/ntp.trace and /etc/ntp.drift (yes, silly idea to put a logfile into /etc, but I'm not responsible for it), maybe your ntp writes there (or somewhere similar) too. Maybe it helps to check out these files.

bakunin
  #14 (permalink)  
Old 01-02-2006
Registered User
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 2,458
Try 'dmesg', see anything interesting?
Sponsored Links
Closed Thread

Bookmarks

Tags
linux, solaris

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Get date and time for past 1 hour from current date spch2o Shell Programming and Scripting 5 08-29-2008 05:32 AM
Processing a log file based on date/time input and the date/time on the log file primp Shell Programming and Scripting 4 03-16-2008 11:23 AM
Date/Time help ssmiths001 Shell Programming and Scripting 5 01-27-2006 03:40 AM
X Keyboard Extension version mismatch hiker04 Solaris 0 09-13-2005 09:51 AM
time and date in os X help please dercarcort UNIX for Dummies Questions & Answers 1 06-30-2002 09:03 AM



All times are GMT -4. The time now is 03:50 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2010. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0