diff --git a/etc/init/halt.conf b/etc/init/halt.conf new file mode 100644 index 0000000..595c76e --- /dev/null +++ b/etc/init/halt.conf @@ -0,0 +1,12 @@ +description "halt system to poweroff" +author "Harald Kueller " +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 diff --git a/etc/init/ifdown.conf b/etc/init/ifdown.conf new file mode 100644 index 0000000..e7c73eb --- /dev/null +++ b/etc/init/ifdown.conf @@ -0,0 +1,16 @@ +description "Shutdown all network interfaces without Loopback" +author "Harald Kueller " +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 diff --git a/etc/init/reboot.conf b/etc/init/reboot.conf new file mode 100644 index 0000000..99c3262 --- /dev/null +++ b/etc/init/reboot.conf @@ -0,0 +1,11 @@ +description "Force a reboot after all daemons are down" +author "Harald Kueller " +version 1.0 +emits none special + +start on ( runlevel [6] and ( stopped udev )) + +script + echo "System reboot in progress..." + /sbin/reboot -f +end script diff --git a/etc/init/sendsignals.conf b/etc/init/sendsignals.conf new file mode 100644 index 0000000..7ca55b2 --- /dev/null +++ b/etc/init/sendsignals.conf @@ -0,0 +1,13 @@ +description "Send all remaining prozesses the kill signal" +author "Harald Kueller " +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 diff --git a/etc/init/umountfs.conf b/etc/init/umountfs.conf new file mode 100644 index 0000000..87c41f0 --- /dev/null +++ b/etc/init/umountfs.conf @@ -0,0 +1,22 @@ +description "Umount all Filesystems, and turn off swap" +author "Harald Kueller " +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 diff --git a/etc/init/umountnfs.conf b/etc/init/umountnfs.conf new file mode 100644 index 0000000..87763f9 --- /dev/null +++ b/etc/init/umountnfs.conf @@ -0,0 +1,20 @@ +description "Mounting NFS Filesystems" +author "Harald Kueller " +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 diff --git a/etc/init/unloadmodules.conf b/etc/init/unloadmodules.conf new file mode 100644 index 0000000..a9b883d --- /dev/null +++ b/etc/init/unloadmodules.conf @@ -0,0 +1,28 @@ +description "Unload all Kernel Modules" +author "Harald Kueller " +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/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