Does anybody know how to quit a GUI program through a telnet session? I can open GUI programs through telnet but can't figure out how to then quit that same program. PS won't show GUI programs so I can't KlLL them. Any help is appreciated.
|
|
|
[Editor's note: See the comments for the answer to the question.]
Does anybody know how to quit a GUI program through a telnet session? I can open GUI programs through telnet but can't figure out how to then quit that same program. PS won't show GUI programs so I can't KlLL them. Any help is appreciated.
•
[16,396 views]
Hint Options
Try the options..
I think what you're looking for is ps -x, where the "-x" option adds "information about processes without controlling terminals" to the standard output. Your GUI jobs will now be listed.
The challenge at that point is figuring out which job to terminate. Cocoa apps are easy - they're listed by name. Carbon apps are tough, as they're all "LaunchCFMApp" (hope this changes in final!). Classic is toughest of all, since the OS sees it as an application. You can't just quit one Classic app, you have to quit Classic in general.
Trial and error method to identify a carbon app
Using trial and error, and access to the GUI (so no use to the original poster) you can pause a running app with "kill -STOP process-number" and then try to use it. If the app has been paused then you'll see the spinning wheel pointer and you won't be able to interact with the app. If you picked the right process number you can "kill -KILL process-number" to zap it. If you picked the wrong process number you can resume the app with "kill -CONT process-number".
ps -cax
Do a ps -cax. This will display all processes, listed by the command that was used to start them.
Classic Apps
Just remember Classic apps just show up under a generic process name, that I forget offhand, but is the same fo all Classic apps.
You can use Applescript
There is a command line app named osascript that will let you execute Applescripts from the terminal. In DP4, and I think in the beta, you must specify the full path, /usr/bin/osascript in order for it to work, but this should be fixed in the final. The quick way (let's say we want to quit Internet Explorer) is:
You can use Applescript
Thanks so much. But I had to use osascript -e.
Why use terminal?
Why would you use the terminal, when there's a sweet little GUI function to do this? Just hit Apple-option-esc and select the app to force quit. This works regardless of app's statusd (unlike AppleScript) and can force quit any process.
Why use terminal?
Because I want to quit them REMOTELY.
Kind of like Macsbug...
The other reason to use terminal is that you get to see all processes, like hz in macsbug used to do. The force-quit dialog only shows apps with a GUI (I think -- I'm pretty sure apps you write as daemons/servers won't show up here.)
Why use terminal?
One Reason to use the Terminal is the fact, that the GUI may crash, preventing you from seing your mouse cursor, etc.
I had such situations when Classic Apps that ran in Full screen@256 colors (old games) crashed. the color table is sometimes modified and you can't really access your system via gui. However, over a LAN, you can still log in and kill the offending process. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.54 seconds |
|