NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/56387: Wrong uptime output: returns all but the uptime



The following reply was made to PR bin/56387; it has been noted by GNATS.

From: David Holland <dholland-bugs%netbsd.org@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: bin/56387: Wrong uptime output: returns all but the uptime
Date: Sun, 19 Sep 2021 04:12:03 +0000

 On Fri, Sep 03, 2021 at 05:35:01PM +0000, rdanilov75%gmail.com@localhost wrote:
  > If run uptime command, I get all, but the uptime:
  > 
  > inw-vm039$ uptime
  >  8:08PM  1 user, load averages: 0.00, 0.00, 0.00
 
 Looking at the code, there are only three ways to not get the "up"
 print: (1) up less than one minute (not the case), (2) boot time is
 Jan 1, 1970 (unlikely), or (3) sysctl() fails (also fairly unlikely).
 
 Can you run it under ktrace (ktrace uptime; kdump | less) and check if
 the call to sysctl is failing? There should be one call fairly early
 (before it opens utmp or utmpx) which is irrelevant, and one near the
 end, which is the important one. If that's failing, the question is
 why.
 
 Also, check the boot time in case that's 0. If so, the question is
 why...
 
 -- 
 David A. Holland
 dholland%netbsd.org@localhost
 


Home | Main Index | Thread Index | Old Index