4 changed files with 82 additions and 10 deletions
@ -1,3 +0,0 @@ |
|||||
#!/bin/sh |
|
||||
|
|
||||
halt -d -f -p |
|
@ -0,0 +1,21 @@ |
|||||
|
#!/bin/sh |
||||
|
### BEGIN INIT INFO |
||||
|
# Provides: sendsigs |
||||
|
# Required-Start: |
||||
|
# Required-Stop: umountnfs |
||||
|
# Default-Start: |
||||
|
# Default-Stop: 0 6 |
||||
|
# Short-Description: Kill all remaining processes. |
||||
|
# Description: |
||||
|
### END INIT INFO |
||||
|
|
||||
|
PATH=/sbin:/bin:/usr/sbin:/usr/bin |
||||
|
|
||||
|
# Kill all processes. |
||||
|
echo "Sending all processes the TERM signal..." |
||||
|
killall5 -15 |
||||
|
sleep 5 |
||||
|
echo "Sending all processes the KILL signal..." |
||||
|
killall5 -9 |
||||
|
|
||||
|
: exit 0 |
@ -0,0 +1,47 @@ |
|||||
|
#!/bin/sh |
||||
|
# |
||||
|
# umountfs Turn off swap and unmount all local filesystems. |
||||
|
# |
||||
|
|
||||
|
PATH=/sbin:/bin:/usr/sbin:/usr/bin |
||||
|
|
||||
|
# Ensure /proc is mounted |
||||
|
test -r /proc/mounts || mount -t proc proc /proc |
||||
|
|
||||
|
echo "Deactivating swap..." |
||||
|
swapoff -a |
||||
|
|
||||
|
# Sleep give epg time to save |
||||
|
sleep 5 |
||||
|
|
||||
|
# We leave /proc mounted, the umount of /dev/devpts seems to fail |
||||
|
# quite frequently, the busybox umount apparently gives up at the |
||||
|
# first failure, so it is necessary to go file system by file |
||||
|
# system. It is necessary to go backward in the /proc list, because |
||||
|
# later things may have been mounted on earlier mounts. |
||||
|
unmount() { |
||||
|
local dev mp type opts |
||||
|
if read dev mp type opts |
||||
|
then |
||||
|
# recurse - unmount later items |
||||
|
unmount |
||||
|
# skip / and needed virtual filesystems |
||||
|
case "$mp" in |
||||
|
/|/dev|/proc|/sys) return 0;; |
||||
|
esac |
||||
|
# then unmount this, if possible, otherwise make |
||||
|
# it read-only |
||||
|
umount -f -r "$mp" |
||||
|
fi |
||||
|
} |
||||
|
|
||||
|
echo "Unmounting local filesystems..." |
||||
|
unmount </proc/mounts |
||||
|
|
||||
|
mount -o remount,ro / |
||||
|
|
||||
|
# sync to flush pending writes for loop-mounted file system. |
||||
|
sync |
||||
|
|
||||
|
echo "umountfs Good Bye..." |
||||
|
exit 0 |
Loading…
Reference in new issue