Zusätzliche Scripte für den Systemshutdown unter upstart
git-svn-id: svn://svn.compuextreme.de/Viitor/V962/Viitor_upstart@5507 504e572c-2e33-0410-9681-be2bf7408885
This commit is contained in:
parent
9df088532e
commit
fb2d38cb57
12
etc/init/halt.conf
Normal file
12
etc/init/halt.conf
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
description "halt system to poweroff"
|
||||||
|
author "Harald Kueller <harald.kueller@compuextreme.de>"
|
||||||
|
version 1.0
|
||||||
|
emits none special
|
||||||
|
|
||||||
|
start on ( runlevel [0] and ( stopped udev ))
|
||||||
|
|
||||||
|
console output
|
||||||
|
script
|
||||||
|
echo "System reboot in progress..."
|
||||||
|
/sbin/halt -f -p
|
||||||
|
end script
|
16
etc/init/ifdown.conf
Normal file
16
etc/init/ifdown.conf
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
description "Shutdown all network interfaces without Loopback"
|
||||||
|
author "Harald Kueller <harald.kueller@compuextreme.de>"
|
||||||
|
version 1.0
|
||||||
|
emits none special
|
||||||
|
|
||||||
|
start on stopping udev
|
||||||
|
|
||||||
|
console output
|
||||||
|
|
||||||
|
script
|
||||||
|
echo "Stopping network"
|
||||||
|
for IF in `ls -d /sys/class/net/*[^lo]`; do
|
||||||
|
DEVNAME=`basename $IF`
|
||||||
|
/sbin/if_down $DEVNAME
|
||||||
|
done
|
||||||
|
end script
|
11
etc/init/reboot.conf
Normal file
11
etc/init/reboot.conf
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
description "Force a reboot after all daemons are down"
|
||||||
|
author "Harald Kueller <harald.kueller@compuextreme.de>"
|
||||||
|
version 1.0
|
||||||
|
emits none special
|
||||||
|
|
||||||
|
start on ( runlevel [6] and ( stopped udev ))
|
||||||
|
|
||||||
|
script
|
||||||
|
echo "System reboot in progress..."
|
||||||
|
/sbin/reboot -f
|
||||||
|
end script
|
13
etc/init/sendsignals.conf
Normal file
13
etc/init/sendsignals.conf
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
description "Send all remaining prozesses the kill signal"
|
||||||
|
author "Harald Kueller <harald.kueller@compuextreme.de>"
|
||||||
|
version 1.0
|
||||||
|
emits none special
|
||||||
|
|
||||||
|
start on stopped udev
|
||||||
|
|
||||||
|
script
|
||||||
|
echo -n "sending all remaining processes the TERM signal"
|
||||||
|
killall -15
|
||||||
|
sleep 3
|
||||||
|
killall -9
|
||||||
|
end script
|
22
etc/init/umountfs.conf
Normal file
22
etc/init/umountfs.conf
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
description "Umount all Filesystems, and turn off swap"
|
||||||
|
author "Harald Kueller <harald.kueller@compuextreme.de>"
|
||||||
|
version 1.0
|
||||||
|
emits none special
|
||||||
|
|
||||||
|
stop on (runlevel[06] and (stopped udev))
|
||||||
|
|
||||||
|
stop on runlevel 6
|
||||||
|
stop on runlevel 0
|
||||||
|
|
||||||
|
console none
|
||||||
|
script
|
||||||
|
source /etc/init/functions
|
||||||
|
|
||||||
|
echo -n "Deactivating swap..."
|
||||||
|
/sbin/swapoff -a
|
||||||
|
evaluate_retval
|
||||||
|
|
||||||
|
echo -n "Unmounting file systems..."
|
||||||
|
/bin/umount -a -r
|
||||||
|
evaluate_retval
|
||||||
|
end script
|
20
etc/init/umountnfs.conf
Normal file
20
etc/init/umountnfs.conf
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
description "Mounting NFS Filesystems"
|
||||||
|
author "Harald Kueller <harald.kueller@compuextreme.de>"
|
||||||
|
version 1.0
|
||||||
|
emits none special
|
||||||
|
|
||||||
|
start on stopping nfsclient
|
||||||
|
|
||||||
|
console output
|
||||||
|
|
||||||
|
script
|
||||||
|
source /etc/init/functions
|
||||||
|
for i in `sed -e "/^#/d" /etc/fstab|awk '{print $2}'`; do
|
||||||
|
MOUNTPOINT=$i
|
||||||
|
FILESYSTEM=`awk '{if( $2 == "'$MOUNTPOINT'") print $3}' /etc/fstab`
|
||||||
|
if [ "$FILESYSTEM" == "nfs" ]; then
|
||||||
|
umount $MOUNTPOINT
|
||||||
|
status_message "umount NFS Filesystem from $MOUNTPOINT"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
end script
|
28
etc/init/unloadmodules.conf
Normal file
28
etc/init/unloadmodules.conf
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
description "Unload all Kernel Modules"
|
||||||
|
author "Harald Kueller <harald.kueller@compuextreme.de>"
|
||||||
|
version 1.0
|
||||||
|
emits none special
|
||||||
|
|
||||||
|
start on stopping udev
|
||||||
|
|
||||||
|
script
|
||||||
|
if [ -f /etc/sysconfig/loadmods ]; then
|
||||||
|
Z=0
|
||||||
|
while [ "$Z" "<" "9" ]; do
|
||||||
|
exec 3</proc/modules
|
||||||
|
while read <&3 MODNAME INFO; do
|
||||||
|
if rmmod -s $MODNAME &>/dev/null; then
|
||||||
|
print_status success
|
||||||
|
else
|
||||||
|
if [ "$Z" == "8" ]; then
|
||||||
|
print_status failure
|
||||||
|
else
|
||||||
|
echo "failed"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
(( Z = $Z + 1 ))
|
||||||
|
exec 3>&-
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
end script
|
Loading…
Reference in New Issue
Block a user