summaryrefslogtreecommitdiff
path: root/rc.shutdown
diff options
context:
space:
mode:
Diffstat (limited to 'rc.shutdown')
-rwxr-xr-xrc.shutdown24
1 files changed, 12 insertions, 12 deletions
diff --git a/rc.shutdown b/rc.shutdown
index db8f50b..5928b2d 100755
--- a/rc.shutdown
+++ b/rc.shutdown
@@ -19,6 +19,14 @@ run_hook shutdown_start
stop_all_daemons
+status "Shutting down UDev" udevadm control --exit
+
+status "Deactivating Swap" swapoff -a
+
+# stop monitoring of lvm2 groups before unmounting filesystems
+[[ $USELVM = [Yy][Ee][Ss] && -x $(type -P lvm) ]] &&
+ status "Deactivating monitoring of LVM2 groups" vgchange --monitor n
+
run_hook shutdown_prekillall
kill_all
@@ -31,26 +39,18 @@ stat_busy "Saving Random Seed"
POOL_FILE=/proc/sys/kernel/random/poolsize
if [[ -r $POOL_FILE ]]; then
read POOL_SIZE < $POOL_FILE
+ (( POOL_SIZE /= 8 ))
else
POOL_SIZE=512
fi
dd if=/dev/urandom of=$RANDOM_SEED count=1 bs=$POOL_SIZE &>/dev/null
stat_done
-[[ $TIMEZONE ]] &&
- status "Saving Time Zone" \
- cp --remove-destination "/usr/share/zoneinfo/$TIMEZONE" /etc/localtime
+[[ $TIMEZONE ]] && status "Configuring Time Zone" set_timezone "$TIMEZONE"
# Write to wtmp file before unmounting
halt -w
-status "Deactivating Swap" swapoff -a
-
-# stop monitoring of lvm2 groups before unmounting filesystems
-[[ $USELVM = [Yy][Ee][Ss] && -x $(type -P lvm) && -d /sys/block ]] &&
- status "Deactivating monitoring of LVM2 groups" \
- vgchange --monitor n &>/dev/null
-
# if we don't have devtmpfs support, /dev is mounted as tmpfs, so don't unmount it
status "Unmounting Filesystems" \
umount -a -r -t nodevtmpfs,notmpfs,nosysfs,noproc,nodevpts -O no_netdev
@@ -78,6 +78,8 @@ fi
[[ $USELVM = [Yy][Ee][Ss] && -x $(type -P lvm) && -d /sys/block ]] &&
status "Deactivating LVM2 groups" vgchange --sysinit -a n &>/dev/null
+run_hook shutdown_poweroff
+
if [[ -x /run/initramfs/shutdown ]]; then
# decide what we want to do
@@ -116,8 +118,6 @@ else
status "Remounting Root Filesystem Read-only" \
mount -n -o remount,ro /
- run_hook shutdown_poweroff
-
# Power off or reboot
printsep
if [[ $RUNLEVEL = 0 ]]; then