summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVlastimil Holer <vlastimil.holer@gmail.com>2013-02-21 14:23:53 +0100
committerVlastimil Holer <vlastimil.holer@gmail.com>2013-02-21 14:23:53 +0100
commit27ce4ea4f2bfe1e33454b8cec63276b044e29d12 (patch)
tree14a88e31fb76be45fc025909cd29667e0cfadd7a
parent48abaf6a72dca4485f0bc64af075febac6ef590d (diff)
downloadvyos-cloud-init-27ce4ea4f2bfe1e33454b8cec63276b044e29d12.tar.gz
vyos-cloud-init-27ce4ea4f2bfe1e33454b8cec63276b044e29d12.zip
Modify init-scripts to be able to run both on RHEL and Debian.
-rwxr-xr-xsetup.py2
-rwxr-xr-xsysvinit/cloud-config11
-rwxr-xr-xsysvinit/cloud-final11
-rwxr-xr-xsysvinit/cloud-init11
-rwxr-xr-xsysvinit/cloud-init-local11
5 files changed, 17 insertions, 29 deletions
diff --git a/setup.py b/setup.py
index 24476681..38c8cd93 100755
--- a/setup.py
+++ b/setup.py
@@ -42,7 +42,7 @@ INITSYS_FILES = {
'upstart': [f for f in glob('upstart/*') if is_f(f)],
}
INITSYS_ROOTS = {
- 'sysvinit': '/etc/rc.d/init.d',
+ 'sysvinit': '/etc/init.d',
'systemd': '/etc/systemd/system/',
'upstart': '/etc/init/',
}
diff --git a/sysvinit/cloud-config b/sysvinit/cloud-config
index e587446d..ad8ed831 100755
--- a/sysvinit/cloud-config
+++ b/sysvinit/cloud-config
@@ -29,15 +29,13 @@
# Should-Start: $time
# Required-Stop:
# Should-Stop:
-# Default-Start: 3 5
-# Default-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
# Short-Description: The config cloud-init job
# Description: Start cloud-init and runs the config phase
# and any associated config modules as desired.
### END INIT INFO
-. /etc/init.d/functions
-
# Return values acc. to LSB for all commands but status:
# 0 - success
# 1 - generic or unspecified error
@@ -60,8 +58,9 @@ prog="cloud-init"
cloud_init="/usr/bin/cloud-init"
conf="/etc/cloud/cloud.cfg"
-# If there exists a sysconfig variable override file use it...
+# If there exist sysconfig/default variable override files use it...
[ -f /etc/sysconfig/cloud-init ] && . /etc/sysconfig/cloud-init
+[ -f /etc/default/cloud-init ] && . /etc/default/cloud-init
start() {
[ -x $cloud_init ] || return 5
@@ -80,8 +79,6 @@ stop() {
return $RETVAL
}
-. /etc/init.d/functions
-
case "$1" in
start)
start
diff --git a/sysvinit/cloud-final b/sysvinit/cloud-final
index 5deb8457..aeae8903 100755
--- a/sysvinit/cloud-final
+++ b/sysvinit/cloud-final
@@ -29,15 +29,13 @@
# Should-Start: $time
# Required-Stop:
# Should-Stop:
-# Default-Start: 3 5
-# Default-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
# Short-Description: The final cloud-init job
# Description: Start cloud-init and runs the final phase
# and any associated final modules as desired.
### END INIT INFO
-. /etc/init.d/functions
-
# Return values acc. to LSB for all commands but status:
# 0 - success
# 1 - generic or unspecified error
@@ -60,8 +58,9 @@ prog="cloud-init"
cloud_init="/usr/bin/cloud-init"
conf="/etc/cloud/cloud.cfg"
-# If there exists a sysconfig variable override file use it...
+# If there exist sysconfig/default variable override files use it...
[ -f /etc/sysconfig/cloud-init ] && . /etc/sysconfig/cloud-init
+[ -f /etc/default/cloud-init ] && . /etc/default/cloud-init
start() {
[ -x $cloud_init ] || return 5
@@ -80,8 +79,6 @@ stop() {
return $RETVAL
}
-. /etc/init.d/functions
-
case "$1" in
start)
start
diff --git a/sysvinit/cloud-init b/sysvinit/cloud-init
index f8ab5d5f..c1c92ad0 100755
--- a/sysvinit/cloud-init
+++ b/sysvinit/cloud-init
@@ -29,15 +29,13 @@
# Should-Start: $time
# Required-Stop:
# Should-Stop:
-# Default-Start: 3 5
-# Default-Stop:
+# Default-Start: 2 3 4 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
# and any associated initial modules as desired.
### END INIT INFO
-. /etc/init.d/functions
-
# Return values acc. to LSB for all commands but status:
# 0 - success
# 1 - generic or unspecified error
@@ -60,8 +58,9 @@ prog="cloud-init"
cloud_init="/usr/bin/cloud-init"
conf="/etc/cloud/cloud.cfg"
-# If there exists a sysconfig variable override file use it...
+# If there exist sysconfig/default variable override files use it...
[ -f /etc/sysconfig/cloud-init ] && . /etc/sysconfig/cloud-init
+[ -f /etc/default/cloud-init ] && . /etc/default/cloud-init
start() {
[ -x $cloud_init ] || return 5
@@ -80,8 +79,6 @@ stop() {
return $RETVAL
}
-. /etc/init.d/functions
-
case "$1" in
start)
start
diff --git a/sysvinit/cloud-init-local b/sysvinit/cloud-init-local
index 0c63b9b0..b53e0db2 100755
--- a/sysvinit/cloud-init-local
+++ b/sysvinit/cloud-init-local
@@ -29,15 +29,13 @@
# Should-Start: $time
# Required-Stop:
# Should-Stop:
-# Default-Start: 3 5
-# Default-Stop:
+# Default-Start: 2 3 4 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
# and any associated initial modules as desired.
### END INIT INFO
-. /etc/init.d/functions
-
# Return values acc. to LSB for all commands but status:
# 0 - success
# 1 - generic or unspecified error
@@ -60,8 +58,9 @@ prog="cloud-init"
cloud_init="/usr/bin/cloud-init"
conf="/etc/cloud/cloud.cfg"
-# If there exists a sysconfig variable override file use it...
+# If there exist sysconfig/default variable override files use it...
[ -f /etc/sysconfig/cloud-init ] && . /etc/sysconfig/cloud-init
+[ -f /etc/default/cloud-init ] && . /etc/default/cloud-init
start() {
[ -x $cloud_init ] || return 5
@@ -80,8 +79,6 @@ stop() {
return $RETVAL
}
-. /etc/init.d/functions
-
case "$1" in
start)
start