wrong uptime output?

wrong uptime output?

Post by Ken » Thu, 07 Jun 2001 23:59:09



The past few day we have been having some odd problems on our Solaris
7 box, and I think I pretty much have them all resolved.  Something
that is very odd and I cannot figure out is that uptime gives the
following output:

# uptime
   PID TTY      TIME CMD

That's it.  'w' gives the following:

# w
   PID TTY      TIME CMD
 12135 pts/2    0:00 w

Why would uptime be giving that output, which seems to be 'w's
columns, and 'w' is not giving the user?

Thanks for any input.

-Ken

 
 
 

wrong uptime output?

Post by Dennis Peterso » Fri, 08 Jun 2001 00:39:51



> The past few day we have been having some odd problems on our Solaris
> 7 box, and I think I pretty much have them all resolved.  Something
> that is very odd and I cannot figure out is that uptime gives the
> following output:

> # uptime
>    PID TTY      TIME CMD

> That's it.  'w' gives the following:

> # w
>    PID TTY      TIME CMD
>  12135 pts/2    0:00 w

> Why would uptime be giving that output, which seems to be 'w's
> columns, and 'w' is not giving the user?

> Thanks for any input.

> -Ken

Looks like some corruption in /var/adm/utmp /var/adm/wtmp files - if so
then w, who, who -b, whodo, and last commands should also fail.

Dennis Peterson
CTO, One Stop Consulting, Inc.
Seattle, WA ... http://ThinkUNIX.com

 
 
 

wrong uptime output?

Post by Ken » Fri, 08 Jun 2001 01:13:59



> Looks like some corruption in /var/adm/utmp /var/adm/wtmp files - if so
> then w, who, who -b, whodo, and last commands should also fail.

Thanks, Dennis.  Sorry if this is a stupid question, but how can I fix
or reinstall these if they are indeed corrupted?

-Ken

 
 
 

wrong uptime output?

Post by Dennis Peterso » Fri, 08 Jun 2001 04:38:31




> > Looks like some corruption in /var/adm/utmp /var/adm/wtmp files - if so
> > then w, who, who -b, whodo, and last commands should also fail.

> Thanks, Dennis.  Sorry if this is a stupid question, but how can I fix
> or reinstall these if they are indeed corrupted?

> -Ken

I said utmp and wtmp - just shows you how old I am. They are called
utmpx and wtmpx now. You can remove their contents thus (and keep a copy
around to explore). Requires root:

Make copies:
# cp /var/adm/utmpx /var/tmp/utmpx.keep
# cp /var/adm/wtmpx /var/tmp/wtmpx.keep

null out the files:
# cat /dev/null >/var/adm/utmpx
# cat /dev/null >/var/adm/wtmpx

Stop and start the utmpd daemon:
# /etc/init.d/utmpd stop;sleep 3;/etc/init.d/utmpd start

man utmpd, man utmpx, man wtmpx

--
Dennis Peterson
CTO, One Stop Consulting, Inc.
Seattle WA ... http://thinkUNIX.com
206.352.5615

 
 
 

wrong uptime output?

Post by Kjetil Torgrim Homm » Fri, 08 Jun 2001 06:29:53


[Ken]

Quote:>   The past few day we have been having some odd problems on our
>   Solaris 7 box, and I think I pretty much have them all resolved.
>   Something that is very odd and I cannot figure out is that uptime
>   gives the following output:

>   # uptime
>      PID TTY      TIME CMD

>   That's it.  'w' gives the following:

>   # w
>      PID TTY      TIME CMD
>    12135 pts/2    0:00 w

>   Why would uptime be giving that output, which seems to be 'w's
>   columns, and 'w' is not giving the user?

In standard Solaris 7, w and uptime are the same binary, with
different behaviour depending on the invocation name.

  $ cd /usr/bin/sparcv7
  $ ls -li uptime w
   312332 -r-sr-xr-x   2 root     bin         11528 Oct  6  1998 uptime*
   312332 -r-sr-xr-x   2 root     bin         11528 Oct  6  1998 w*
(as you can see we're running in 32-bit mode)

Could it be that someone has replaced w without knowing this, and thus
rendered uptime useless?  The motivation for changing w could be to
hide the presence of a given user ...

Kjetil T.

 
 
 

wrong uptime output?

Post by paul y » Fri, 08 Jun 2001 08:55:53




> > Looks like some corruption in /var/adm/utmp /var/adm/wtmp files - if so
> > then w, who, who -b, whodo, and last commands should also fail.

> Thanks, Dennis.  Sorry if this is a stupid question, but how can I fix
> or reinstall these if they are indeed corrupted?

> -Ken

man wtmpfix

/usr/lib/acct/wtmpfix /var/adm/utmp > /tmp/utmp

or
man fwtmp

 
 
 

1. New: uptime wrong on x86-64 (fwd)

           Summary: uptime wrong on x86-64
    Kernel Version: 2.5.72
            Status: NEW
          Severity: normal


Distribution: SLES8  
Hardware Environment: AMD64 Melody box  
Software Environment: 2.5.72  
Problem Description:  

uptime reports wrong value after booting  

Steps to reproduce:  

Actual result:  
  1:19pm  up 12220 days, 20:19,  1 user,  load average: 0.00, 0.00, 0.00  

Expected result:  
  1:19pm  up 15 min,  1 user,  load average: 0.00, 0.01, 0.02  

Additional info:  

1055881186  

btime 1055880294  

I've been unable to reproduce the problem on i386, however this has also been  
reported against sparc64 by Daniel Whitener.    

I suspect it might have something to do w/ do_posix_clock_monotonic_gettime() on  
these arches.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. Colorado Trakker 250 support?

3. fix wrong uptime on non-i386 platforms

4. Micron Laptop & Video Problems

5. wrong uptime in 2.5.72

6. Redhat 6.2 Installation Hangs!

7. uptime wrong

8. trouble with samba on linux and NT 3.5

9. uptime wrong in 2.5.70

10. cpu load - output of uptime vs top

11. Interpreting output of "uptime"

12. Strange "w", "who" and "uptime" output

13. Uptime rollover, How to tell real uptime?