The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   Applications (http://hintsforums.macworld.com/forumdisplay.php?f=5)
-   -   How to force quit everything in one go ? (http://hintsforums.macworld.com/showthread.php?t=58485)

biovizier 07-24-2006 09:33 AM

Enable the "Quit" menu in "Finder", then quit it first. After that, Cmd-Tab to bring up the app switcher, then without releasing the Cmd key, just holding down "Q" automatically cycles through and quits the remaining programmes, assuming there aren't any unsaved changes in any of them.

I'm not sure if there are benefits to quitting all apps over logging out. On the other hand, with respect to quitting specific programmes, my experience agrees with those who recommend quitting Safari (and by extension, other leaky apps). On a marginal system with low RAM and hard drive space, running Safari, as opposed to Opera, would usually leave the system with at least one more swap file. Quitting Safari and Finder would result in the almost immediate recovery of the disk space for one, sometimes two swap files, after which things speed up noticeably. I suppose the problem might not be a big deal on a system with plenty of RAM...

Mikey-San 07-24-2006 10:32 AM

Quote:

Originally Posted by acme.mail.order
Now that the reasons not to have been thoroughly flogged, some thoughts on how to do it properly.

(first off, command-tab/command-Q is probably faster than running an app)

There are several ways to halt an application. Applescript `tell` and Terminal `kill` are well known. `kill` has several signals, some of which are safe to use. Force Quit sends SIGKILL to the process, instantly halting it. SIGTERM is much nicer. (Anyone familiar with the Applescript mechanics?) So looping through all processes with your user name and using kill -15 (SIGTERM) should let you have it both ways.

[more words]

I'm confused. Are you advocating kill signals for non-stuck GUI apps? That's a big no-no.

Just trying to sort out your post.

Quote:

I'm not sure if there are benefits to quitting all apps over logging out.
Semantically, these are the same thing. You end up quitting everything under your control that isn't detached from a controlling terminal/tty when you log out. (Processes run through screen, for example, stick around through log outs.)

People complain about Safari leaking, but I have to say that I've not seen it as severe as everyone yells about. (We leave it running on machines at work for weeks at a time.) However, it does leak to some extent, so I typically recommend Camino over it. Seems to be better in that respect, and remains faster than Safari over time.

trumpet_999 07-25-2006 12:07 AM

Quote:

Originally Posted by Mikey-San
People complain about Safari leaking, but I have to say that I've not seen it as severe as everyone yells about. (We leave it running on machines at work for weeks at a time.) However, it does leak to some extent, so I typically recommend Camino over it. Seems to be better in that respect, and remains faster than Safari over time.


I use Camino as my principal browser all the time :) but i've kept safari on the dock for websites that use any sort of flash/animation as camino doesn't seem to support them. (unless i'm in the dark on this one? Is there a setting or mod download for camino to make it fully flash compliant?)

Mikey-San 07-25-2006 04:53 AM

No Flash issues here with Camino (1.0.1 release version, not a nightly build) on two machines. (One with Flash 7/PPC and one with Flash 8/Intel.) I've not modded anything at all.

If you're having an issue, you might want to post a thread about it in Help Requests.

trumpet_999 07-26-2006 02:06 AM

aha, the fact that i'm still on 0.8.4 might have something to do with it, maybe i'll upgrade soon...thanks mikey-san

ALT147 07-30-2006 04:41 AM

Quote:

Originally Posted by Mikey-San
I'm seriously not making this stuff up. :)

I wasn't suggesting you were. I was just trying to work this out, for his sake and for mine. After all, when his computer goes down I'm probably the one who'll have to fix it. :p Thanks for the info.

Irene 07-30-2006 11:45 AM

I think ReStart should be the short answer to to the original question. It would safely quit all the applications and release any memory they were using.

chabig 07-30-2006 12:27 PM

Quote:

Originally Posted by trip dragon
How can I force quit everything ? A quick simple way to get apps closed and free some memory.

Pull the power plug. Don't laugh. It's as smart as what you're trying to do.

Chris

ThreeDee 07-30-2006 12:52 PM

Quote:

Originally Posted by acme.mail.order
There are several ways to halt an application. Applescript `tell` and Terminal `kill` are well known. `kill` has several signals, some of which are safe to use. Force Quit sends SIGKILL to the process, instantly halting it. SIGTERM is much nicer.

I remember some of these terms scrolling up the screen on my old laptop running Ubuntu.

Something like:

--SYSTEM IS HALTING NOW!--
Setting runlevel to 0...
Sending SIGTERM to all processes...
Closing <something>
Closing <something>
... <other stuff>
Sending SIGKILL to all processes...
Power down...

Quote:

(Anyone familiar with the Applescript mechanics?) So looping through all processes with your user name and using kill -15 (SIGTERM) should let you have it both ways.
I could easily make something like this, but I'm not sure how to get a PID of a process using 'do shell script'...


From the Apple Developer Guidelines: "Avoid relying on a restart to get rid of cached or temporary files that may use up disk space. Be prepared to remove these files yourself when they are no longer needed."

http://developer.apple.com/documenta...section_2.html

NovaScotian 07-30-2006 08:13 PM

Quote:

Originally Posted by acme.mail.order
--- I don't have a USB power relay yet :D ---

ASIDE: Greatest gadgets since sliced bread, fully scriptable too! :)

hayne 07-31-2006 02:52 AM

Quote:

Originally Posted by chabig
Pull the power plug. Don't laugh. It's as smart as what you're trying to do.

Untrue.
Pulling the power plug is much worse since it abruptly stops the OS as well as the applications. Since the OS keeps files buffered in RAM and only writes them to disk when convenient, a sudden power loss brings the possibility of filesystem corruption. That's much worse than merely losing some changes when an app didn't get time to save a dirty document.

trumpet_999 07-31-2006 07:30 AM

Quote:

Originally Posted by chabig
Pull the power plug. Don't laugh. It's as smart as what you're trying to do.


[/cynicism?]

chabig 07-31-2006 08:12 AM

Quote:

Originally Posted by hayne
Pulling the power plug is much worse...

Good point.

acme.mail.order 07-31-2006 08:34 AM

Quote:

Originally Posted by Mikey-San
I'm confused. Are you advocating kill signals for non-stuck GUI apps? Just trying to sort out your post.

A decently written app, GUI or not, should trap and properly process SIGTERM. But I ask with the AppleScript first. It might have a dialog up on the screen and not respond to the AppleScript so I then use SIGTERM/SIGKILL/reboot with a short wait in between. As my particular case involves a headless server I don't see too many other options, and this one doesn't have too many problems.

About the power plug - FileMaker once posted in their documentation that one way to recover from an accidental "Delete All Records" command (which is not undo-able) is to yank the plug before the program flushes to disk. As the flush cycle was only 4 seconds long you really didn't have time for a software solution. Don't have a link right now, but they did say this was a last-ditch, somewhat unreliable effort.

Las_Vegas 07-31-2006 02:43 PM

Quote:

Originally Posted by acme.mail.order
About the power plug - FileMaker once posted in their documentation that one way to recover from an accidental "Delete All Records" command (which is not undo-able) is to yank the plug before the program flushes to disk. As the flush cycle was only 4 seconds long you really didn't have time for a software solution. Don't have a link right now, but they did say this was a last-ditch, somewhat unreliable effort.

This technique worked in System 7 to OS 9 only if done immediately after emptying the trash or doing some other destructive task. It exploited the fact that the older OS's didn't immediately flush the drive cache. It also introduced a great risk of damaging the directories, open files and/or the OS itself. This will likely not work in OS X.


All times are GMT -5. The time now is 08:49 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.