[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pgrep and pkill
Sweet, I've always wanted this program because it's so useful on
Solaris. It seems to work pretty well on my OpenBSD 2.8 box.
However, on my -current box it fails, probably because of changes with
in kmem. It just gives a bunch of totally incorrect values. Maybe
someone can audit this once it is fixed for -current and get it into
the tree?
David
* Bitt Faulk <wfaulk@beaglebros.com> [010518 13:11]:
> Solaris provides a couple of handy utilities called pgrep and pkill
> that, repectively, search for and kill processes that match arguments
> given to the process. The arguments can include things like a regex
> to match the running process name, ppid, euid, etc. I was looking for
> this for OpenBSD, and the closest thing I could find was zap in the
> ports tree, but it just parses the output of ps with sed and stuff, and
> this is not what I wanted.
>
> So I took it upon myself to implement pgrep and pkill for OpenBSD. It
> uses the same reads of kernel memory that ps does, so it should be much
> faster than zap. I haven't gotten to pkill yet, but it should be done
> tonight, hopefully. Anyone who's interested please take a look at
> http://sourceforge.net/projects/proctools and let me know what you
> think.
>
> Of course, I'm sure that I'll now get a dozen responses that say ``this
> already exists, moron'', but at least I'll know about it then.
>
> -Bitt
>
> PS: The reason zap was not the right thing was that I have an
> underpowered OpenBSD machine that was getting wedged to to a cron domino
> effect, and those extra processes zap forks were taking way too long.