aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2009-12-09 16:12:26 -0500
committerBill Nottingham <notting@redhat.com>2009-12-09 16:12:26 -0500
commit12dcbfe79bbc89b23f775bfd847eb53ec17b2971 (patch)
treede4e95b14ec6c0eb0b22450e70861e8c953cfeee /init
parent307e970174f12e4a808684151f132df1677c3999 (diff)
parent5df584569b80bb8977f181e16b0de47fb4df08f1 (diff)
downloadinitscripts-12dcbfe79bbc89b23f775bfd847eb53ec17b2971.tar
initscripts-12dcbfe79bbc89b23f775bfd847eb53ec17b2971.tar.gz
initscripts-12dcbfe79bbc89b23f775bfd847eb53ec17b2971.tar.bz2
initscripts-12dcbfe79bbc89b23f775bfd847eb53ec17b2971.tar.xz
initscripts-12dcbfe79bbc89b23f775bfd847eb53ec17b2971.zip
Merge branch 'upstart-0.6.0-branch'
Diffstat (limited to 'init')
-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.conf12
-rw-r--r--init/rc.conf14
-rw-r--r--init/rcS-sulogin.conf21
-rw-r--r--init/rcS.conf28
-rw-r--r--init/serial.conf25
-rw-r--r--init/start-ttys.conf15
-rw-r--r--init/tty.conf9
10 files changed, 168 insertions, 0 deletions
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..d47356c7
--- /dev/null
+++ b/init/prefdm.conf
@@ -0,0 +1,12 @@
+# prefdm - preferred display manager
+#
+# Starts gdm/xdm/etc by preference
+
+start on stopped rc RUNLEVEL=5
+
+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..8b2e6f6a
--- /dev/null
+++ b/init/quit-plymouth.conf
@@ -0,0 +1,12 @@
+# 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 or stopping rc RUNLEVEL=[234]
+
+script
+ /usr/bin/plymouth quit || :
+end script
diff --git a/init/rc.conf b/init/rc.conf
new file mode 100644
index 00000000..e7285e47
--- /dev/null
+++ b/init/rc.conf
@@ -0,0 +1,14 @@
+# rc - System V runlevel compatibility
+#
+# This task runs the old sysv-rc runlevel scripts. It
+# is usually started by the telinit compatibility wrapper.
+
+start on runlevel [0123456]
+
+stop on runlevel [!$RUNLEVEL]
+
+task
+
+export RUNLEVEL
+console output
+exec /etc/rc.d/rc $RUNLEVEL
diff --git a/init/rcS-sulogin.conf b/init/rcS-sulogin.conf
new file mode 100644
index 00000000..4f1f1f13
--- /dev/null
+++ b/init/rcS-sulogin.conf
@@ -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 [!S]
+
+console owner
+script
+ plymouth --hide-splash || true
+ exec /bin/bash
+end script
+post-stop script
+ if [ "$RUNLEVEL" = "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..51d52312
--- /dev/null
+++ b/init/rcS.conf
@@ -0,0 +1,28 @@
+# rcS - runlevel compatibility
+#
+# This task runs the old sysv-rc startup scripts.
+
+start on startup
+
+stop on runlevel
+
+task
+
+# 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
+exec /etc/rc.d/rc.sysinit
+post-stop script
+ if [ "$UPSTART_EVENTS" = "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..21aab580
--- /dev/null
+++ b/init/serial.conf
@@ -0,0 +1,25 @@
+# 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/init/tty.conf, and changing the getty line in that file.
+
+start on fedora.serial-console-available DEV=* and stopped rc RUNLEVEL=[2345]
+stop on runlevel [016]
+
+instance $DEV
+pre-start exec /sbin/securetty $DEV
+exec /sbin/agetty /dev/$DEV $SPEED vt100-nav
+post-stop script
+ if [ "$UPSTART_EVENTS" != "${UPSTART_EVENTS##fedora.serial-console-available}" ]; then
+ initctl emit --no-wait fedora.serial-console-available DEV=$DEV SPEED=$SPEED
+ fi
+end script
diff --git a/init/start-ttys.conf b/init/start-ttys.conf
new file mode 100644
index 00000000..1528cf4b
--- /dev/null
+++ b/init/start-ttys.conf
@@ -0,0 +1,15 @@
+#
+# This service starts the configured number of gettys.
+
+start on stopped rc RUNLEVEL=[2345]
+
+env ACTIVE_CONSOLES=/dev/tty[1-6]
+env X_TTY=/dev/tty1
+task
+script
+ . /etc/sysconfig/init
+ for tty in $(echo $ACTIVE_CONSOLES) ; do
+ [ "$RUNLEVEL" = "5" -a "$tty" = "$X_TTY" ] && continue
+ initctl start tty TTY=$tty
+ done
+end script
diff --git a/init/tty.conf b/init/tty.conf
new file mode 100644
index 00000000..251e1139
--- /dev/null
+++ b/init/tty.conf
@@ -0,0 +1,9 @@
+# tty - getty
+#
+# This service maintains a getty on the sepcified device.
+
+stop on runlevel [016]
+
+respawn
+instance $TTY
+exec /sbin/mingetty $TTY