Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Feb 2003 13:50:33 +1000
From:      Paul Koch <paul.koch@statscout.com>
To:        freebsd-stable@FreeBSD.ORG, Oliver Fromme <olli@secnetix.de>
Subject:   Re: Invalid ps start time values for kernel processes ?
Message-ID:  <200302081350.33720.paul.koch@statscout.com>
In-Reply-To: <200302071349.h17Dnefo076099@lurza.secnetix.de>
References:  <200302071349.h17Dnefo076099@lurza.secnetix.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 7 Feb 2003 11:49 pm, Oliver Fromme wrote:
> Paul Koch <paul.koch@statscout.com> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200302081350.33720.paul.koch>