[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Syntax problem
On Wed, 2005-08-24 at 16:25 -0400, James P. Kinney III wrote:
> On Wed, 2005-08-24 at 16:00 -0400, Randy C. Ramsdell wrote:
> > > > I realize that, but it kills the process never the less. But, kill
> > > > doesn't take into account multiple processes whose name is namd. I
> > > > thought he said kill all PIDs named namd.
> > >
> > > Hmm. My kill seems to require PIDs and not names.
> > As does mine. I am not sure, but maybe what I wrote isn't clear. I think
> > you may have thought I meant to leave the "pidof" command in place.
> > After reading my paragraph, I can see that I was not clear about that.
> > Anyway, both iterations work. One kills a single PID, using pidof, and
> > the other kills multiple processes called "namd", without pidof.
> Yes. killall -d namd will do the same thing as kill -9 `pidof namd` .
> pidof generates a list of all the PID's for a named process. kill can
> take a space-delimited list of PID's.
> #/sbin/pidof spamd
> 29061 29060 29059 29058 29057 29000 16155
> (need to find a way to fix this as spamassassin is used by evolution and
> it keeps spawning new children on each use until the system runs out of
> #pgrep spamd
> So the output of pidof is suitable for dumping into kill directly. But
> pgrep is better for dumping into a shell script in a for loop.
> But as was posted earlier, pkill and pgrep look to be even more
> efficient and have some other tools (user ID checking of PID's) that
> make it even more useful.
> > > So to restate the above ssh string:
> > >
> > > ssh machine "killall -9 namd"
> > >
> > > would also work.
> Ale mailing list
> Ale at ale.org
My mistake. I was thinking pidof reported a single pid for some reason.