From 79b2b232cb34f7df3e440968240975e44c4b8fc7 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 3 Dec 2009 14:29:21 -0500 Subject: Move to new upstart job location and file extension. --- Makefile | 4 ++-- README-event.d | 26 -------------------------- README-init | 26 ++++++++++++++++++++++++++ event.d/console | 16 ---------------- event.d/control-alt-delete | 8 -------- event.d/plymouth-shutdown | 24 ------------------------ event.d/prefdm | 12 ------------ event.d/quit-plymouth | 15 --------------- event.d/rc0 | 25 ------------------------- event.d/rc1 | 29 ----------------------------- event.d/rc2 | 20 -------------------- event.d/rc3 | 20 -------------------- event.d/rc4 | 20 -------------------- event.d/rc5 | 20 -------------------- event.d/rc6 | 23 ----------------------- event.d/rcS | 31 ------------------------------- event.d/rcS-sulogin | 22 ---------------------- event.d/serial | 42 ------------------------------------------ event.d/tty1 | 15 --------------- event.d/tty2 | 16 ---------------- event.d/tty3 | 16 ---------------- event.d/tty4 | 16 ---------------- event.d/tty5 | 16 ---------------- event.d/tty6 | 16 ---------------- init/console.conf | 16 ++++++++++++++++ init/control-alt-delete.conf | 8 ++++++++ init/plymouth-shutdown.conf | 24 ++++++++++++++++++++++++ init/prefdm.conf | 12 ++++++++++++ init/quit-plymouth.conf | 15 +++++++++++++++ init/rc0.conf | 25 +++++++++++++++++++++++++ init/rc1.conf | 29 +++++++++++++++++++++++++++++ init/rc2.conf | 20 ++++++++++++++++++++ init/rc3.conf | 20 ++++++++++++++++++++ init/rc4.conf | 20 ++++++++++++++++++++ init/rc5.conf | 20 ++++++++++++++++++++ init/rc6.conf | 23 +++++++++++++++++++++++ init/rcS-sulogin.conf | 22 ++++++++++++++++++++++ init/rcS.conf | 31 +++++++++++++++++++++++++++++++ init/serial.conf | 42 ++++++++++++++++++++++++++++++++++++++++++ init/tty1.conf | 15 +++++++++++++++ init/tty2.conf | 16 ++++++++++++++++ init/tty3.conf | 16 ++++++++++++++++ init/tty4.conf | 16 ++++++++++++++++ init/tty5.conf | 16 ++++++++++++++++ init/tty6.conf | 16 ++++++++++++++++ initscripts.spec | 12 ++++++------ inittab.upstart | 10 +++++----- 47 files changed, 461 insertions(+), 461 deletions(-) delete mode 100644 README-event.d create mode 100644 README-init delete mode 100644 event.d/console delete mode 100644 event.d/control-alt-delete delete mode 100644 event.d/plymouth-shutdown delete mode 100644 event.d/prefdm delete mode 100644 event.d/quit-plymouth delete mode 100644 event.d/rc0 delete mode 100644 event.d/rc1 delete mode 100644 event.d/rc2 delete mode 100644 event.d/rc3 delete mode 100644 event.d/rc4 delete mode 100644 event.d/rc5 delete mode 100644 event.d/rc6 delete mode 100644 event.d/rcS delete mode 100644 event.d/rcS-sulogin delete mode 100644 event.d/serial delete mode 100644 event.d/tty1 delete mode 100644 event.d/tty2 delete mode 100644 event.d/tty3 delete mode 100644 event.d/tty4 delete mode 100644 event.d/tty5 delete mode 100644 event.d/tty6 create mode 100644 init/console.conf create mode 100644 init/control-alt-delete.conf create mode 100644 init/plymouth-shutdown.conf create mode 100644 init/prefdm.conf create mode 100644 init/quit-plymouth.conf create mode 100644 init/rc0.conf create mode 100644 init/rc1.conf create mode 100644 init/rc2.conf create mode 100644 init/rc3.conf create mode 100644 init/rc4.conf create mode 100644 init/rc5.conf create mode 100644 init/rc6.conf create mode 100644 init/rcS-sulogin.conf create mode 100644 init/rcS.conf create mode 100644 init/serial.conf create mode 100644 init/tty1.conf create mode 100644 init/tty2.conf create mode 100644 init/tty3.conf create mode 100644 init/tty4.conf create mode 100644 init/tty5.conf create mode 100644 init/tty6.conf diff --git a/Makefile b/Makefile index 4de8e59a..c92ef2db 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,7 @@ install: cp -af rc.d/init.d $(ROOT)/etc/rc.d/ install -m644 sysconfig/debug sysconfig/init sysconfig/netconsole sysconfig/readonly-root $(ROOT)/etc/sysconfig/ cp -af sysconfig/network-scripts $(ROOT)/etc/sysconfig/ - cp -af ppp NetworkManager event.d $(ROOT)/etc + cp -af ppp NetworkManager init $(ROOT)/etc mkdir -p $(ROOT)/etc/ppp/peers mkdir -p $(ROOT)/lib cp -af udev $(ROOT)/lib @@ -59,7 +59,7 @@ install: chmod 755 $(ROOT)/etc/sysconfig/network-scripts/init* chmod 755 $(ROOT)/etc/sysconfig/network-scripts/net.hotplug chmod 755 $(ROOT)/etc/NetworkManager/dispatcher.d/00-netreport - chmod 644 $(ROOT)/etc/event.d/* + chmod 644 $(ROOT)/etc/init/* mkdir -p $(ROOT)/etc/sysconfig/modules mkdir -p $(ROOT)/etc/sysconfig/networking/devices mkdir -p $(ROOT)/etc/sysconfig/networking/profiles/default diff --git a/README-event.d b/README-event.d deleted file mode 100644 index ea60fbce..00000000 --- a/README-event.d +++ /dev/null @@ -1,26 +0,0 @@ -The upstart scripts in /etc/event.d originate from event-compat-sysv-0.3.9, -and have since been heavily modified. - -The original copyright is: - -Copyright © 2008 Canonical Ltd. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/README-init b/README-init new file mode 100644 index 00000000..9a9b4cfa --- /dev/null +++ b/README-init @@ -0,0 +1,26 @@ +The upstart scripts in /etc/init originate from event-compat-sysv-0.3.9, +and have since been heavily modified. + +The original copyright is: + +Copyright © 2008 Canonical Ltd. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/event.d/console b/event.d/console deleted file mode 100644 index 732a3fa9..00000000 --- a/event.d/console +++ /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/event.d/control-alt-delete b/event.d/control-alt-delete deleted file mode 100644 index 35cb1305..00000000 --- a/event.d/control-alt-delete +++ /dev/null @@ -1,8 +0,0 @@ -# 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/plymouth-shutdown b/event.d/plymouth-shutdown deleted file mode 100644 index d76dbd3f..00000000 --- a/event.d/plymouth-shutdown +++ /dev/null @@ -1,24 +0,0 @@ -# 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/event.d/prefdm b/event.d/prefdm deleted file mode 100644 index 7098bd76..00000000 --- a/event.d/prefdm +++ /dev/null @@ -1,12 +0,0 @@ -# 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/quit-plymouth b/event.d/quit-plymouth deleted file mode 100644 index 13ac3880..00000000 --- a/event.d/quit-plymouth +++ /dev/null @@ -1,15 +0,0 @@ -# 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/event.d/rc0 b/event.d/rc0 deleted file mode 100644 index 11ce5a51..00000000 --- a/event.d/rc0 +++ /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/event.d/rc1 b/event.d/rc1 deleted file mode 100644 index 38397b31..00000000 --- a/event.d/rc1 +++ /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/event.d/rc2 b/event.d/rc2 deleted file mode 100644 index 6cc4d884..00000000 --- a/event.d/rc2 +++ /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/event.d/rc3 b/event.d/rc3 deleted file mode 100644 index 47a4a639..00000000 --- a/event.d/rc3 +++ /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/event.d/rc4 b/event.d/rc4 deleted file mode 100644 index 8e079f0e..00000000 --- a/event.d/rc4 +++ /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/event.d/rc5 b/event.d/rc5 deleted file mode 100644 index 0ef6a400..00000000 --- a/event.d/rc5 +++ /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/event.d/rc6 b/event.d/rc6 deleted file mode 100644 index f9df8b4a..00000000 --- a/event.d/rc6 +++ /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/event.d/rcS b/event.d/rcS deleted file mode 100644 index 1c0a54be..00000000 --- a/event.d/rcS +++ /dev/null @@ -1,31 +0,0 @@ -# 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/event.d/rcS-sulogin b/event.d/rcS-sulogin deleted file mode 100644 index d3aa20d1..00000000 --- a/event.d/rcS-sulogin +++ /dev/null @@ -1,22 +0,0 @@ -# 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/event.d/serial b/event.d/serial deleted file mode 100644 index 660e93bd..00000000 --- a/event.d/serial +++ /dev/null @@ -1,42 +0,0 @@ -# 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 ' 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/event.d/tty1 b/event.d/tty1 deleted file mode 100644 index 7747d660..00000000 --- a/event.d/tty1 +++ /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/event.d/tty2 b/event.d/tty2 deleted file mode 100644 index ec5f94cd..00000000 --- a/event.d/tty2 +++ /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/event.d/tty3 b/event.d/tty3 deleted file mode 100644 index ed95fdcf..00000000 --- a/event.d/tty3 +++ /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/event.d/tty4 b/event.d/tty4 deleted file mode 100644 index 76b6d717..00000000 --- a/event.d/tty4 +++ /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/event.d/tty5 b/event.d/tty5 deleted file mode 100644 index 9e9d8137..00000000 --- a/event.d/tty5 +++ /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/event.d/tty6 b/event.d/tty6 deleted file mode 100644 index 7eb42c01..00000000 --- a/event.d/tty6 +++ /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 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 ' 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 diff --git a/initscripts.spec b/initscripts.spec index 60fa8a95..93772dc3 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -19,7 +19,7 @@ Requires: util-linux-ng >= 2.16, mount >= 2.11l Requires: bash >= 3.0 Requires: sysvinit-tools >= 2.87 %if with_upstart -Requires: upstart +Requires: upstart >= 0.6.0 %else Requires: SysVinit >= 2.85-38 %endif @@ -79,7 +79,7 @@ make ROOT=$RPM_BUILD_ROOT SUPERUSER=`id -un` SUPERGROUP=`id -gn` mandir=%{_mandi rm -f $RPM_BUILD_ROOT/etc/rc.d/init.d/single %else mv -f $RPM_BUILD_ROOT/etc/inittab.sysv $RPM_BUILD_ROOT/etc/inittab - rm -rf $RPM_BUILD_ROOT/etc/event.d + rm -rf $RPM_BUILD_ROOT/etc/init %endif rm -f $RPM_BUILD_ROOT/etc/inittab.* @@ -88,12 +88,12 @@ rm -f \ $RPM_BUILD_ROOT/etc/sysconfig/network-scripts/ifup-ctc \ $RPM_BUILD_ROOT/lib/udev/rules.d/55-ccw.rules \ $RPM_BUILD_ROOT/lib/udev/ccw_init \ - $RPM_BUILD_ROOT/etc/event.d/console + $RPM_BUILD_ROOT/etc/init/console %else rm -f \ $RPM_BUILD_ROOT/etc/rc.d/rc.sysinit.s390init \ $RPM_BUILD_ROOT/etc/sysconfig/init.s390 \ - $RPM_BUILD_ROOT/etc/event.d/tty[1-6] + $RPM_BUILD_ROOT/etc/init/tty[1-6] %endif %pre @@ -182,7 +182,7 @@ rm -rf $RPM_BUILD_ROOT /etc/statetab %dir /etc/statetab.d %if with_upstart -%config(noreplace) /etc/event.d/* +%config(noreplace) /etc/init/* %endif %config /etc/X11/prefdm %config(noreplace) /etc/inittab @@ -236,7 +236,7 @@ rm -rf $RPM_BUILD_ROOT %dir /etc/NetworkManager/dispatcher.d /etc/NetworkManager/dispatcher.d/00-netreport /etc/NetworkManager/dispatcher.d/05-netfs -%doc sysconfig.txt sysvinitfiles static-routes-ipv6 ipv6-tunnel.howto ipv6-6to4.howto changes.ipv6 COPYING README-event.d +%doc sysconfig.txt sysvinitfiles static-routes-ipv6 ipv6-tunnel.howto ipv6-6to4.howto changes.ipv6 COPYING README-init /var/lib/stateless %ghost %attr(0600,root,utmp) /var/log/btmp %ghost %attr(0664,root,utmp) /var/log/wtmp diff --git a/inittab.upstart b/inittab.upstart index 95d359ca..955e7de6 100644 --- a/inittab.upstart +++ b/inittab.upstart @@ -2,14 +2,14 @@ # # ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM. # -# System initialization is started by /etc/event.d/rcS +# System initialization is started by /etc/init/rcS # -# Individual runlevels are started by /etc/event.d/rc[0-6] +# Individual runlevels are started by /etc/init/rc[0-6] # -# Ctrl-Alt-Delete is handled by /etc/event.d/control-alt-delete +# Ctrl-Alt-Delete is handled by /etc/init/control-alt-delete # -# Terminal gettys (tty[1-6]) are handled by /etc/event.d/tty[1-6] and -# /etc/event.d/serial +# Terminal gettys (tty[1-6]) are handled by /etc/init/tty[1-6] and +# /etc/init/serial # # For information on how to write upstart event handlers, or how # upstart works, see init(8), initctl(8), and events(5). -- cgit v1.2.1