Process states?
Matthew Seaman
m.seaman at infracaninophile.co.uk
Tue Nov 2 00:54:45 PST 2004
On Mon, Nov 01, 2004 at 11:06:23PM -0000, Hugo Silva wrote:
> > On Mon, 1 Nov 2004 20:17:01 -0000 (GMT), Hugo Silva <klr at 6s-gaming.com>
> > wrote:
> >> I'd like to know where I could get a complete list of the possible
> >> process
> >> states shown in ps , and their meanings ?
> >
> > A good starting point is
> > $ man ps
> >
> > You could also try:
> > http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/basics-processes.html
> man ps / freebsd handbook don't speak about this, afaik.
What exactly do you mean by 'state'. If you mean the STAT column in
'ps -aux' output, then that is documented in ps(1) --
% ps -aux | head -4
USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
root 0 0.0 0.0 0 0 ?? DLs Tue03PM 0:00.00 (swapper)
matthew 65033 0.0 0.1 512 384 p2 R+ 8:40AM 0:00.00 ps -aux
matthew 65007 0.0 0.1 972 448 ?? Is 8:38AM 0:00.00 /usr/local/libex
^^^^
Look for the description of the 'state' keyword. From the small
sample above, 'DLs' means 'process in disk wait, pages locked in core,
session leader'; 'R+' means 'Runnable process, process in foreground
process group of its controlling terminal' and 'Is' means 'Idle
process, process is session leader'
Most of the state descriptions are pretty transparent. One thing that
might not be obvious at first glance is the concept of 'session
leaders' -- 'sessions' are the same thing as 'process groups' (see
setsid(2), setpgid(2)). Generally your login shell will be a 'session
leader' and all of the programs you run interactively will belong to
that session. Daemon processes generally put themselves into their
own sessions.
On the other hand, one thing that is not at all well documented is the
'STATE' column in top(1) output. As far as I can tell, that state is
either RUN for a process that is actually running at the moment, or
the name of a procedure where the process is sleeping, waiting on IO
or some other condition for the kernel to give it a time slot.
Cheers,
Matthew
--
Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks
Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey Marlow
Tel: +44 1628 476614 Bucks., SL7 1TH UK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20041102/061cb58b/attachment.bin
More information about the freebsd-questions
mailing list