John said:
Good point! I think I will start describing that as a "Power-off restart"
as opposed to simply a "Restart".
Yes, I believe you are correct: a "logout" clears user-level memory and
resources only;
Basically, you are killing all processes associated with that
user. Note that some UNIXs (and I believe, Darwin) do allow ways
that a user initiated process can be setup in a way that they
will continue but this is not a default characteristic of the OSX
GUI itself. you need to muck around at the terminal level to
accomplish such things.
a "Restart" clears system memory as well, but to clean up
the tmp files and trigger system housekeeping you need a power cycle,
Right. Essentially, ALL processes are killed with a restart but
residual static files can remain such as those in the /tmp
directory. Normally when a process shuts down, it's SUPPOSED to
delete files it no longer needs, however, this is under control
of the process since it may be desired to have some longer term
residuals when temp type files are shared between multiple
processes. Local "clipboard" type files might be an example of
this. Even though the process that created it has been killed,
the file may still have application to other processes.
Occasionally lock type files stored in this area that were not
correctly removed can remain. Even when all of the processes have
been killed and started again (i.e., a restart), those files that
should have been gone are still there and the process responsible
for removing them is long since gone. In these situations, the
only way to recover the disk space (and remove residual files
that can affect newly started processes) is to run some kind of
system maintenance program. UNIX has a whole collection of these
types of things that typically are run by default when a power-up
event occurs.
A normal, clean running system normally never has to do this
since these files are being correctly removed by their parent
processes. Minor bugs, unexpected aborts, People using "kill -9"
commands for the terminal window, etc. in the system can leave
these orphans around though so even the rare event of power-ups
on UNIX machines is typically considered adaquate for normal
maintenance of these files.
BTW, the kill -9 is a messy way to shutdown a process since it
aborts processes in a way that even if they HAVE been designed to
remove temporary files that they are using, the -9 switch
prevents that from happening. It is an immediate "forget what you
are doing and DIE!" command. Anytime you use it you can get these
orphan files laying around. However, the -9 switch is the only
switch that GUARANTEES a shutdown of the process since other less
damaging switchs may actually be ignored by a process. A hung
process can also potentially be blind to other signal types.
Normal UNIX usage is to try other less drastic switches first to
allow the process to shut down cleanly and do its own cleanup. I
am NOT sure that Apple's Activity monitor does this. For
simplicity, I BELIEVE that it just uses the kill -9 mode to
guarantee that the process dies when requested. The effect of
this is that when someone seems to have a runaway process and
they kill it from the Activity Monitor, cleanup is not performed
and residual files are left. If those process expect those files
to not be there when they first start up, obviously there is
going to be a problem the next time the user tries to start the
things again so the problem can actually get worse and worse
until those files are all trashed via a power cycle on the
workstation.
Just one of the problems in trying to simplify the complexities
of a UNIX based system into a simple GUI.
whereas a "cold start" (unplug for 30 seconds) also resets the P-RAM as I
understand it.
John, I'm not sure that is the case (anyone here that knows,
please speak up). The "persistent" RAM is suppose to survive
power cycles I thought.
What DOES happen when pulling the plugh is that all of the
hardware in the system power cycles. When you turn the system off
but don't unplug it, there is still standby power on some items
(e.g., some parts of the fan control, internal modem, and network
hardware are related this). If the state of this circuitry gets
glitched somehow or software control accidentally leaves it in an
odd state (very rare), the only way to fix it is to restart the
hardware circuitry by power cycling it. Since it is running off
of standby power, power cycling the Mac without unplugging it
will not accomplish it.
Obviously, some data is persistent beyond power such as the
setting associated with the fan control that needs to actually
have a button pushed on the motherboard while power is present in
order to reset it. Again though, there are very few items in this
catagory.