File scripts.diff of Package upstart
Index: upstart-0.6.5/conf/control-alt-delete.conf
===================================================================
--- upstart-0.6.5.orig/conf/control-alt-delete.conf 2010-03-24 15:32:09.000000000 +0100
+++ upstart-0.6.5/conf/control-alt-delete.conf 2010-03-24 15:32:13.000000000 +0100
@@ -1,12 +1,9 @@
# control-alt-delete - emergency keypress handling
#
# This task is run whenever the Control-Alt-Delete key combination is
-# pressed, and performs a safe reboot of the machine.
-
-description "emergency keypress handling"
-author "Scott James Remnant <scott@netsplit.com>"
+# pressed. Usually used to shut down the machine.
start on control-alt-delete
task
-exec shutdown -r now "Control-Alt-Delete pressed"
+exec /sbin/shutdown -r now "Control-Alt-Delete pressed"
Index: upstart-0.6.5/conf/rc.conf
===================================================================
--- upstart-0.6.5.orig/conf/rc.conf 2010-03-24 15:32:09.000000000 +0100
+++ upstart-0.6.5/conf/rc.conf 2010-03-24 15:32:13.000000000 +0100
@@ -1,18 +1,15 @@
# rc - System V runlevel compatibility
#
-# This task runs the old System V-style rc script when changing between
-# runlevels.
-
-description "System V runlevel compatibility"
-author "Scott James Remnant <scott@netsplit.com>"
+# 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]
-export RUNLEVEL
-export PREVLEVEL
+stop on runlevel [!$RUNLEVEL]
task
+export RUNLEVEL
+export PREVLEVEL
console output
exec /etc/init.d/rc $RUNLEVEL
Index: upstart-0.6.5/conf/rcS.conf
===================================================================
--- upstart-0.6.5.orig/conf/rcS.conf 2010-03-24 15:32:09.000000000 +0100
+++ upstart-0.6.5/conf/rcS.conf 2010-03-24 15:32:13.000000000 +0100
@@ -1,26 +1,21 @@
-# rcS - System V single-user mode compatibility
+# rcS - "single-user" runlevel compatibility
#
-# This task handles the old System V-style single-user mode, this is
-# distinct from the other runlevels since running the rc script would
-# be bad.
-
-description "System V single-user mode compatibility"
-author "Scott James Remnant <scott@netsplit.com>"
+# 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
-exec /sbin/sulogin
-
+script
+ exec /bin/bash
+end script
post-stop script
- # Don't switch runlevels if we were stopped by an event, since that
- # means we're already switching runlevels
- if [ -n "${UPSTART_STOP_EVENTS}" ]
- then
- exit 0
- fi
-
- # Switch, passing a magic flag
- start --no-wait rc-sysinit FROM_SINGLE_USER_MODE=y
+ 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
+
Index: upstart-0.6.5/conf/reload-init.conf
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ upstart-0.6.5/conf/reload-init.conf 2010-03-24 15:32:13.000000000 +0100
@@ -0,0 +1,4 @@
+start on started messagebus
+
+task
+exec /bin/kill -HUP 1
Index: upstart-0.6.5/conf/start-ttys.conf
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ upstart-0.6.5/conf/start-ttys.conf 2010-04-13 15:23:25.000000000 +0200
@@ -0,0 +1,18 @@
+#
+# 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/tty7
+task
+script
+ for tty in $(echo $ACTIVE_CONSOLES) ; do
+ [ "$RUNLEVEL" = "5" -a "$tty" = "$X_TTY" ] && continue
+ if [ "$tty" = "/dev/tty1" ]; then
+ initctl start tty TTY=$tty OPTS=--noclear
+ else
+ initctl start tty TTY=$tty OPTS=
+ fi
+ done
+end script
Index: upstart-0.6.5/conf/tty.conf
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ upstart-0.6.5/conf/tty.conf 2010-03-24 15:32:13.000000000 +0100
@@ -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 $OPTS $TTY
Index: upstart-0.6.5/conf/Makefile.am
===================================================================
--- upstart-0.6.5.orig/conf/Makefile.am 2010-03-24 15:32:09.000000000 +0100
+++ upstart-0.6.5/conf/Makefile.am 2010-03-24 15:32:13.000000000 +0100
@@ -5,4 +5,7 @@ dist_init_DATA = \
rc-sysinit.conf \
rc.conf \
rcS.conf \
- control-alt-delete.conf
+ control-alt-delete.conf \
+ reload-init.conf \
+ start-ttys.conf \
+ tty.conf
Index: upstart-0.6.5/conf/Makefile.in
===================================================================
--- upstart-0.6.5.orig/conf/Makefile.in 2010-03-24 15:32:09.000000000 +0100
+++ upstart-0.6.5/conf/Makefile.in 2010-03-24 15:32:13.000000000 +0100
@@ -269,7 +269,11 @@ dist_init_DATA = \
rc-sysinit.conf \
rc.conf \
rcS.conf \
- control-alt-delete.conf
+ control-alt-delete.conf \
+ reload-init.conf \
+ start-ttys.conf \
+ tty.conf
+
all: all-am
Index: upstart-0.6.5/conf/rc-sysinit.conf
===================================================================
--- upstart-0.6.5.orig/conf/rc-sysinit.conf 2010-03-24 15:32:09.000000000 +0100
+++ upstart-0.6.5/conf/rc-sysinit.conf 2010-03-24 15:32:13.000000000 +0100
@@ -25,6 +25,10 @@ task
console owner
script
+ if [ -f /dev/shm/initrd_exports.sh ]; then
+ . /dev/shm/initrd_exports.sh
+ fi
+
# Check for default runlevel in /etc/inittab
if [ -r /etc/inittab ]
then
@@ -51,7 +55,7 @@ script
done
# Run the system initialisation scripts
- [ -n "${FROM_SINGLE_USER_MODE}" ] || /etc/init.d/rcS
+ [ -n "${FROM_SINGLE_USER_MODE}" ] || /etc/init.d/boot
# Switch into the default runlevel
telinit "${DEFAULT_RUNLEVEL}"