summaryrefslogtreecommitdiffstats
path: root/source/a/sysvinit-scripts/scripts/rc.sysvinit
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.sysvinit
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.sysvinit')
-rw-r--r--source/a/sysvinit-scripts/scripts/rc.sysvinit58
1 files changed, 58 insertions, 0 deletions
diff --git a/source/a/sysvinit-scripts/scripts/rc.sysvinit b/source/a/sysvinit-scripts/scripts/rc.sysvinit
new file mode 100644
index 000000000..916e59ee4
--- /dev/null
+++ b/source/a/sysvinit-scripts/scripts/rc.sysvinit
@@ -0,0 +1,58 @@
+#!/bin/sh
+#
+# rc.sysvinit This file provides basic compatibility with SystemV style
+# startup scripts. The SystemV style init system places
+# start/stop scripts for each runlevel into directories such as
+# /etc/rc.d/rc3.d/ (for runlevel 3) instead of starting them
+# from /etc/rc.d/rc.M. This makes for a lot more init scripts,
+# and a more complicated execution path to follow through if
+# something goes wrong. For this reason, Slackware has always
+# used the traditional BSD style init script layout.
+#
+# However, many binary packages exist that install SystemV
+# init scripts. With rc.sysvinit in place, most well-written
+# startup scripts will work. This is primarily intended to
+# support commercial software, though, and probably shouldn't
+# be considered bug free.
+#
+# Written by Patrick Volkerding <volkerdi@slackware.com>, 1999
+# from an example by Miquel van Smoorenburg <miquels@cistron.nl>.
+
+# Run an init script:
+startup() {
+ case "$1" in
+ *.sh)
+ sh "$@"
+ ;;
+ *)
+ "$@"
+ ;;
+ esac
+}
+
+# Set onlcr to avoid staircase effect.
+stty onlcr 0>&1
+
+if [ "$runlevel" = "" ]; then
+ runlevel=$RUNLEVEL
+ export runlevel
+ prevlevel=$PREVLEVEL
+ export prevlevel
+fi
+
+# Run kill scripts in the previous runlevel if not "none"
+if [ ! "$prevlevel" = "N" ]; then
+ for script in /etc/rc.d/rc$prevlevel.d/K* ; do
+ if [ -x $script ]; then
+ startup $script stop
+ fi
+ done
+fi
+
+# Now do the startup scripts:
+for script in /etc/rc.d/rc$runlevel.d/S* ; do
+ if [ -x $script ]; then
+ startup $script start
+ fi
+done
+