summaryrefslogtreecommitdiffstats
path: root/source/a/sysvinit-scripts/scripts/rc.K
diff options
context:
space:
mode:
author Patrick J Volkerding <volkerdi@slackware.com>2009-08-26 10:00:38 -0500
committer Eric Hameleers <alien@slackware.com>2018-05-31 22:41:17 +0200
commit5a12e7c134274dba706667107d10d231517d3e05 (patch)
tree55718d5acb710fde798d9f38d0bbaf594ed4b296 /source/a/sysvinit-scripts/scripts/rc.K
downloadcurrent-5a12e7c134274dba706667107d10d231517d3e05.tar.gz
current-5a12e7c134274dba706667107d10d231517d3e05.tar.xz
Slackware 13.0slackware-13.0
Wed Aug 26 10:00:38 CDT 2009 Slackware 13.0 x86_64 is released as stable! Thanks to everyone who helped make this release possible -- see the RELEASE_NOTES for the credits. The ISOs are off to the replicator. This time it will be a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD. We're taking pre-orders now at store.slackware.com. Please consider picking up a copy to help support the project. Once again, thanks to the entire Slackware community for all the help testing and fixing things and offering suggestions during this development cycle. As always, have fun and enjoy! -P.
Diffstat (limited to 'source/a/sysvinit-scripts/scripts/rc.K')
-rw-r--r--source/a/sysvinit-scripts/scripts/rc.K106
1 files changed, 106 insertions, 0 deletions
diff --git a/source/a/sysvinit-scripts/scripts/rc.K b/source/a/sysvinit-scripts/scripts/rc.K
new file mode 100644
index 000000000..68609753a
--- /dev/null
+++ b/source/a/sysvinit-scripts/scripts/rc.K
@@ -0,0 +1,106 @@
+#! /bin/sh
+#
+# rc.K This file is executed by init when it goes into runlevel
+# 1, which is the administrative state. It kills all
+# daemons and then puts the system into single user mode.
+# Note that the file systems are kept mounted.
+#
+# Version: @(#)/etc/rc.d/rc.K 3.1415 Sat Jan 13 13:37:26 PST 2001
+#
+# Author: Miquel van Smoorenburg <miquels@drinkel.nl.mugnet.org>
+# Modified by: Patrick J. Volkerding <volkerdi@slackware.com>
+#
+
+# Set the path.
+PATH=/sbin:/bin:/usr/bin:/usr/sbin
+
+# Load any needed keyboard mappings:
+if [ -x /etc/rc.d/rc.keymap ]; then
+ . /etc/rc.d/rc.keymap
+fi
+
+# If there are SystemV init scripts for this runlevel, run them.
+if [ -x /etc/rc.d/rc.sysvinit ]; then
+ . /etc/rc.d/rc.sysvinit
+fi
+
+# Try to turn off quota:
+if grep -q quota /etc/fstab ; then
+ if [ -x /sbin/quotaoff ]; then
+ echo "Turning off filesystem quotas."
+ /sbin/quotaoff -a
+ fi
+fi
+
+# Try to turn off accounting:
+if [ -x /sbin/accton -a -r /var/log/pacct ]; then
+ /sbin/accton off
+fi
+
+# Run any local shutdown scripts:
+if [ -x /etc/rc.d/rc.local_shutdown ]; then
+ /etc/rc.d/rc.local_shutdown stop
+fi
+
+# Stop the Apache web server:
+if [ -x /etc/rc.d/rc.httpd ]; then
+ /etc/rc.d/rc.httpd stop
+fi
+
+# Stop the Samba server:
+if [ -x /etc/rc.d/rc.samba ]; then
+ . /etc/rc.d/rc.samba stop
+fi
+
+# Shut down the NFS server:
+if [ -x /etc/rc.d/rc.nfsd ]; then
+ /etc/rc.d/rc.nfsd stop
+fi
+
+# Unmount any NFS, SMB, or CIFS filesystems:
+echo "Unmounting remote filesystems."
+umount -a -r -t nfs,smbfs,cifs
+
+# Shut down PCMCIA devices:
+if [ -x /etc/rc.d/rc.pcmcia ] ; then
+ . /etc/rc.d/rc.pcmcia stop
+ # The cards might need a little extra time here to deactivate:
+ sleep 5
+fi
+
+# Terminate acpid before syslog:
+if [ -x /etc/rc.d/rc.acpid -a -r /var/run/acpid.pid ]; then # quit
+ . /etc/rc.d/rc.acpid stop
+fi
+
+# Kill all processes.
+echo
+echo "Sending all processes the SIGHUP signal."
+killall5 -1
+echo -n "Waiting for processes to hang up"
+for loop in 0 1 2 3 4 5 ; do
+ sleep 1
+ echo -n "."
+done
+echo
+echo "Sending all processes the SIGTERM signal."
+killall5 -15
+echo -n "Waiting for processes to terminate"
+for loop in 0 1 2 3 4 5 ; do
+ sleep 1
+ echo -n "."
+done
+echo
+echo "Sending all processes the SIGKILL signal."
+killall5 -9
+echo -n "Waiting for processes to exit"
+for loop in 0 1 2 3 4 5 ; do
+ sleep 1
+ echo -n "."
+done
+echo
+
+# Now go to the single user level
+echo "Going to single user mode..."
+telinit -t 1 1
+