diff options
author | Bill Nottingham <notting@redhat.com> | 2009-12-03 14:37:12 -0500 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2009-12-03 14:37:12 -0500 |
commit | dac32879b0de17d721457801fac65604f937ef00 (patch) | |
tree | db117621e728b4141cdf538e10ec53d731d81e42 /init | |
parent | 79b2b232cb34f7df3e440968240975e44c4b8fc7 (diff) | |
download | initscripts-dac32879b0de17d721457801fac65604f937ef00.tar initscripts-dac32879b0de17d721457801fac65604f937ef00.tar.gz initscripts-dac32879b0de17d721457801fac65604f937ef00.tar.bz2 initscripts-dac32879b0de17d721457801fac65604f937ef00.tar.xz initscripts-dac32879b0de17d721457801fac65604f937ef00.zip |
Coalesce the multiple rcX and ttyX jobs into single files.
Adjust other jobs accordingly.
Use a configuration parameter for what ttys to start.
Diffstat (limited to 'init')
-rw-r--r-- | init/console.conf | 16 | ||||
-rw-r--r-- | init/prefdm.conf | 2 | ||||
-rw-r--r-- | init/quit-plymouth.conf | 5 | ||||
-rw-r--r-- | init/rc0.conf | 25 | ||||
-rw-r--r-- | init/rc1.conf | 29 | ||||
-rw-r--r-- | init/rc2.conf | 20 | ||||
-rw-r--r-- | init/rc3.conf | 20 | ||||
-rw-r--r-- | init/rc4.conf | 20 | ||||
-rw-r--r-- | init/rc5.conf | 20 | ||||
-rw-r--r-- | init/rc6.conf | 23 | ||||
-rw-r--r-- | init/rcS-sulogin.conf | 5 | ||||
-rw-r--r-- | init/rcS.conf | 11 | ||||
-rw-r--r-- | init/serial.conf | 16 | ||||
-rw-r--r-- | init/tty1.conf | 15 | ||||
-rw-r--r-- | init/tty2.conf | 16 | ||||
-rw-r--r-- | init/tty3.conf | 16 | ||||
-rw-r--r-- | init/tty4.conf | 16 | ||||
-rw-r--r-- | init/tty5.conf | 16 | ||||
-rw-r--r-- | init/tty6.conf | 16 |
19 files changed, 16 insertions, 291 deletions
diff --git a/init/console.conf b/init/console.conf deleted file mode 100644 index 732a3fa9..00000000 --- a/init/console.conf +++ /dev/null @@ -1,16 +0,0 @@ -# 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/prefdm.conf b/init/prefdm.conf index 7098bd76..d47356c7 100644 --- a/init/prefdm.conf +++ b/init/prefdm.conf @@ -2,7 +2,7 @@ # # Starts gdm/xdm/etc by preference -start on stopped rc5 +start on stopped rc RUNLEVEL=5 stop on runlevel [!5] diff --git a/init/quit-plymouth.conf b/init/quit-plymouth.conf index 13ac3880..8b2e6f6a 100644 --- a/init/quit-plymouth.conf +++ b/init/quit-plymouth.conf @@ -5,10 +5,7 @@ # 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 +start on runlevel S or stopping rc RUNLEVEL=[234] script /usr/bin/plymouth quit || : diff --git a/init/rc0.conf b/init/rc0.conf deleted file mode 100644 index 11ce5a51..00000000 --- a/init/rc0.conf +++ /dev/null @@ -1,25 +0,0 @@ -# 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 deleted file mode 100644 index 38397b31..00000000 --- a/init/rc1.conf +++ /dev/null @@ -1,29 +0,0 @@ -# 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 deleted file mode 100644 index 6cc4d884..00000000 --- a/init/rc2.conf +++ /dev/null @@ -1,20 +0,0 @@ -# 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 deleted file mode 100644 index 47a4a639..00000000 --- a/init/rc3.conf +++ /dev/null @@ -1,20 +0,0 @@ -# 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 deleted file mode 100644 index 8e079f0e..00000000 --- a/init/rc4.conf +++ /dev/null @@ -1,20 +0,0 @@ -# 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 deleted file mode 100644 index 0ef6a400..00000000 --- a/init/rc5.conf +++ /dev/null @@ -1,20 +0,0 @@ -# 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 deleted file mode 100644 index f9df8b4a..00000000 --- a/init/rc6.conf +++ /dev/null @@ -1,23 +0,0 @@ -# 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 index d3aa20d1..4f1f1f13 100644 --- a/init/rcS-sulogin.conf +++ b/init/rcS-sulogin.conf @@ -5,16 +5,15 @@ start on runlevel S -stop on runlevel +stop on runlevel [!S] 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 + if [ "$RUNLEVEL" = "S" ]; then runlevel=$(/bin/awk -F ':' '$3 == "initdefault" && $1 !~ "^#" { print $2 }' /etc/inittab) [ -z "$runlevel" ] && runlevel="3" exec telinit $runlevel diff --git a/init/rcS.conf b/init/rcS.conf index 1c0a54be..51d52312 100644 --- a/init/rcS.conf +++ b/init/rcS.conf @@ -6,18 +6,15 @@ 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 -script - runlevel --set S >/dev/null || true - - /etc/rc.d/rc.sysinit - runlevel --reboot || true -end script +exec /etc/rc.d/rc.sysinit post-stop script - if [ "$UPSTART_EVENT" = "startup" ]; then + 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 diff --git a/init/serial.conf b/init/serial.conf index 660e93bd..9d6ad0ef 100644 --- a/init/serial.conf +++ b/init/serial.conf @@ -12,31 +12,31 @@ # 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 * +start on fedora.serial-console-available DEV=* stop on runlevel [016] -instance +instance $DEV pre-start script while /bin/true ; do - LANG=C /sbin/initctl status rcS | grep -wq "rcS (stop) waiting" && break + 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 + LANG=C /sbin/initctl status rc$runlevel | grep -wq "rc$runlevel stop/waiting" && break ;; *) ;; esac sleep 1 done - /sbin/securetty $1 + /sbin/securetty $DEV end script -exec /sbin/agetty /dev/$1 $2 vt100-nav +exec /sbin/agetty /dev/$DEV $SPEED 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 + 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/tty1.conf b/init/tty1.conf deleted file mode 100644 index 7747d660..00000000 --- a/init/tty1.conf +++ /dev/null @@ -1,15 +0,0 @@ -# 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 deleted file mode 100644 index ec5f94cd..00000000 --- a/init/tty2.conf +++ /dev/null @@ -1,16 +0,0 @@ -# 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 deleted file mode 100644 index ed95fdcf..00000000 --- a/init/tty3.conf +++ /dev/null @@ -1,16 +0,0 @@ -# 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 deleted file mode 100644 index 76b6d717..00000000 --- a/init/tty4.conf +++ /dev/null @@ -1,16 +0,0 @@ -# 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 deleted file mode 100644 index 9e9d8137..00000000 --- a/init/tty5.conf +++ /dev/null @@ -1,16 +0,0 @@ -# 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 deleted file mode 100644 index 7eb42c01..00000000 --- a/init/tty6.conf +++ /dev/null @@ -1,16 +0,0 @@ -# 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 |