]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
- init job descriptions moved from upstart-SysVinit
authorJacek Konieczny <jajcus@pld-linux.org>
Tue, 11 May 2010 08:54:35 +0000 (08:54 +0000)
committerJacek Konieczny <jajcus@pld-linux.org>
Tue, 11 May 2010 08:54:35 +0000 (08:54 +0000)
svn-id: @11447

init/rc.conf [new file with mode: 0644]
init/rcS-sulogin.conf [new file with mode: 0644]
init/rcS.conf [new file with mode: 0644]

diff --git a/init/rc.conf b/init/rc.conf
new file mode 100644 (file)
index 0000000..c834bbe
--- /dev/null
@@ -0,0 +1,17 @@
+description "rc - System V runlevel compatibility\
+             \
+             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]
+
+emits shutdown
+
+task
+
+export RUNLEVEL
+console output
+exec /etc/rc.d/rc $RUNLEVEL
+
+# vi: ft=upstart
diff --git a/init/rcS-sulogin.conf b/init/rcS-sulogin.conf
new file mode 100644 (file)
index 0000000..1dae306
--- /dev/null
@@ -0,0 +1,23 @@
+description "rcS-sulogin - 'single-user' runlevel compatibility \
+\
+This task runs /bin/sh during 'single-user' mode, \
+then continues to the default runlevel."
+
+start on runlevel S
+stop on runlevel [!S]
+
+emits runlevel
+
+console owner
+script
+       exec /bin/sh
+end script
+post-stop script
+       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
+
+# vi: ft=upstart
diff --git a/init/rcS.conf b/init/rcS.conf
new file mode 100644 (file)
index 0000000..d3bbbc1
--- /dev/null
@@ -0,0 +1,32 @@
+description "rcS - runlevel compatibility \
+\
+This task runs the old sysv-rc startup scripts."
+
+start on startup
+
+stop on runlevel
+
+emits all-swaps filesystem local-filesystems root-filesystem virtual-filesystems 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
+exec /etc/rc.d/rc.sysinit
+post-stop script
+       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
+                       case $t in
+                               -s|single|S|s) runlevel="S" ;;
+                               [1-9])       runlevel="$t" ;;
+                       esac
+               done
+               exec telinit $runlevel
+       fi
+end script
+
+# vi: ft=upstart
This page took 0.044426 seconds and 4 git commands to generate.