[ale] Syntax problem

Randy C. Ramsdell rramsdell at adelphia.net
Wed Aug 24 16:34:39 EDT 2005


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. 
> 
> example:
> #/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
> memory)
> 
> #pgrep spamd
> 16155
> 29000
> 29054
> 29057
> 29058
> 29059
> 29060
> 29061
> 
> 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
> http://www.ale.org/mailman/listinfo/ale

My mistake. I was thinking pidof reported a single pid for some reason.





More information about the Ale mailing list