pierre <[EMAIL PROTECTED]> wrote:
On Tue, 29 Jan 2008 11:37:41 +0100
"Helmut Schneider" <[EMAIL PROTECTED]> wrote:
Claudio Jeker <[EMAIL PROTECTED]> wrote:
We don't believe in pid files. Use pgrep(1) and pkill(1) instead,
you will never have stale info that way.
pgrep on OpenBSD does not support '-o' (Select only the oldest). It
is - well - it could be more useful.
man pgrep
-n Match only the most recently created process, if any.
Is that what you're looking for ?
No. It might find a child but it will never find the parent.
[EMAIL PROTECTED] ~]# pgrep -fl httpd
81972 /usr/local/sbin/httpd
81960 /usr/local/sbin/httpd
1115 /usr/local/sbin/httpd
1114 /usr/local/sbin/httpd
1111 /usr/local/sbin/httpd
1109 /usr/local/sbin/httpd
1108 /usr/local/sbin/httpd
979 /usr/local/sbin/httpd
[EMAIL PROTECTED] ~]#
To stop httpd, which pid should I kill, the oldest, or the most recent?
OK, 'pgrep -fl httpd | tail -1' does the trick, and pgrep is not safe enough
for finding parents, but...
--
No Swen today, my love has gone away
My mailbox stands for lorn, a symbol of the dawn