pfmt -l $LABEL -s info -g $CAT:71 "The system is coming down. Please wait.\n"
#INFO messages should not appear in screen, save them in shut.log
exec 4>&2 3>&1 2>/dev/null >/var/adm/shut.log
exec 2>&4
chmod 664 /var/adm/shut.log
umask 022
# The following segment is for historical purposes.
# There should be nothing in /etc/shutdown.d.
cd /etc/shutdown.d 2>/dev/null
if [ $? -eq 0 ]
then
for f in *
{
case $f in
\* ) ;;
* ) /sbin/sh ${f} ;;
esac
}
fi
# End of historical section
cd /etc/rc0.d 2>/dev/null
if [ $? -eq 0 ]
then
for f in K*
{
case $f in
K\* )
;;
* )
/sbin/sh ${f} stop
;;
esac
}
# system cleanup functions ONLY (things that end fast!)
for f in S*
{
case $f in
S\* ) ;;
* ) /sbin/sh ${f} start ;;
esac
}
fi
# Note that S* scripts had better terminate synchronously, or they will
# get caught here.
/usr/sbin/killall&
# PC 6300+ Style Installation - execute shutdown scripts from driver packages
cd /etc/idsd.d 2>/dev/null
if [ $? -eq 0 ]
then
for f in *
{
case $f in
\* ) ;;
* ) /sbin/sh ${f} ;;
esac
}
fi
exec 1>&3
trap "" 15
if [ -f /etc/conf/.copy_unix -a -f /etc/conf/cf.d/unix ]
then
/etc/conf/bin/idcpunix
fi
wait # for killall
# Check if user wants machine brought down or reboot.
# umountall will be done in uadmin if we are shutting down.
case "$ARG" in
off)
/sbin/uadmin 2 0
;;
firm)
/sbin/uadmin 2 2
;;
reboot)
/sbin/uadmin 2 1
;;
* )
sleep 10 # for killall to work
/sbin/umountall >/dev/null 2>&1
;;
esac
pfmt -l $LABEL -s warn -g $CAT:72 "\n\tUser level file systems may still be mounted.\n\tMake sure to umount those file systems if you\n\tare going to powerdown the system. Otherwise,\n\tthe file systems may be corrupted.\n\n"