[cloud-init/el6] add new init scripts already referenced in the spec

Pádraig Brady pbrady at fedoraproject.org
Wed Jun 20 14:58:56 UTC 2012


commit 6608b1618d3bf203303289e4f0174b657daef869
Author: Pádraig Brady <P at draigBrady.com>
Date:   Wed Jun 20 15:55:04 2012 +0100

    add new init scripts already referenced in the spec
    
    Note there is the possibility of using upstart scripts
    (perhaps even the existing upstream ones directly),
    but for maximum compat with sysv only systems,
    use sysv init scripts for the moment at least.

 cloud-config.init     |   90 +++++++++++++++++++++++++++++++++++++++++++++++
 cloud-final.init      |   92 +++++++++++++++++++++++++++++++++++++++++++++++++
 cloud-init-local.init |   90 +++++++++++++++++++++++++++++++++++++++++++++++
 cloud-init.init       |   90 +++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 362 insertions(+), 0 deletions(-)
---
diff --git a/cloud-config.init b/cloud-config.init
new file mode 100644
index 0000000..b082409
--- /dev/null
+++ b/cloud-config.init
@@ -0,0 +1,90 @@
+#!/bin/sh
+#
+# cloud-config
+#
+# chkconfig:   - 20 80
+# description: Apply the settings specified in cloud-config
+
+### BEGIN INIT INFO
+# Provides: cloud-config
+# Required-Start: $remote_fs $network $syslog cloud-init-local cloud-init
+# Required-Stop: $remote_fs $syslog
+# Default-Stop: 0 1 6
+# Short-Description: Apply the settings specified in cloud-config
+# Description: Apply the settings specified in cloud-config
+### END INIT INFO
+
+. /etc/rc.d/init.d/functions
+
+prog=cloud-init-cfg
+exec="/usr/bin/$prog"
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+
+start() {
+    [ -x $exec ] || exit 5
+    echo -n $"Starting $prog: "
+    $prog all config
+    retval=$?
+    echo
+    return $retval
+}
+
+stop() {
+    return
+}
+
+restart() {
+    stop
+    start
+}
+
+reload() {
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+rh_status() {
+    status $prog
+}
+
+rh_status_q() {
+    rh_status >/dev/null 2>&1
+}
+
+
+case "$1" in
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        rh_status
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
+esac
+exit $?
diff --git a/cloud-final.init b/cloud-final.init
new file mode 100644
index 0000000..b08f3da
--- /dev/null
+++ b/cloud-final.init
@@ -0,0 +1,92 @@
+#!/bin/sh
+#
+# cloud-final
+#
+# chkconfig:   - 20 80
+# description: Execute cloud user/final scripts
+
+### BEGIN INIT INFO
+# Provides:
+# Required-Start: $remote_fs $network $syslog cloud-config
+# Required-Stop: $remote_fs $syslog
+# Default-Stop: 0 1 6
+# Short-Description: Execute cloud user/final scripts
+# Description: Execute cloud user/final scripts
+### END INIT INFO
+
+. /etc/rc.d/init.d/functions
+
+prog=cloud-init-cfg
+exec="/usr/bin/$prog"
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+
+start() {
+    [ -x $exec ] || exit 5
+    echo -n $"Starting $prog: "
+    # TODO: Note this will run before rc.local
+    # which needs to be changed to run after.
+    $prog all final
+    retval=$?
+    echo
+    return $retval
+}
+
+stop() {
+    return
+}
+
+restart() {
+    stop
+    start
+}
+
+reload() {
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+rh_status() {
+    status $prog
+}
+
+rh_status_q() {
+    rh_status >/dev/null 2>&1
+}
+
+
+case "$1" in
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        rh_status
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
+esac
+exit $?
diff --git a/cloud-init-local.init b/cloud-init-local.init
new file mode 100644
index 0000000..cb42ce2
--- /dev/null
+++ b/cloud-init-local.init
@@ -0,0 +1,90 @@
+#!/bin/sh
+#
+# cloud-init  local
+#
+# chkconfig:   - 20 80
+# description: Initial cloud-init job (pre-networking)
+
+### BEGIN INIT INFO
+# Provides: cloud-init-local
+# Required-Start: $syslog
+# Required-Stop: $syslog
+# Default-Stop: 0 1 6
+# Short-Description: Initial cloud-init job
+# Description: Initial cloud-init job (pre-networking)
+### END INIT INFO
+
+. /etc/rc.d/init.d/functions
+
+prog=cloud-init
+exec="/usr/bin/$prog"
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+
+start() {
+    [ -x $exec ] || exit 5
+    echo -n $"Starting $prog: "
+    $prog start-local
+    retval=$?
+    echo
+    return $retval
+}
+
+stop() {
+    return
+}
+
+restart() {
+    stop
+    start
+}
+
+reload() {
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+rh_status() {
+    status $prog
+}
+
+rh_status_q() {
+    rh_status >/dev/null 2>&1
+}
+
+
+case "$1" in
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        rh_status
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
+esac
+exit $?
diff --git a/cloud-init.init b/cloud-init.init
new file mode 100644
index 0000000..0e08ae1
--- /dev/null
+++ b/cloud-init.init
@@ -0,0 +1,90 @@
+#!/bin/sh
+#
+# cloud-init remote
+#
+# chkconfig:   - 20 80
+# description: Initial cloud-init job (metadata service crawler)
+
+### BEGIN INIT INFO
+# Provides: cloud-init
+# Required-Start: $remote_fs $network $syslog cloud-init-local
+# Required-Stop: $remote_fs $syslog
+# Default-Stop: 0 1 6
+# Short-Description: Initial cloud-init job
+# Description: Initial cloud-init job (metadata service crawler)
+### END INIT INFO
+
+. /etc/rc.d/init.d/functions
+
+prog=cloud-init
+exec="/usr/bin/$prog"
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+
+start() {
+    [ -x $exec ] || exit 5
+    echo -n $"Starting $prog: "
+    $prog start
+    retval=$?
+    echo
+    return $retval
+}
+
+stop() {
+    return
+}
+
+restart() {
+    stop
+    start
+}
+
+reload() {
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+rh_status() {
+    status $prog
+}
+
+rh_status_q() {
+    rh_status >/dev/null 2>&1
+}
+
+
+case "$1" in
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        rh_status
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
+esac
+exit $?


More information about the scm-commits mailing list