This is my little shutdown program. It operates less or more the same 
way as the Unix one does, with two significant exceptions:

- the Unix-style shutdown writes wtmp, which shutdown.app does not.
- the shutdown.app shuts down GEM applications, which Unix one does not.

The previous version of the shutdown.app did NOT use the AES 
4.10/N.AES shutdown protocol, but a simplified one. However, there 
were problems with some programs (notably: CAB), which apparently do 
not like AC_CLOSE message, when running as applications :-)

Anyways, this version of shutdown.app closes GEM applications and 
accessories using the AES 4.10 shutdown protocol. When a program 
refuses the AP_TERM message, it is sent SIGTERM. If it does not help, 
the situation gets improved with SIGKILL sent subsequently. Messages 
indicating that the shutdown was explicitly rejected by an 
application, are not (NOT!) taken into account.

After this is done, an attempt is made to execute the command 
"/bin/sh /etc/rc.shutdown", if such a file (/etc/rc.shutdown) is 
known to exist. Here is an example of an rc.shutdown file:

# rc.shutdown
# Carry a random seed from shut-down to start-up
# Save 512 bytes, which is the size of the entropy pool

echo "Saving random seed..."
random_seed=/var/run/random-seed
dd if=/dev/urandom of=$random_seed count=1
chmod 600 $random_seed
exit 0

# end of rc.shutdown

Standard handles stdout and stderr are redirected to /dev/null while 
executing the script, so you DON'T see any text output from it.

After that, finally, Shutdown() is called.

CAUTION: the "Cold boot" option uses the extended Shutdown() call 
from FreeMiNT 1.15.4 and up. On older versions this will simply 
perform a warm start.

Have fun,

Draco/YC

Warszawa, 1.XI.1999.
