aboutsummaryrefslogtreecommitdiffstats
path: root/event.d
diff options
context:
space:
mode:
Diffstat (limited to 'event.d')
-rw-r--r--event.d/control-alt-delete8
-rw-r--r--event.d/prefdm12
-rw-r--r--event.d/rc025
-rw-r--r--event.d/rc129
-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/rcS31
-rw-r--r--event.d/rcS-sulogin21
-rw-r--r--event.d/serial4
-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, 347 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..7098bd76
--- /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
+respawn
+respawn limit 10 120
+exec /etc/X11/prefdm -nodaemon
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..5ad47bbe
--- /dev/null
+++ b/event.d/rc1
@@ -0,0 +1,29 @@
+# rc1 - runlevel 1 compatibility
+#
+# This task runs the old sysv-rc runlevel 1 ("single-user") scripts.
+# /etc/rc.d/rc 1 will run the /etc/rc.d/rc1.d scripts.
+# telinit S will run whichever task has "start on runlevel S",
+# normally /etc/event.d/rcS-sulogin
+
+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
+post-stop script
+ clear
+ TEXTDOMAIN=initscripts
+ . /etc/profile.d/lang.sh
+ echo $"Telling INIT to go to single user mode."
+ exec telinit S
+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..b01ddc57
--- /dev/null
+++ b/event.d/rcS
@@ -0,0 +1,31 @@
+# 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
+
+ /etc/rc.d/rc.sysinit
+ runlevel --reboot || true
+end script
+post-stop script
+ if [ "$UPSTART_EVENT" == "startup" ]; then
+ runlevel=$(/bin/awk -F ':' '$3 == "initdefault" { print $2 }' /etc/inittab)
+ [ -z "$runlevel" ] && runlevel="3"
+ for t in $(cat /proc/cmdline); do
+ case $t in
+ -s|single|S|s) runlevel="S" ;;
+ [1-9]) runlevel="$t" ;;
+ esac
+ done
+ exec telinit $runlevel
+ fi
+end script
diff --git a/event.d/rcS-sulogin b/event.d/rcS-sulogin
new file mode 100644
index 00000000..59a0b4d3
--- /dev/null
+++ b/event.d/rcS-sulogin
@@ -0,0 +1,21 @@
+# rcS-sulogin - "single-user" runlevel compatibility
+#
+# This task runs /bin/bash during "single-user" mode,
+# then continues to the default runlevel.
+
+start on runlevel S
+
+stop on runlevel
+
+console owner
+script
+ runlevel --set S >/dev/null || true
+ exec /bin/bash
+end script
+post-stop script
+ if [ "$1" = "S" ]; then
+ runlevel=$(/bin/awk -F ':' '$3 == "initdefault" { print $2 }' /etc/inittab)
+ [ -z "$runlevel" ] && runlevel="3"
+ exec telinit $runlevel
+ fi
+end script
diff --git a/event.d/serial b/event.d/serial
index 80695338..6869090e 100644
--- a/event.d/serial
+++ b/event.d/serial
@@ -4,6 +4,10 @@ stop on runlevel [016]
instance
pre-start script
+ while /bin/true ; do
+ LANG=C /sbin/initctl status rcS | grep -wq "rcS (stop) waiting" && break
+ sleep 1
+ done
while /bin/true ; do
runlevel=$(/sbin/runlevel | /bin/awk '{ print $2 }')
case "$runlevel" in
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..f0002ae3
--- /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 started prefdm
+
+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..ec5f94cd
--- /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 started prefdm
+
+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..ed95fdcf
--- /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 started prefdm
+
+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..76b6d717
--- /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 started prefdm
+
+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..9e9d8137
--- /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 started prefdm
+
+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..7eb42c01
--- /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 started prefdm
+
+stop on runlevel 0
+stop on runlevel 1
+stop on runlevel 6
+
+respawn
+exec /sbin/mingetty tty6