[ale] Syntax problem
James P. Kinney III
jkinney at localnetsolutions.com
Wed Aug 24 16:25:33 EDT 2005
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.
--
James P. Kinney III \Changing the mobile computing world/
CEO & Director of Engineering \ one Linux user /
Local Net Solutions,LLC \ at a time. /
770-493-8244 \.___________________________./
http://www.localnetsolutions.com
GPG ID: 829C6CA7 James P. Kinney III (M.S. Physics)
<jkinney at localnetsolutions.com>
Fingerprint = 3C9E 6366 54FC A3FE BA4D 0659 6190 ADC3 829C 6CA7
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
More information about the Ale
mailing list