aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
Diffstat (limited to 'init')
-rw-r--r--init/console.conf16
-rw-r--r--init/control-alt-delete.conf8
-rw-r--r--init/plymouth-shutdown.conf24
-rw-r--r--init/prefdm.conf12
-rw-r--r--init/quit-plymouth.conf15
-rw-r--r--init/rc0.conf25
-rw-r--r--init/rc1.conf29
-rw-r--r--init/rc2.conf20
-rw-r--r--init/rc3.conf20
-rw-r--r--init/rc4.conf20
-rw-r--r--init/rc5.conf20
-rw-r--r--init/rc6.conf23
-rw-r--r--init/rcS-sulogin.conf22
-rw-r--r--init/rcS.conf31
-rw-r--r--init/serial.conf42
-rw-r--r--init/tty1.conf15
-rw-r--r--init/tty2.conf16
-rw-r--r--init/tty3.conf16
-rw-r--r--init/tty4.conf16
-rw-r--r--init/tty5.conf16
-rw-r--r--init/tty6.conf16
21 files changed, 422 insertions, 0 deletions
diff --git a/init/console.conf b/init/console.conf
new file mode 100644
index 00000000..732a3fa9
--- /dev/null
+++ b/init/console.conf
@@ -0,0 +1,16 @@
+# console - getty
+#
+# This service maintains a getty on console 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 console
diff --git a/init/control-alt-delete.conf b/init/control-alt-delete.conf
new file mode 100644
index 00000000..35cb1305
--- /dev/null
+++ b/init/control-alt-delete.conf
@@ -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/init/plymouth-shutdown.conf b/init/plymouth-shutdown.conf
new file mode 100644
index 00000000..d76dbd3f
--- /dev/null
+++ b/init/plymouth-shutdown.conf
@@ -0,0 +1,24 @@
+# plymouth-shutdown - put up shutdown splash
+#
+# This service triggers plymouth to put up a splash
+# when leaving runlevel 5.
+
+start on stopped prefdm
+
+console output
+script
+ set $(runlevel || true)
+ if [ "$2" != "0" ] && [ "$2" != "6" ]; then
+ exit 0
+ fi
+
+ /sbin/plymouthd --mode=shutdown || exit 1
+ /bin/plymouth --sysinit
+ /bin/plymouth --show-splash
+ if [ "$2" = "0" ]; then
+ /bin/plymouth message --text="Shutting down..."
+ elif [ "$2" = "6" ]; then
+ /bin/plymouth message --text="Restarting..."
+ fi
+end script
+
diff --git a/init/prefdm.conf b/init/prefdm.conf
new file mode 100644
index 00000000..7098bd76
--- /dev/null
+++ b/init/prefdm.conf
@@ -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/init/quit-plymouth.conf b/init/quit-plymouth.conf
new file mode 100644
index 00000000..13ac3880
--- /dev/null
+++ b/init/quit-plymouth.conf
@@ -0,0 +1,15 @@
+# quit-plymouth - script to stop boot splash
+#
+# This service triggers plymouth to quit when we reach the
+# end of the boot cycle. We start on 'stopping rcX' to make sure
+# this completes before the getty starts.
+# prefdm handles quit differently, though.
+
+start on runlevel S
+start on stopping rc2
+start on stopping rc3
+start on stopping rc4
+
+script
+ /usr/bin/plymouth quit || :
+end script
diff --git a/init/rc0.conf b/init/rc0.conf
new file mode 100644
index 00000000..11ce5a51
--- /dev/null
+++ b/init/rc0.conf
@@ -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 [!0]
+
+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/init/rc1.conf b/init/rc1.conf
new file mode 100644
index 00000000..38397b31
--- /dev/null
+++ b/init/rc1.conf
@@ -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 [!1]
+
+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 2>/dev/null
+ echo $"Telling INIT to go to single user mode."
+ exec telinit S
+end script
diff --git a/init/rc2.conf b/init/rc2.conf
new file mode 100644
index 00000000..6cc4d884
--- /dev/null
+++ b/init/rc2.conf
@@ -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 [!2]
+
+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/init/rc3.conf b/init/rc3.conf
new file mode 100644
index 00000000..47a4a639
--- /dev/null
+++ b/init/rc3.conf
@@ -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 [!3]
+
+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/init/rc4.conf b/init/rc4.conf
new file mode 100644
index 00000000..8e079f0e
--- /dev/null
+++ b/init/rc4.conf
@@ -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 [!4]
+
+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/init/rc5.conf b/init/rc5.conf
new file mode 100644
index 00000000..0ef6a400
--- /dev/null
+++ b/init/rc5.conf
@@ -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 [!5]
+
+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/init/rc6.conf b/init/rc6.conf
new file mode 100644
index 00000000..f9df8b4a
--- /dev/null
+++ b/init/rc6.conf
@@ -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 [!6]
+
+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/init/rcS-sulogin.conf b/init/rcS-sulogin.conf
new file mode 100644
index 00000000..d3aa20d1
--- /dev/null
+++ b/init/rcS-sulogin.conf
@@ -0,0 +1,22 @@
+# 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
+ plymouth --hide-splash || true
+ exec /bin/bash
+end script
+post-stop script
+ if [ "$1" = "S" ]; then
+ runlevel=$(/bin/awk -F ':' '$3 == "initdefault" && $1 !~ "^#" { print $2 }' /etc/inittab)
+ [ -z "$runlevel" ] && runlevel="3"
+ exec telinit $runlevel
+ fi
+end script
diff --git a/init/rcS.conf b/init/rcS.conf
new file mode 100644
index 00000000..1c0a54be
--- /dev/null
+++ b/init/rcS.conf
@@ -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" && $1 !~ "^#" { 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/init/serial.conf b/init/serial.conf
new file mode 100644
index 00000000..660e93bd
--- /dev/null
+++ b/init/serial.conf
@@ -0,0 +1,42 @@
+# Automatically start a configured serial console
+#
+# How this works:
+#
+# On boot, a udev helper examines /dev/console. If a serial console is the
+# primary console (last console on the commandline in grub), the event
+# 'fedora.serial-console-available <port name> <speed>' is emitted, which
+# triggers this script. It waits for the runlevel to finish, ensures
+# the proper port is in /etc/securetty, and starts the getty.
+#
+# If your serial console is not the primary console, or you want a getty
+# on serial even if it's not the console, create your own event by copying
+# /etc/event.d/tty[2-6], and changing the getty line in that file.
+
+start on fedora.serial-console-available *
+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
+ 2|3|4|5)
+ LANG=C /sbin/initctl status rc$runlevel | grep -wq "rc$runlevel (stop) waiting" && break
+ ;;
+ *)
+ ;;
+ esac
+ sleep 1
+ done
+ /sbin/securetty $1
+end script
+exec /sbin/agetty /dev/$1 $2 vt100-nav
+post-stop script
+ if [ "$UPSTART_EVENT" != "${UPSTART_EVENT##fedora.serial-console-available}" ]; then
+ initctl emit --no-wait fedora.serial-console-available $1 $2
+ fi
+end script
diff --git a/init/tty1.conf b/init/tty1.conf
new file mode 100644
index 00000000..7747d660
--- /dev/null
+++ b/init/tty1.conf
@@ -0,0 +1,15 @@
+# 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
+
+stop on runlevel 0
+stop on runlevel 1
+stop on runlevel 6
+
+respawn
+exec /sbin/mingetty tty1
diff --git a/init/tty2.conf b/init/tty2.conf
new file mode 100644
index 00000000..ec5f94cd
--- /dev/null
+++ b/init/tty2.conf
@@ -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/init/tty3.conf b/init/tty3.conf
new file mode 100644
index 00000000..ed95fdcf
--- /dev/null
+++ b/init/tty3.conf
@@ -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/init/tty4.conf b/init/tty4.conf
new file mode 100644
index 00000000..76b6d717
--- /dev/null
+++ b/init/tty4.conf
@@ -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/init/tty5.conf b/init/tty5.conf
new file mode 100644
index 00000000..9e9d8137
--- /dev/null
+++ b/init/tty5.conf
@@ -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/init/tty6.conf b/init/tty6.conf
new file mode 100644
index 00000000..7eb42c01
--- /dev/null
+++ b/init/tty6.conf
@@ -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