summaryrefslogtreecommitdiffstats
path: root/jobs.d
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 /jobs.d
parent51f5d4923f3ab0025708df3d20efd45fe5437e92 (diff)
downloadinitscripts-01fecfecdb440d81435690c63d28909c5edd34de.tar.gz
initscripts-01fecfecdb440d81435690c63d28909c5edd34de.tar.xz
initscripts-01fecfecdb440d81435690c63d28909c5edd34de.zip
Update for Upstart 0.5.0HEADmaster
New job definitions, in a new location, in a new format
Diffstat (limited to 'jobs.d')
-rw-r--r--jobs.d/control-alt-delete8
-rw-r--r--jobs.d/kickoff-ttys15
-rw-r--r--jobs.d/prefdm12
-rw-r--r--jobs.d/rc-multiuser19
-rw-r--r--jobs.d/rc025
-rw-r--r--jobs.d/rc123
-rw-r--r--jobs.d/rc623
-rw-r--r--jobs.d/rcS33
-rw-r--r--jobs.d/rcS-sulogin21
-rw-r--r--jobs.d/serial24
-rw-r--r--jobs.d/startfail4
-rw-r--r--jobs.d/tty14
12 files changed, 221 insertions, 0 deletions
diff --git a/jobs.d/control-alt-delete b/jobs.d/control-alt-delete
new file mode 100644
index 00000000..35cb1305
--- /dev/null
+++ b/jobs.d/control-alt-delete
@@ -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/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/jobs.d/prefdm b/jobs.d/prefdm
new file mode 100644
index 00000000..5dd2d3f8
--- /dev/null
+++ b/jobs.d/prefdm
@@ -0,0 +1,12 @@
+# prefdm - preferred display manager
+#
+# Starts gdm/xdm/etc by preference
+
+start on stopped rc-multiuser RUNLEVEL=5
+
+stop on runlevel [!5]
+
+console output
+respawn
+respawn limit 10 120
+exec /etc/X11/prefdm -nodaemon
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/jobs.d/rc0 b/jobs.d/rc0
new file mode 100644
index 00000000..8dfd8218
--- /dev/null
+++ b/jobs.d/rc0
@@ -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
+task
+
+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/jobs.d/rc1 b/jobs.d/rc1
new file mode 100644
index 00000000..021791b1
--- /dev/null
+++ b/jobs.d/rc1
@@ -0,0 +1,23 @@
+# 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
+task
+
+console output
+script
+ export PREVLEVEL RUNLEVEL
+ exec /etc/rc.d/rc 1
+end script
+post-stop script
+ clear
+ TEXTDOMAIN=initscripts
+ . /etc/profile.d/lang.sh
+ echo $"Telling INIT to go to single user mode."
+ exec telinit S
+end script
diff --git a/jobs.d/rc6 b/jobs.d/rc6
new file mode 100644
index 00000000..c40f708d
--- /dev/null
+++ b/jobs.d/rc6
@@ -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
+
+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/jobs.d/rcS b/jobs.d/rcS
new file mode 100644
index 00000000..5faef6e8
--- /dev/null
+++ b/jobs.d/rcS
@@ -0,0 +1,33 @@
+# 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
+script
+ runlevel --set S >/dev/null || true
+
+ /etc/rc.d/rc.sysinit
+ runlevel --reboot || true
+end script
+post-stop script
+ 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/jobs.d/rcS-sulogin b/jobs.d/rcS-sulogin
new file mode 100644
index 00000000..d4774e92
--- /dev/null
+++ b/jobs.d/rcS-sulogin
@@ -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
+task
+
+console owner
+script
+ runlevel --set S >/dev/null || true
+ exec /bin/bash
+end script
+post-stop script
+ if [ "$1" = "S" ]; then
+ runlevel=$(/bin/awk -F ':' '$3 == "initdefault" { print $2 }' /etc/inittab)
+ [ -z "$runlevel" ] && runlevel="3"
+ exec telinit $runlevel
+ fi
+end script
diff --git a/jobs.d/serial b/jobs.d/serial
new file mode 100644
index 00000000..be1bfd66
--- /dev/null
+++ b/jobs.d/serial
@@ -0,0 +1,24 @@
+start on fedora.serial-console-available *
+stop on runlevel [016]
+respawn
+
+instance $DEVNAME
+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/$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