summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCasey Dahlin <cdahlin@redhat.com>2008-07-23 09:48:23 -0400
committerCasey Dahlin <cdahlin@redhat.com>2008-07-23 09:48:23 -0400
commit01fecfecdb440d81435690c63d28909c5edd34de (patch)
tree0700ba7f0da1a17e974ad77826f8011b7e77443f
parent51f5d4923f3ab0025708df3d20efd45fe5437e92 (diff)
downloadinitscripts-master.tar.gz
initscripts-master.tar.xz
initscripts-master.zip
Update for Upstart 0.5.0HEADmaster
New job definitions, in a new location, in a new format
-rw-r--r--Makefile7
-rw-r--r--README-jobs.d (renamed from README-event.d)2
-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/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
-rw-r--r--jobs.d/control-alt-delete (renamed from event.d/control-alt-delete)0
-rw-r--r--jobs.d/kickoff-ttys15
-rw-r--r--jobs.d/prefdm (renamed from event.d/prefdm)2
-rw-r--r--jobs.d/rc-multiuser19
-rw-r--r--jobs.d/rc0 (renamed from event.d/rc0)2
-rw-r--r--jobs.d/rc1 (renamed from event.d/rc1)10
-rw-r--r--jobs.d/rc6 (renamed from event.d/rc6)0
-rw-r--r--jobs.d/rcS (renamed from event.d/rcS)26
-rw-r--r--jobs.d/rcS-sulogin (renamed from event.d/rcS-sulogin)2
-rw-r--r--jobs.d/serial (renamed from event.d/serial)11
-rw-r--r--jobs.d/startfail4
-rw-r--r--jobs.d/tty14
25 files changed, 79 insertions, 229 deletions
diff --git a/Makefile b/Makefile
index 93e53c8b..4aab352c 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ all:
install:
mkdir -p $(ROOT)/etc/profile.d $(ROOT)/sbin $(ROOT)/usr/sbin
- mkdir -p $(ROOT)$(mandir)/man{5,8}
+ mkdir -p $(ROOT)$(mandir)/man{5,8} $(ROOT)/etc/init
mkdir -p $(ROOT)/etc/rwtab.d $(ROOT)/etc/statetab.d
mkdir -p $(ROOT)/var/lib/stateless/writable
mkdir -p $(ROOT)/var/lib/stateless/state
@@ -46,7 +46,8 @@ install:
cp -af rc.d/init.d $(ROOT)/etc/rc.d/
install -m755 sysconfig/mcheck sysconfig/init sysconfig/netconsole sysconfig/readonly-root $(ROOT)/etc/sysconfig/
cp -af sysconfig/network-scripts $(ROOT)/etc/sysconfig/
- cp -af ppp udev NetworkManager event.d $(ROOT)/etc
+ cp -af ppp udev NetworkManager $(ROOT)/etc
+ cp -af jobs.d $(ROOT)/etc/init
mkdir -p $(ROOT)/etc/ppp/peers
chmod 755 $(ROOT)/etc/rc.d/* $(ROOT)/etc/rc.d/init.d/*
chmod 755 $(ROOT)/etc/ppp/peers
@@ -56,7 +57,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/jobs.d/*
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-jobs.d
index ea60fbce..82fb065f 100644
--- a/README-event.d
+++ b/README-jobs.d
@@ -1,4 +1,4 @@
-The upstart scripts in /etc/event.d originate from event-compat-sysv-0.3.9,
+The upstart scripts in /etc/init/jobs.d originate from event-compat-sysv-0.3.9,
and have since been heavily modified.
The original copyright is:
diff --git a/event.d/rc2 b/event.d/rc2
deleted file mode 100644
index 1e0ab677..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
-
-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 785c98aa..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
-
-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 590eebbc..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
-
-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 69ca88a7..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
-
-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/sulogin b/event.d/sulogin
deleted file mode 100644
index 931fb062..00000000
--- a/event.d/sulogin
+++ /dev/null
@@ -1,18 +0,0 @@
-# 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
deleted file mode 100644
index f0002ae3..00000000
--- a/event.d/tty1
+++ /dev/null
@@ -1,16 +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
-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
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/event.d/control-alt-delete b/jobs.d/control-alt-delete
index 35cb1305..35cb1305 100644
--- a/event.d/control-alt-delete
+++ b/jobs.d/control-alt-delete
diff --git a/jobs.d/kickoff-ttys b/jobs.d/kickoff-ttys
new file mode 100644
index 00000000..59f88198
--- /dev/null
+++ b/jobs.d/kickoff-ttys
@@ -0,0 +1,15 @@
+# kickoff-ttys - standard array of gettys
+
+start on stopped rc-multiuser RUNLEVEL=[!5] or started prefdm
+task
+
+emits tty-requested
+
+script
+ /sbin/initctl emit tty-requested TTY=tty1
+ /sbin/initctl emit tty-requested TTY=tty2
+ /sbin/initctl emit tty-requested TTY=tty3
+ /sbin/initctl emit tty-requested TTY=tty4
+ /sbin/initctl emit tty-requested TTY=tty5
+ /sbin/initctl emit tty-requested TTY=tty6
+end script
diff --git a/event.d/prefdm b/jobs.d/prefdm
index 7098bd76..5dd2d3f8 100644
--- a/event.d/prefdm
+++ b/jobs.d/prefdm
@@ -2,7 +2,7 @@
#
# Starts gdm/xdm/etc by preference
-start on stopped rc5
+start on stopped rc-multiuser RUNLEVEL=5
stop on runlevel [!5]
diff --git a/jobs.d/rc-multiuser b/jobs.d/rc-multiuser
new file mode 100644
index 00000000..a6d13e56
--- /dev/null
+++ b/jobs.d/rc-multiuser
@@ -0,0 +1,19 @@
+# rc-multiuser - multiuser runlevel 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 [2345]
+stop on runlevel
+task
+
+export PREVLEVEL
+export RUNLEVEL
+
+console output
+script
+ runlevel --set $RUNLEVEL || true
+ export PREVLEVEL RUNLEVEL
+
+ exec /etc/rc.d/rc $RUNLELVEL
+end script
diff --git a/event.d/rc0 b/jobs.d/rc0
index 63de616b..8dfd8218 100644
--- a/event.d/rc0
+++ b/jobs.d/rc0
@@ -5,8 +5,8 @@
# script (and thus /etc/default/poweroff).
start on runlevel 0
-
stop on runlevel
+task
console output
script
diff --git a/event.d/rc1 b/jobs.d/rc1
index 5ad47bbe..021791b1 100644
--- a/event.d/rc1
+++ b/jobs.d/rc1
@@ -6,18 +6,12 @@
# normally /etc/event.d/rcS-sulogin
start on runlevel 1
-
stop on runlevel
+task
console output
script
- set $(runlevel --set 1 || true)
- if [ "$1" != "unknown" ]; then
- PREVLEVEL=$1
- RUNLEVEL=$2
- export PREVLEVEL RUNLEVEL
- fi
-
+ export PREVLEVEL RUNLEVEL
exec /etc/rc.d/rc 1
end script
post-stop script
diff --git a/event.d/rc6 b/jobs.d/rc6
index c40f708d..c40f708d 100644
--- a/event.d/rc6
+++ b/jobs.d/rc6
diff --git a/event.d/rcS b/jobs.d/rcS
index b01ddc57..5faef6e8 100644
--- a/event.d/rcS
+++ b/jobs.d/rcS
@@ -3,8 +3,8 @@
# 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
@@ -17,15 +17,17 @@ script
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
+ for UPSTART_EVENT in $UPSTART_EVENTS; do
+ 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
+ done
end script
diff --git a/event.d/rcS-sulogin b/jobs.d/rcS-sulogin
index 59a0b4d3..d4774e92 100644
--- a/event.d/rcS-sulogin
+++ b/jobs.d/rcS-sulogin
@@ -4,8 +4,8 @@
# then continues to the default runlevel.
start on runlevel S
-
stop on runlevel
+task
console owner
script
diff --git a/event.d/serial b/jobs.d/serial
index 6869090e..be1bfd66 100644
--- a/event.d/serial
+++ b/jobs.d/serial
@@ -1,8 +1,8 @@
-
start on fedora.serial-console-available *
stop on runlevel [016]
+respawn
-instance
+instance $DEVNAME
pre-start script
while /bin/true ; do
LANG=C /sbin/initctl status rcS | grep -wq "rcS (stop) waiting" && break
@@ -21,9 +21,4 @@ pre-start script
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
+exec /sbin/agetty /dev/$DEVNAME $BAUD vt100-nav
diff --git a/jobs.d/startfail b/jobs.d/startfail
new file mode 100644
index 00000000..0ef5a1d2
--- /dev/null
+++ b/jobs.d/startfail
@@ -0,0 +1,4 @@
+start on startup/failed
+session leader
+console output
+exec /bin/bash
diff --git a/jobs.d/tty b/jobs.d/tty
new file mode 100644
index 00000000..a264c0c5
--- /dev/null
+++ b/jobs.d/tty
@@ -0,0 +1,14 @@
+# tty - getty
+#
+# This service maintains a getty from the point the system is started until it
+# is shut down again.
+
+start on tty-requested
+stop on runlevel [016]
+
+instance $TTY
+
+session leader
+
+respawn
+exec /sbin/mingetty $TTY