---

“Linux’s uptime is not as good as I expected”

Hello,

The Linux’s uptime is not as good as I expected. My expectations
were high because of all the claims that can be read on the net.
But my experience is that within 498 days the uptime showed returns
to zero. Let’s have a look at what I noticed in the daily reports I
receive from some systems. One day I read in such a report :

Fri May 18 18:34:14 CEST 2001
  6:34pm  up 496 days, 20:45,  0 users,  load average: 0.29, 0.06, 0.02

The next day I saw :

Sat May 19 18:34:20 CEST 2001
  6:34pm  up 18:17,  0 users,  load average: 0.28, 0.06, 0.02

I looked at the log files but could not find recent boot messages.
My fear was a hacked box, another kernel for loadable modules
installed and an edited logfile. No reason for this fear as there
were not any indications that the box was hacked but one never
knows. Now I did some computations and found that after about
42.949.680 seconds the uptime returned to zero. To be sure I
checked in /var/log and found :

-rw-r--r--   1 root     root         2545 Jan  7  2000 boot.msg

Reasonable date compared to my computation. Another idea was to
look at :

/include/linux/kernel.h:       long uptime;     /* Seconds since boot */

And that proves that my fear was wrong, this counter is incremented
every 0.01 second. The maximum value is 4,294,967,296 which
translates to 42,949,673 seconds. To which my original calculated
value compares well.

My conclusion : the uptime returns to zero after 497 days, 2
hours, 27 minutes and 53 seconds. And Free Software really helps to
find out why somethings happens. Just as I have explained this week
in my lecture at the Linux 2001 congress.

Disclaimer : this is related to the Linux 2.2.x kernel. However,
in the Linux 2.4.x kernel the uptime field is also a long integer
so I don’t expect other effects.

Have fun,
Fred

-- 
Fred Mobach - fred@mobach.nl - postmaster@mobach.nl
Systemhouse Mobach bv - The Netherlands - since 1976

The Free Transaction Processing Monitor project : http://www.ftpm.org/

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends, & analysis