aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d/halt
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>1999-02-04 01:03:34 +0000
committerBill Nottingham <notting@redhat.com>1999-02-04 01:03:34 +0000
commite8d2f95c03d1df94ca6ab9bab11f0f1d8e8c5893 (patch)
tree3b299a1b638cf16e4d9574318b683851395f6e4c /rc.d/init.d/halt
parent2aa519f20375260f6e22d408e8bce7fabf2140b6 (diff)
downloadinitscripts-e8d2f95c03d1df94ca6ab9bab11f0f1d8e8c5893.tar
initscripts-e8d2f95c03d1df94ca6ab9bab11f0f1d8e8c5893.tar.gz
initscripts-e8d2f95c03d1df94ca6ab9bab11f0f1d8e8c5893.tar.bz2
initscripts-e8d2f95c03d1df94ca6ab9bab11f0f1d8e8c5893.tar.xz
initscripts-e8d2f95c03d1df94ca6ab9bab11f0f1d8e8c5893.zip
bugfixes...
Diffstat (limited to 'rc.d/init.d/halt')
-rwxr-xr-xrc.d/init.d/halt22
1 files changed, 14 insertions, 8 deletions
diff --git a/rc.d/init.d/halt b/rc.d/init.d/halt
index 3d6df5cc..61eab7b3 100755
--- a/rc.d/init.d/halt
+++ b/rc.d/init.d/halt
@@ -11,6 +11,14 @@
# Set the path.
PATH=/sbin:/bin:/usr/bin:/usr/sbin
+. /etc/rc.d/init.d/functions
+
+runcmd() {
+ echo -n $1
+ shift
+ $* && echo_success -n || echo_failure -n
+}
+
# See how we were called.
case "$0" in
*halt)
@@ -30,22 +38,22 @@ esac
# Kill all processes.
[ "${BASH+bash}" = bash ] && enable kill
-action "Sending all processes the TERM signal..." kill -15 -1
+runcmd "Sending all processes the TERM signal..." kill -15 -1
sleep 5
-action "Sending all processes the KILL signal.." kill -9 -1
+runcmd "Sending all processes the KILL signal.." kill -9 -1
# Write to wtmp file before unmounting /var
halt -w
# Turn off swap, then unmount file systems.
-action "Turning off swap and accounting" swapoff -a
+runcmd "Turning off swap and accounting" swapoff -a
[ -x /sbin/accton ] && /sbin/accton
-action "Unmounting file systems" umount -a -f
+runcmd "Unmounting file systems" umount -a -f
mount -n -o remount,ro /
# turn off raid
if [ -x /sbin/raidstop -a -f /etc/raidtab ]; then
- action "Turning off RAID" /sbin/raidstop -a
+ runcmd "Turning off RAID" /sbin/raidstop -a
fi
# Remount read only anything that's left mounted.
@@ -58,9 +66,7 @@ done
echo "$message"
if [ -f /fastboot ]; then
echo "On the next boot fsck will be skipped."
-elif [ -f /forcefsck ];
+elif [ -f /forcefsck ]; then
echo "On the next boot fsck will be forced."
fi
eval $command -i -d -p
-
-