blog advertising is good for you


blog advertising is good for you
User login

Using killall

jasmeet asks:

Question

Is there a simple method to do a one button SIGSTOP/SIGCONT on an app? I tend to have tabs and tabs (and windows and windows) that I’m not ready to close, so I end up doing kill -SIGSTOP pid for Camino. Problem is, the pid is not always gonna be the same.

Answer

kill has a lesser known twin named killall that does just what you wish.

$ killall -STOP Camino

Couple this with Script Menu, and you can achieve what you wish. My only question is…

Why bother?

Average rating
(0 votes)
About JC
JC's picture

Author Biography

JC is a former Mac Genius and Mac-centric IT worker with a background in print advertising. He earned a reputation as a miracle worker when he saved the day at a new business pitch with the arcane knowledge that Apple’s ADB cables were nothing more than poorly shielded S-Video cables.

JC runs the Heroic Efforts Data Recovery Service and writes Ungenius, a tawdry tale of the life and times of a former Mac Genius.

You can contact JC via IM or via the contact form.

For those of us from “other” unixes who use a mac as a “unix for the home” type of system this is the same as “pkill” on those other flavors of unix. Exactly the same behavior and operation.

Thanks for the answer.

I tend to keep lots of Camino Windows and Tabs. And after a while, my system starts bogging down, and certain things that require processor, etc dont run as smooth.

So, I STOP the app, do my thing, and then CONT it. Problem is, my old method ps -aux | grep Camino doesn’t seem to return results to me anymore. I wonder if it’s broke somehow.

Anyway, thanks a lot! smile

JC's picture

the results of ps aux (the dash isn’t necessary) are truncated by your terminal width. Many processes (especially full applications) will display their full path in that output and can be affected just like you’re seeing.

The -w flag will squelch this behavior and force ps to spew 132 columns of output, regardless of your terminal width. If, in the rare case of 132 columnts still not being enough, you can pass in -ww and it’ll output as many columns as necessary to display all content. So, try ps auxww | grep Camino.

That looked like a good solution for my problems with Safari bringing my system to a halt (95% cpu to System and 5% to User..)
But – it doesn’t seem to work for me. If use the App name instead of the pid I get:
$ killall -STOP Firefox
$ No matching processes belonging to you were found

Am I not doing the kill correctly?

Post new comment
The content of this field is kept private and will not be shown publicly.
2 + 1 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.