From owner-freebsd-stable Fri Feb 7 19:50:49 2003 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7F5EB37B401 for ; Fri, 7 Feb 2003 19:50:47 -0800 (PST) Received: from wally.statscout.com (wally.statscout.com [203.39.101.146]) by mx1.FreeBSD.org (Postfix) with ESMTP id 53AD243F3F for ; Fri, 7 Feb 2003 19:50:45 -0800 (PST) (envelope-from pak@statscout.com) Received: from speedy.statscout.com (ppp4-remote.statscout.com [10.1.3.14]) by wally.statscout.com (8.11.6/8.11.3av) with ESMTP id h183oZ265897; Sat, 8 Feb 2003 13:50:36 +1000 (EST) (envelope-from pak@statscout.com) Received: from speedy.statscout.com (localhost.statscout.com [127.0.0.1]) by speedy.statscout.com (8.12.6/8.12.6) with ESMTP id h183oYUQ052587; Sat, 8 Feb 2003 13:50:35 +1000 (EST) (envelope-from pak@speedy.statscout.com) Received: (from pak@localhost) by speedy.statscout.com (8.12.6/8.12.6/Submit) id h183oX1F052586; Sat, 8 Feb 2003 13:50:33 +1000 (EST) Content-Type: text/plain; charset="iso-8859-1" From: Paul Koch Organization: Statscout To: freebsd-stable@FreeBSD.ORG, Oliver Fromme Subject: Re: Invalid ps start time values for kernel processes ? Date: Sat, 8 Feb 2003 13:50:33 +1000 User-Agent: KMail/1.4.3 References: <200302071349.h17Dnefo076099@lurza.secnetix.de> In-Reply-To: <200302071349.h17Dnefo076099@lurza.secnetix.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200302081350.33720.paul.koch@statscout.com> Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, 7 Feb 2003 11:49 pm, Oliver Fromme wrote: > Paul Koch wrote: > > The ps output value for STARTED appears to be incorrect for > > kernel started processes. I found this while writing a tiny ps > > for our freebsd based network appliance. The start time returned > > from /proc/{normal pid}/status (man procfs) appears to be in > > UTC while the start time for a kernel process appears to be > > localtime (or the other way round). This gave me wild values. > > Is this correct behaviour ? > > Is your CMOS clock running with local time, rather than UTC? > (i.e. does the file /etc/wall_cmos_clock exist?) > > In that case, the kernel will start up with the wrong time > information, because it doesn't know the timezone you're in > (the kernel always uses UTC internally). This information > is corrected by the adjkerntz program in the early stages > of the boot process. > > However, the kernel processes start before that correction > happens. If you were living east of Greenwich (i.e. positive > timezone offset), the start time values would even be in the > future. > > If FreeBSD is the only operating system on that machine, > I suggest that you run the CMOS clock with UTC, avoiding the > problem alltogether. Of course, you can also just ignore > the wrong start values. They should not cause any harm. > > I don't think there is an easy way to fix the problem. My development machine was running CMOS time (might change that because there is no Windows here!) and there is a /etc/wall_cmos_clock file. Our network appliance platform only runs in UTC so my ps runs fine on it. Wouldn't it be more consistant for all process info be stored in UTC and get ps to convert/display it in localtime ? =09Paul. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message