SHA256
1
0
forked from pool/cloud-init
cloud-init/fixupSysVinit.patch

158 lines
4.5 KiB
Diff

Index: sysvinit/cloud-config
===================================================================
--- sysvinit/cloud-config.orig
+++ sysvinit/cloud-config
@@ -27,9 +27,9 @@
# Provides: cloud-config
# Required-Start: cloud-init cloud-init-local
# Should-Start: $time
-# Required-Stop:
-# Should-Stop:
-# Default-Start: 2 3 4 5
+# Required-Stop: $null
+# Should-Stop: $null
+# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Short-Description: The config cloud-init job
# Description: Start cloud-init and runs the config phase
@@ -62,6 +62,9 @@ conf="/etc/cloud/cloud.cfg"
[ -f /etc/sysconfig/cloud-init ] && . /etc/sysconfig/cloud-init
[ -f /etc/default/cloud-init ] && . /etc/default/cloud-init
+. /etc/rc.status
+rc_reset
+
start() {
[ -x $cloud_init ] || return 5
[ -f $conf ] || return 6
@@ -118,4 +121,6 @@ case "$1" in
;;
esac
-exit $RETVAL
+_rc_status=$RETVAL
+rc_status -v
+rc_exit
Index: sysvinit/cloud-final
===================================================================
--- sysvinit/cloud-final.orig
+++ sysvinit/cloud-final
@@ -27,9 +27,9 @@
# Provides: cloud-final
# Required-Start: $all cloud-config
# Should-Start: $time
-# Required-Stop:
-# Should-Stop:
-# Default-Start: 2 3 4 5
+# Required-Stop: $null
+# Should-Stop: $null
+# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Short-Description: The final cloud-init job
# Description: Start cloud-init and runs the final phase
@@ -62,6 +62,9 @@ conf="/etc/cloud/cloud.cfg"
[ -f /etc/sysconfig/cloud-init ] && . /etc/sysconfig/cloud-init
[ -f /etc/default/cloud-init ] && . /etc/default/cloud-init
+. /etc/rc.status
+rc_reset
+
start() {
[ -x $cloud_init ] || return 5
[ -f $conf ] || return 6
@@ -118,4 +121,6 @@ case "$1" in
;;
esac
-exit $RETVAL
+_rc_status=$RETVAL
+rc_status -v
+rc_exit
Index: sysvinit/cloud-init
===================================================================
--- sysvinit/cloud-init.orig
+++ sysvinit/cloud-init
@@ -27,9 +27,9 @@
# Provides: cloud-init
# Required-Start: $local_fs $network $named $remote_fs cloud-init-local
# Should-Start: $time
-# Required-Stop:
-# Should-Stop:
-# Default-Start: 2 3 4 5
+# Required-Stop: $null
+# Should-Stop: $null
+# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Short-Description: The initial cloud-init job (net and fs contingent)
# Description: Start cloud-init and runs the initialization phase
@@ -62,6 +62,9 @@ conf="/etc/cloud/cloud.cfg"
[ -f /etc/sysconfig/cloud-init ] && . /etc/sysconfig/cloud-init
[ -f /etc/default/cloud-init ] && . /etc/default/cloud-init
+. /etc/rc.status
+rc_reset
+
start() {
[ -x $cloud_init ] || return 5
[ -f $conf ] || return 6
@@ -103,6 +106,8 @@ case "$1" in
;;
status)
echo -n $"Checking for service $prog:"
+ RETVAL=3
+ [ -e /root/.ssh/authorized_keys ] && RETVAL=0
# Return value is slightly different for the status command:
# 0 - service up and running
# 1 - service dead, but /var/run/ pid file exists
@@ -110,7 +115,6 @@ case "$1" in
# 3 - service not running (unused)
# 4 - service status unknown :-(
# 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.)
- RETVAL=3
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|condrestart|restart|force-reload|reload}"
@@ -118,4 +122,6 @@ case "$1" in
;;
esac
-exit $RETVAL
+_rc_status=$RETVAL
+rc_status -v
+rc_exit
Index: sysvinit/cloud-init-local
===================================================================
--- sysvinit/cloud-init-local.orig
+++ sysvinit/cloud-init-local
@@ -27,9 +27,9 @@
# Provides: cloud-init-local
# Required-Start: $local_fs $remote_fs
# Should-Start: $time
-# Required-Stop:
-# Should-Stop:
-# Default-Start: 2 3 4 5
+# Required-Stop: $null
+# Should-Stop: $null
+# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Short-Description: The initial cloud-init job (local fs contingent)
# Description: Start cloud-init and runs the initialization phases
@@ -62,6 +62,9 @@ conf="/etc/cloud/cloud.cfg"
[ -f /etc/sysconfig/cloud-init ] && . /etc/sysconfig/cloud-init
[ -f /etc/default/cloud-init ] && . /etc/default/cloud-init
+. /etc/rc.status
+rc_reset
+
start() {
[ -x $cloud_init ] || return 5
[ -f $conf ] || return 6
@@ -118,4 +121,6 @@ case "$1" in
;;
esac
-exit $RETVAL
+_rc_status=$RETVAL
+rc_status -v
+rc_exit