aboutsummaryrefslogtreecommitdiffstats
path: root/event.d
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2008-04-25 14:11:19 -0400
committerBill Nottingham <notting@redhat.com>2008-04-25 14:11:19 -0400
commitae9e1c75a5e24e4f2c9d60eb4b8838e0b043ec7d (patch)
tree7b44214900272a19a12fda18cbf40e1ca5c3ef88 /event.d
parent75fdd9450caffedebf73d6a3563592d46dca3a43 (diff)
downloadinitscripts-ae9e1c75a5e24e4f2c9d60eb4b8838e0b043ec7d.tar
initscripts-ae9e1c75a5e24e4f2c9d60eb4b8838e0b043ec7d.tar.gz
initscripts-ae9e1c75a5e24e4f2c9d60eb4b8838e0b043ec7d.tar.bz2
initscripts-ae9e1c75a5e24e4f2c9d60eb4b8838e0b043ec7d.tar.xz
initscripts-ae9e1c75a5e24e4f2c9d60eb4b8838e0b043ec7d.zip
Import from event-compat-sysv-0.3.9-8.fc9
Diffstat (limited to 'event.d')
-rw-r--r--event.d/control-alt-delete8
-rw-r--r--event.d/prefdm12
-rw-r--r--event.d/rc-default22
-rw-r--r--event.d/rc025
-rw-r--r--event.d/rc119
-rw-r--r--event.d/rc220
-rw-r--r--event.d/rc320
-rw-r--r--event.d/rc420
-rw-r--r--event.d/rc520
-rw-r--r--event.d/rc623
-rw-r--r--event.d/rcS25
-rw-r--r--event.d/rcS-sulogin25
-rw-r--r--event.d/sulogin18
-rw-r--r--event.d/tty116
-rw-r--r--event.d/tty216
-rw-r--r--event.d/tty316
-rw-r--r--event.d/tty416
-rw-r--r--event.d/tty516
-rw-r--r--event.d/tty616
19 files changed, 353 insertions, 0 deletions
diff --git a/event.d/control-alt-delete b/event.d/control-alt-delete
new file mode 100644
index 00000000..35cb1305
--- /dev/null
+++ b/event.d/control-alt-delete
@@ -0,0 +1,8 @@
+# control-alt-delete - emergency keypress handling
+#
+# This task is run whenever the Control-Alt-Delete key combination is
+# pressed. Usually used to shut down the machine.
+
+start on control-alt-delete
+
+exec /sbin/shutdown -r now "Control-Alt-Delete pressed"
diff --git a/event.d/prefdm b/event.d/prefdm
new file mode 100644
index 00000000..e53d18d8
--- /dev/null
+++ b/event.d/prefdm
@@ -0,0 +1,12 @@
+# prefdm - preferred display manager
+#
+# Starts gdm/xdm/etc by preference
+
+start on stopped rc5
+
+stop on runlevel [!5]
+
+console output
+script
+ exec /etc/X11/prefdm -nodaemon
+end script
diff --git a/event.d/rc-default b/event.d/rc-default
new file mode 100644
index 00000000..9160062b
--- /dev/null
+++ b/event.d/rc-default
@@ -0,0 +1,22 @@
+# rc - runlevel compatibility
+#
+# This task guesses what the "default runlevel" should be and starts the
+# appropriate script.
+
+start on stopped rcS
+
+script
+ runlevel --reboot || true
+
+ RL="2"
+ if [ -r /etc/inittab ]; then
+ RL="$(sed -n -e "/^id:[0-9]*:initdefault:/{s/^id://;s/:.*//;p}" /etc/inittab || true)"
+ fi
+ for t in $(cat /proc/cmdline); do
+ case $t in
+ -s|single|S) RL="S" ;;
+ [1-9]) RL="$t" ;;
+ esac
+ done
+ telinit $RL
+end script
diff --git a/event.d/rc0 b/event.d/rc0
new file mode 100644
index 00000000..63de616b
--- /dev/null
+++ b/event.d/rc0
@@ -0,0 +1,25 @@
+# rc0 - runlevel 0 compatibility
+#
+# This task runs the old sysv-rc runlevel 0 ("halt/poweroff") scripts with
+# the decision as to whether to halt or power off the system left up to the
+# script (and thus /etc/default/poweroff).
+
+start on runlevel 0
+
+stop on runlevel
+
+console output
+script
+ set $(runlevel || true)
+ if [ "$2" != "0" ] && [ "$2" != "6" ]; then
+ set $(runlevel --set 0 || true)
+ fi
+
+ if [ "$1" != "unknown" ]; then
+ PREVLEVEL=$1
+ RUNLEVEL=$2
+ export PREVLEVEL RUNLEVEL
+ fi
+
+ exec /etc/rc.d/rc 0
+end script
diff --git a/event.d/rc1 b/event.d/rc1
new file mode 100644
index 00000000..35de4d3e
--- /dev/null
+++ b/event.d/rc1
@@ -0,0 +1,19 @@
+# rc1 - runlevel 1 compatibility
+#
+# This task runs the old sysv-rc runlevel 1 ("single-user") scripts.
+
+start on runlevel 1
+
+stop on runlevel
+
+console output
+script
+ set $(runlevel --set 1 || true)
+ if [ "$1" != "unknown" ]; then
+ PREVLEVEL=$1
+ RUNLEVEL=$2
+ export PREVLEVEL RUNLEVEL
+ fi
+
+ exec /etc/rc.d/rc 1
+end script
diff --git a/event.d/rc2 b/event.d/rc2
new file mode 100644
index 00000000..1e0ab677
--- /dev/null
+++ b/event.d/rc2
@@ -0,0 +1,20 @@
+# rc2 - runlevel 2 compatibility
+#
+# This task runs the old sysv-rc runlevel 2 ("multi-user") scripts. It
+# is usually started by the telinit compatibility wrapper.
+
+start on runlevel 2
+
+stop on runlevel
+
+console output
+script
+ set $(runlevel --set 2 || true)
+ if [ "$1" != "unknown" ]; then
+ PREVLEVEL=$1
+ RUNLEVEL=$2
+ export PREVLEVEL RUNLEVEL
+ fi
+
+ exec /etc/rc.d/rc 2
+end script
diff --git a/event.d/rc3 b/event.d/rc3
new file mode 100644
index 00000000..785c98aa
--- /dev/null
+++ b/event.d/rc3
@@ -0,0 +1,20 @@
+# rc3 - runlevel 3 compatibility
+#
+# This task runs the old sysv-rc runlevel 3 (user defined) scripts. It
+# is usually started by the telinit compatibility wrapper.
+
+start on runlevel 3
+
+stop on runlevel
+
+console output
+script
+ set $(runlevel --set 3 || true)
+ if [ "$1" != "unknown" ]; then
+ PREVLEVEL=$1
+ RUNLEVEL=$2
+ export PREVLEVEL RUNLEVEL
+ fi
+
+ exec /etc/rc.d/rc 3
+end script
diff --git a/event.d/rc4 b/event.d/rc4
new file mode 100644
index 00000000..590eebbc
--- /dev/null
+++ b/event.d/rc4
@@ -0,0 +1,20 @@
+# rc4 - runlevel 4 compatibility
+#
+# This task runs the old sysv-rc runlevel 4 (user defined) scripts. It
+# is usually started by the telinit compatibility wrapper.
+
+start on runlevel 4
+
+stop on runlevel
+
+console output
+script
+ set $(runlevel --set 4 || true)
+ if [ "$1" != "unknown" ]; then
+ PREVLEVEL=$1
+ RUNLEVEL=$2
+ export PREVLEVEL RUNLEVEL
+ fi
+
+ exec /etc/rc.d/rc 4
+end script
diff --git a/event.d/rc5 b/event.d/rc5
new file mode 100644
index 00000000..69ca88a7
--- /dev/null
+++ b/event.d/rc5
@@ -0,0 +1,20 @@
+# rc5 - runlevel 5 compatibility
+#
+# This task runs the old sysv-rc runlevel 5 (user defined) scripts. It
+# is usually started by the telinit compatibility wrapper.
+
+start on runlevel 5
+
+stop on runlevel
+
+console output
+script
+ set $(runlevel --set 5 || true)
+ if [ "$1" != "unknown" ]; then
+ PREVLEVEL=$1
+ RUNLEVEL=$2
+ export PREVLEVEL RUNLEVEL
+ fi
+
+ exec /etc/rc.d/rc 5
+end script
diff --git a/event.d/rc6 b/event.d/rc6
new file mode 100644
index 00000000..c40f708d
--- /dev/null
+++ b/event.d/rc6
@@ -0,0 +1,23 @@
+# rc6 - runlevel 6 compatibility
+#
+# This task runs the old sysv-rc runlevel 6 ("reboot") scripts.
+
+start on runlevel 6
+
+stop on runlevel
+
+console output
+script
+ set $(runlevel || true)
+ if [ "$2" != "0" ] && [ "$2" != "6" ]; then
+ set $(runlevel --set 6 || true)
+ fi
+
+ if [ "$1" != "unknown" ]; then
+ PREVLEVEL=$1
+ RUNLEVEL=$2
+ export PREVLEVEL RUNLEVEL
+ fi
+
+ exec /etc/rc.d/rc 6
+end script
diff --git a/event.d/rcS b/event.d/rcS
new file mode 100644
index 00000000..7717e3bd
--- /dev/null
+++ b/event.d/rcS
@@ -0,0 +1,25 @@
+# rcS - runlevel compatibility
+#
+# This task runs the old sysv-rc startup scripts.
+
+start on startup
+
+stop on runlevel
+
+# Note: there can be no previous runlevel here, if we have one it's bad
+# information (we enter rc1 not rcS for maintenance). Run /etc/rc.d/rc
+# without information so that it defaults to previous=N runlevel=S.
+console output
+script
+ runlevel --set S >/dev/null || true
+
+ #set $(runlevel --set S || true)
+ #if [ "$1" != "unknown" ]; then
+ # PREVLEVEL=$1
+ # RUNLEVEL=$2
+ # export PREVLEVEL RUNLEVEL
+ #fi
+
+ exec /etc/rc.d/rc.sysinit
+ exec /etc/rc.d/rc S
+end script
diff --git a/event.d/rcS-sulogin b/event.d/rcS-sulogin
new file mode 100644
index 00000000..ba5eea2e
--- /dev/null
+++ b/event.d/rcS-sulogin
@@ -0,0 +1,25 @@
+# rcS-sulogin - "single-user" runlevel compatibility
+#
+# This task runs the sulogin binary during "single-user" mode.
+
+start on runlevel S
+
+stop on runlevel
+
+console owner
+
+script
+ runlevel --set S >/dev/null || true
+ /bin/bash
+
+ if [ -r /etc/inittab ]; then
+ RL="$(sed -n -e "/^id:[0-9]*:initdefault:/{s/^id://;s/:.*//;p}" /etc/inittab || true)"
+ if [ -n "$RL" ]; then
+ telinit $RL
+ else
+ telinit 2
+ fi
+ else
+ telinit 2
+ fi
+end script
diff --git a/event.d/sulogin b/event.d/sulogin
new file mode 100644
index 00000000..931fb062
--- /dev/null
+++ b/event.d/sulogin
@@ -0,0 +1,18 @@
+# sulogin - rescue mode
+#
+# This task ensures that should the system fail to have any active jobs
+# that the system administrator can rescue it; by giving them a shell.
+
+#start on stalled
+
+exec /sbin/sulogin
+console owner
+
+pre-start script
+ echo
+ echo "The system has reached a state where there are no jobs running."
+ echo "A shell will be spawned so that you may start such jobs that are"
+ echo "necessary."
+ echo
+ echo "Type 'exit' when finished."
+end script
diff --git a/event.d/tty1 b/event.d/tty1
new file mode 100644
index 00000000..bbeb0d9f
--- /dev/null
+++ b/event.d/tty1
@@ -0,0 +1,16 @@
+# tty1 - getty
+#
+# This service maintains a getty on tty1 from the point the system is
+# started until it is shut down again.
+
+start on stopped rc2
+start on stopped rc3
+start on stopped rc4
+start on stopped rc5
+
+stop on runlevel 0
+stop on runlevel 1
+stop on runlevel 6
+
+respawn
+exec /sbin/mingetty tty1
diff --git a/event.d/tty2 b/event.d/tty2
new file mode 100644
index 00000000..bf496f89
--- /dev/null
+++ b/event.d/tty2
@@ -0,0 +1,16 @@
+# tty2 - getty
+#
+# This service maintains a getty on tty2 from the point the system is
+# started until it is shut down again.
+
+start on stopped rc2
+start on stopped rc3
+start on stopped rc4
+start on stopped rc5
+
+stop on runlevel 0
+stop on runlevel 1
+stop on runlevel 6
+
+respawn
+exec /sbin/mingetty tty2
diff --git a/event.d/tty3 b/event.d/tty3
new file mode 100644
index 00000000..4801aa8d
--- /dev/null
+++ b/event.d/tty3
@@ -0,0 +1,16 @@
+# tty3 - getty
+#
+# This service maintains a getty on tty3 from the point the system is
+# started until it is shut down again.
+
+start on stopped rc2
+start on stopped rc3
+start on stopped rc4
+start on stopped rc5
+
+stop on runlevel 0
+stop on runlevel 1
+stop on runlevel 6
+
+respawn
+exec /sbin/mingetty tty3
diff --git a/event.d/tty4 b/event.d/tty4
new file mode 100644
index 00000000..0a6a08d8
--- /dev/null
+++ b/event.d/tty4
@@ -0,0 +1,16 @@
+# tty4 - getty
+#
+# This service maintains a getty on tty4 from the point the system is
+# started until it is shut down again.
+
+start on stopped rc2
+start on stopped rc3
+start on stopped rc4
+start on stopped rc5
+
+stop on runlevel 0
+stop on runlevel 1
+stop on runlevel 6
+
+respawn
+exec /sbin/mingetty tty4
diff --git a/event.d/tty5 b/event.d/tty5
new file mode 100644
index 00000000..269fa658
--- /dev/null
+++ b/event.d/tty5
@@ -0,0 +1,16 @@
+# tty5 - getty
+#
+# This service maintains a getty on tty5 from the point the system is
+# started until it is shut down again.
+
+start on stopped rc2
+start on stopped rc3
+start on stopped rc4
+start on stopped rc5
+
+stop on runlevel 0
+stop on runlevel 1
+stop on runlevel 6
+
+respawn
+exec /sbin/mingetty tty5
diff --git a/event.d/tty6 b/event.d/tty6
new file mode 100644
index 00000000..aaeb6936
--- /dev/null
+++ b/event.d/tty6
@@ -0,0 +1,16 @@
+# tty6 - getty
+#
+# This service maintains a getty on tty6 from the point the system is
+# started until it is shut down again.
+
+start on stopped rc2
+start on stopped rc3
+start on stopped rc4
+start on stopped rc5
+
+stop on runlevel 0
+stop on runlevel 1
+stop on runlevel 6
+
+respawn
+exec /sbin/mingetty tty6