forked from pool/cloud-init
- Fix sed expression to set distro properly (boo#1063716)
+ Remove suseSysVInit.diff, included upstream OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=91
This commit is contained in:
parent
b710a65ad2
commit
f65f28891b
@ -1,40 +0,0 @@
|
||||
--- config/cloud.cfg.tmpl.orig
|
||||
+++ config/cloud.cfg.tmpl
|
||||
@@ -79,6 +79,9 @@ cloud_config_modules:
|
||||
- spacewalk
|
||||
- yum-add-repo
|
||||
{% endif %}
|
||||
+{% if variant in ["opensuse", "suse"] %}
|
||||
+ - zypper_add_repo
|
||||
+{% endif %}
|
||||
{% if variant in ["ubuntu", "unknown", "debian"] %}
|
||||
- grub-dpkg
|
||||
- apt-pipelining
|
||||
@@ -127,7 +130,7 @@ cloud_final_modules:
|
||||
# (not accessible to handlers/transforms)
|
||||
system_info:
|
||||
# This will affect which distro class gets used
|
||||
-{% if variant in ["centos", "debian", "fedora", "rhel", "ubuntu", "freebsd"] %}
|
||||
+{% if variant in ["centos", "debian", "fedora", "opensuse", "rhel", "suse", "ubuntu", "freebsd"] %}
|
||||
distro: {{ variant }}
|
||||
{% else %}
|
||||
# Unknown/fallback distro.
|
||||
@@ -186,4 +189,18 @@ system_info:
|
||||
groups: [wheel]
|
||||
sudo: ["ALL=(ALL) NOPASSWD:ALL"]
|
||||
shell: /bin/tcsh
|
||||
+{% elif variant in ["opensuse", "suse"] %}
|
||||
+ # Default user name + that default users groups (if added/used)
|
||||
+ default_user:
|
||||
+ name: {{ variant }}
|
||||
+ lock_passwd: True
|
||||
+ gecos: {{ variant }} Cloud User
|
||||
+ groups: [cdrom, users]
|
||||
+ sudo: ["ALL=(ALL) NOPASSWD:ALL"]
|
||||
+ shell: /bin/bash
|
||||
+ # Other config here will be given to the distro class and/or path classes
|
||||
+ paths:
|
||||
+ cloud_dir: /var/lib/cloud/
|
||||
+ templates_dir: /etc/cloud/templates/
|
||||
+ ssh_svcname: sshd
|
||||
{% endif %}
|
@ -1,11 +0,0 @@
|
||||
--- cloudinit/util.py.orig
|
||||
+++ cloudinit/util.py
|
||||
@@ -599,6 +599,8 @@ def system_info():
|
||||
var = 'ubuntu'
|
||||
elif linux_dist == 'redhat':
|
||||
var = 'rhel'
|
||||
+ elif linux_dist == 'suse':
|
||||
+ var = 'suse'
|
||||
else:
|
||||
var = 'linux'
|
||||
elif system in ('windows', 'darwin', "freebsd"):
|
@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Nov 2 13:16:49 UTC 2017 - rjschwei@suse.com
|
||||
|
||||
- Fix sed expression to set distro properly (boo#1063716)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Sep 21 17:32:55 EDT 2017 - rjschwei@suse.com
|
||||
|
||||
@ -17,7 +22,7 @@ Thu Sep 21 17:32:55 EDT 2017 - rjschwei@suse.com
|
||||
+ Remove cloud-init-no-dmidecode-on-ppc64.patch, included upstream
|
||||
+ Remove dataSourceOpenNebula.patch, use upstream implementation
|
||||
+ Remove setupSUSEsysVInit.diff, included upstream
|
||||
+ Remove SUSEsysVInit.diff, included upstream
|
||||
+ Remove suseSysVInit.diff, included upstream
|
||||
+ Remove cloud-init-finalbeforelogin.patch, don't block login
|
||||
+ Remove cloud-init-handle-not-implemented-query.patch, query option removed
|
||||
+ Remove cloud-init-spceandtabs-clean.patch, indentation fixed upstream
|
||||
|
@ -246,14 +246,13 @@ cp LICENSE %{buildroot}%{docdir}
|
||||
%if 0%{?suse_version}
|
||||
%if 0%{?suse_version} < 1130
|
||||
#SLE 11, openSUSE 11.x is EOL
|
||||
sed -i s/INSERT_SUSE_DISTRO/sles/ %{buildroot}/%{_sysconfdir}/cloud/cloud.cfg
|
||||
sed -i s/suse/sles/ %{buildroot}/%{_sysconfdir}/cloud/cloud.cfg
|
||||
%endif
|
||||
%if 0%{?suse_version} > 1140
|
||||
%if 0%{?suse_version} == 1315
|
||||
# SLE 12
|
||||
sed -i s/INSERT_SUSE_DISTRO/sles/ %{buildroot}/%{_sysconfdir}/cloud/cloud.cfg
|
||||
%if 0%{?is_opensuse}
|
||||
sed -i s/suse/opensuse/ %{buildroot}/%{_sysconfdir}/cloud/cloud.cfg
|
||||
%else
|
||||
sed -i s/INSERT_SUSE_DISTRO/opensuse/ %{buildroot}/%{_sysconfdir}/cloud/cloud.cfg
|
||||
sed -i s/suse/sles/ %{buildroot}/%{_sysconfdir}/cloud/cloud.cfg
|
||||
%endif
|
||||
%endif
|
||||
%endif
|
||||
|
@ -1,529 +0,0 @@
|
||||
diff -urN cloud-init-0.7.4.orig/sysvinit/suse/cloud-config cloud-init-0.7.4/sysvinit/suse/cloud-config
|
||||
--- cloud-init-0.7.4.orig/sysvinit/suse/cloud-config 1969-12-31 19:00:00.000000000 -0500
|
||||
+++ cloud-init-0.7.4/sysvinit/suse/cloud-config 2014-01-04 10:41:15.261034684 -0500
|
||||
@@ -0,0 +1,128 @@
|
||||
+#!/bin/sh
|
||||
+
|
||||
+#
|
||||
+# Copyright (C) 2012 Yahoo! Inc.
|
||||
+# Copyright (C) 2013 SUSE LLC
|
||||
+#
|
||||
+# Author: Joshua Harlow <harlowja@yahoo-inc.com>
|
||||
+# Author: Robert Schweikert <rjschwei@suse.com>
|
||||
+#
|
||||
+# This program is free software: you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License version 3, as
|
||||
+# published by the Free Software Foundation.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+#
|
||||
+
|
||||
+# See: http://wiki.debian.org/LSBInitScripts
|
||||
+# See: http://tiny.cc/czvbgw
|
||||
+# See: http://www.novell.com/coolsolutions/feature/15380.html
|
||||
+# Also based on dhcpd in RHEL (for comparison)
|
||||
+
|
||||
+### BEGIN INIT INFO
|
||||
+# Provides: cloud-config
|
||||
+# Required-Start: cloud-init cloud-init-local
|
||||
+# Should-Start: $time
|
||||
+# 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
|
||||
+# and any associated config modules as desired.
|
||||
+### END INIT INFO
|
||||
+
|
||||
+# Return values acc. to LSB for all commands but status:
|
||||
+# 0 - success
|
||||
+# 1 - generic or unspecified error
|
||||
+# 2 - invalid or excess argument(s)
|
||||
+# 3 - unimplemented feature (e.g. "reload")
|
||||
+# 4 - user had insufficient privileges
|
||||
+# 5 - program is not installed
|
||||
+# 6 - program is not configured
|
||||
+# 7 - program is not running
|
||||
+# 8--199 - reserved (8--99 LSB, 100--149 distrib, 150--199 appl)
|
||||
+#
|
||||
+# Note that starting an already running service, stopping
|
||||
+# or restarting a not-running service as well as the restart
|
||||
+# with force-reload (in case signaling is not supported) are
|
||||
+# considered a success.
|
||||
+
|
||||
+RETVAL=0
|
||||
+
|
||||
+prog="cloud-init"
|
||||
+cloud_init="/usr/bin/cloud-init"
|
||||
+conf="/etc/cloud/cloud.cfg"
|
||||
+
|
||||
+# 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
|
||||
+
|
||||
+. /etc/rc.status
|
||||
+rc_reset
|
||||
+
|
||||
+start() {
|
||||
+ [ -x $cloud_init ] || return 5
|
||||
+ [ -f $conf ] || return 6
|
||||
+
|
||||
+ echo -n $"Starting $prog: "
|
||||
+ $cloud_init $CLOUDINITARGS modules --mode config
|
||||
+ RETVAL=$?
|
||||
+ return $RETVAL
|
||||
+}
|
||||
+
|
||||
+stop() {
|
||||
+ echo -n $"Shutting down $prog: "
|
||||
+ # No-op
|
||||
+ RETVAL=7
|
||||
+ return $RETVAL
|
||||
+}
|
||||
+
|
||||
+case "$1" in
|
||||
+ start)
|
||||
+ start
|
||||
+ RETVAL=$?
|
||||
+ ;;
|
||||
+ stop)
|
||||
+ stop
|
||||
+ RETVAL=$?
|
||||
+ ;;
|
||||
+ restart|try-restart|condrestart)
|
||||
+ ## Stop the service and regardless of whether it was
|
||||
+ ## running or not, start it again.
|
||||
+ #
|
||||
+ ## Note: try-restart is now part of LSB (as of 1.9).
|
||||
+ ## RH has a similar command named condrestart.
|
||||
+ start
|
||||
+ RETVAL=$?
|
||||
+ ;;
|
||||
+ reload|force-reload)
|
||||
+ # It does not support reload
|
||||
+ RETVAL=3
|
||||
+ ;;
|
||||
+ status)
|
||||
+ echo -n $"Checking for service $prog:"
|
||||
+ # Return value is slightly different for the status command:
|
||||
+ # 0 - service up and running
|
||||
+ # 1 - service dead, but /var/run/ pid file exists
|
||||
+ # 2 - service dead, but /var/lock/ lock file exists
|
||||
+ # 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}"
|
||||
+ RETVAL=3
|
||||
+ ;;
|
||||
+esac
|
||||
+
|
||||
+_rc_status=$RETVAL
|
||||
+rc_status -v
|
||||
+rc_exit
|
||||
diff -urN cloud-init-0.7.4.orig/sysvinit/suse/cloud-final cloud-init-0.7.4/sysvinit/suse/cloud-final
|
||||
--- cloud-init-0.7.4.orig/sysvinit/suse/cloud-final 1969-12-31 19:00:00.000000000 -0500
|
||||
+++ cloud-init-0.7.4/sysvinit/suse/cloud-final 2014-01-04 10:40:57.354381148 -0500
|
||||
@@ -0,0 +1,128 @@
|
||||
+#!/bin/sh
|
||||
+
|
||||
+#
|
||||
+# Copyright (C) 2012 Yahoo! Inc.
|
||||
+# Copyright (C) 2013 SUSE LLC
|
||||
+#
|
||||
+# Author: Joshua Harlow <harlowja@yahoo-inc.com>
|
||||
+# Author: Robert Schweikert <rjschwei@suse.com>
|
||||
+#
|
||||
+# This program is free software: you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License version 3, as
|
||||
+# published by the Free Software Foundation.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+#
|
||||
+
|
||||
+# See: http://wiki.debian.org/LSBInitScripts
|
||||
+# See: http://tiny.cc/czvbgw
|
||||
+# See: http://www.novell.com/coolsolutions/feature/15380.html
|
||||
+# Also based on dhcpd in RHEL (for comparison)
|
||||
+
|
||||
+### BEGIN INIT INFO
|
||||
+# Provides: cloud-final
|
||||
+# Required-Start: cloud-config
|
||||
+# Should-Start: $time
|
||||
+# 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
|
||||
+# and any associated final modules as desired.
|
||||
+### END INIT INFO
|
||||
+
|
||||
+# Return values acc. to LSB for all commands but status:
|
||||
+# 0 - success
|
||||
+# 1 - generic or unspecified error
|
||||
+# 2 - invalid or excess argument(s)
|
||||
+# 3 - unimplemented feature (e.g. "reload")
|
||||
+# 4 - user had insufficient privileges
|
||||
+# 5 - program is not installed
|
||||
+# 6 - program is not configured
|
||||
+# 7 - program is not running
|
||||
+# 8--199 - reserved (8--99 LSB, 100--149 distrib, 150--199 appl)
|
||||
+#
|
||||
+# Note that starting an already running service, stopping
|
||||
+# or restarting a not-running service as well as the restart
|
||||
+# with force-reload (in case signaling is not supported) are
|
||||
+# considered a success.
|
||||
+
|
||||
+RETVAL=0
|
||||
+
|
||||
+prog="cloud-init"
|
||||
+cloud_init="/usr/bin/cloud-init"
|
||||
+conf="/etc/cloud/cloud.cfg"
|
||||
+
|
||||
+# 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
|
||||
+
|
||||
+. /etc/rc.status
|
||||
+rc_reset
|
||||
+
|
||||
+start() {
|
||||
+ [ -x $cloud_init ] || return 5
|
||||
+ [ -f $conf ] || return 6
|
||||
+
|
||||
+ echo -n $"Starting $prog: "
|
||||
+ $cloud_init $CLOUDINITARGS modules --mode final
|
||||
+ RETVAL=$?
|
||||
+ return $RETVAL
|
||||
+}
|
||||
+
|
||||
+stop() {
|
||||
+ echo -n $"Shutting down $prog: "
|
||||
+ # No-op
|
||||
+ RETVAL=7
|
||||
+ return $RETVAL
|
||||
+}
|
||||
+
|
||||
+case "$1" in
|
||||
+ start)
|
||||
+ start
|
||||
+ RETVAL=$?
|
||||
+ ;;
|
||||
+ stop)
|
||||
+ stop
|
||||
+ RETVAL=$?
|
||||
+ ;;
|
||||
+ restart|try-restart|condrestart)
|
||||
+ ## Stop the service and regardless of whether it was
|
||||
+ ## running or not, start it again.
|
||||
+ #
|
||||
+ ## Note: try-restart is now part of LSB (as of 1.9).
|
||||
+ ## RH has a similar command named condrestart.
|
||||
+ start
|
||||
+ RETVAL=$?
|
||||
+ ;;
|
||||
+ reload|force-reload)
|
||||
+ # It does not support reload
|
||||
+ RETVAL=3
|
||||
+ ;;
|
||||
+ status)
|
||||
+ echo -n $"Checking for service $prog:"
|
||||
+ # Return value is slightly different for the status command:
|
||||
+ # 0 - service up and running
|
||||
+ # 1 - service dead, but /var/run/ pid file exists
|
||||
+ # 2 - service dead, but /var/lock/ lock file exists
|
||||
+ # 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}"
|
||||
+ RETVAL=3
|
||||
+ ;;
|
||||
+esac
|
||||
+
|
||||
+_rc_status=$RETVAL
|
||||
+rc_status -v
|
||||
+rc_exit
|
||||
diff -urN cloud-init-0.7.4.orig/sysvinit/suse/cloud-init cloud-init-0.7.4/sysvinit/suse/cloud-init
|
||||
--- cloud-init-0.7.4.orig/sysvinit/suse/cloud-init 1969-12-31 19:00:00.000000000 -0500
|
||||
+++ cloud-init-0.7.4/sysvinit/suse/cloud-init 2014-01-04 10:40:41.874680652 -0500
|
||||
@@ -0,0 +1,129 @@
|
||||
+#!/bin/sh
|
||||
+
|
||||
+#
|
||||
+# Copyright (C) 2012 Yahoo! Inc.
|
||||
+# Copyright (C) 2013 SUSE LLC
|
||||
+#
|
||||
+# Author: Joshua Harlow <harlowja@yahoo-inc.com>
|
||||
+# Author: Robert Schweikert <rjschwei@suse.com>
|
||||
+#
|
||||
+# This program is free software: you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License version 3, as
|
||||
+# published by the Free Software Foundation.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+#
|
||||
+
|
||||
+# See: http://wiki.debian.org/LSBInitScripts
|
||||
+# See: http://tiny.cc/czvbgw
|
||||
+# See: http://www.novell.com/coolsolutions/feature/15380.html
|
||||
+# Also based on dhcpd in RHEL (for comparison)
|
||||
+
|
||||
+### BEGIN INIT INFO
|
||||
+# Provides: cloud-init
|
||||
+# Required-Start: $local_fs $network $named $remote_fs cloud-init-local
|
||||
+# Should-Start: $time
|
||||
+# 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
|
||||
+# and any associated initial modules as desired.
|
||||
+### END INIT INFO
|
||||
+
|
||||
+# Return values acc. to LSB for all commands but status:
|
||||
+# 0 - success
|
||||
+# 1 - generic or unspecified error
|
||||
+# 2 - invalid or excess argument(s)
|
||||
+# 3 - unimplemented feature (e.g. "reload")
|
||||
+# 4 - user had insufficient privileges
|
||||
+# 5 - program is not installed
|
||||
+# 6 - program is not configured
|
||||
+# 7 - program is not running
|
||||
+# 8--199 - reserved (8--99 LSB, 100--149 distrib, 150--199 appl)
|
||||
+#
|
||||
+# Note that starting an already running service, stopping
|
||||
+# or restarting a not-running service as well as the restart
|
||||
+# with force-reload (in case signaling is not supported) are
|
||||
+# considered a success.
|
||||
+
|
||||
+RETVAL=0
|
||||
+
|
||||
+prog="cloud-init"
|
||||
+cloud_init="/usr/bin/cloud-init"
|
||||
+conf="/etc/cloud/cloud.cfg"
|
||||
+
|
||||
+# 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
|
||||
+
|
||||
+. /etc/rc.status
|
||||
+rc_reset
|
||||
+
|
||||
+start() {
|
||||
+ [ -x $cloud_init ] || return 5
|
||||
+ [ -f $conf ] || return 6
|
||||
+
|
||||
+ echo -n $"Starting $prog: "
|
||||
+ $cloud_init $CLOUDINITARGS init
|
||||
+ RETVAL=$?
|
||||
+ return $RETVAL
|
||||
+}
|
||||
+
|
||||
+stop() {
|
||||
+ echo -n $"Shutting down $prog: "
|
||||
+ # No-op
|
||||
+ RETVAL=7
|
||||
+ return $RETVAL
|
||||
+}
|
||||
+
|
||||
+case "$1" in
|
||||
+ start)
|
||||
+ start
|
||||
+ RETVAL=$?
|
||||
+ ;;
|
||||
+ stop)
|
||||
+ stop
|
||||
+ RETVAL=$?
|
||||
+ ;;
|
||||
+ restart|try-restart|condrestart)
|
||||
+ ## Stop the service and regardless of whether it was
|
||||
+ ## running or not, start it again.
|
||||
+ #
|
||||
+ ## Note: try-restart is now part of LSB (as of 1.9).
|
||||
+ ## RH has a similar command named condrestart.
|
||||
+ start
|
||||
+ RETVAL=$?
|
||||
+ ;;
|
||||
+ reload|force-reload)
|
||||
+ # It does not support reload
|
||||
+ RETVAL=3
|
||||
+ ;;
|
||||
+ 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
|
||||
+ # 2 - service dead, but /var/lock/ lock file exists
|
||||
+ # 3 - service not running (unused)
|
||||
+ # 4 - service status unknown :-(
|
||||
+ # 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.)
|
||||
+ ;;
|
||||
+ *)
|
||||
+ echo "Usage: $0 {start|stop|status|try-restart|condrestart|restart|force-reload|reload}"
|
||||
+ RETVAL=3
|
||||
+ ;;
|
||||
+esac
|
||||
+
|
||||
+_rc_status=$RETVAL
|
||||
+rc_status -v
|
||||
+rc_exit
|
||||
diff -urN cloud-init-0.7.4.orig/sysvinit/suse/cloud-init-local cloud-init-0.7.4/sysvinit/suse/cloud-init-local
|
||||
--- cloud-init-0.7.4.orig/sysvinit/suse/cloud-init-local 1969-12-31 19:00:00.000000000 -0500
|
||||
+++ cloud-init-0.7.4/sysvinit/suse/cloud-init-local 2014-01-04 10:39:53.411618325 -0500
|
||||
@@ -0,0 +1,128 @@
|
||||
+#!/bin/sh
|
||||
+
|
||||
+#
|
||||
+# Copyright (C) 2012 Yahoo! Inc.
|
||||
+# Copyright (C) 2013 SUSE LLC
|
||||
+#
|
||||
+# Author: Joshua Harlow <harlowja@yahoo-inc.com>
|
||||
+# Author: Robert Schweikert <rjschwei@suse.com>
|
||||
+#
|
||||
+# This program is free software: you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License version 3, as
|
||||
+# published by the Free Software Foundation.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+#
|
||||
+
|
||||
+# See: http://wiki.debian.org/LSBInitScripts
|
||||
+# See: http://tiny.cc/czvbgw
|
||||
+# See: http://www.novell.com/coolsolutions/feature/15380.html
|
||||
+# Also based on dhcpd in RHEL (for comparison)
|
||||
+
|
||||
+### BEGIN INIT INFO
|
||||
+# Provides: cloud-init-local
|
||||
+# Required-Start: $local_fs $remote_fs
|
||||
+# Should-Start: $time
|
||||
+# 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
|
||||
+# and any associated initial modules as desired.
|
||||
+### END INIT INFO
|
||||
+
|
||||
+# Return values acc. to LSB for all commands but status:
|
||||
+# 0 - success
|
||||
+# 1 - generic or unspecified error
|
||||
+# 2 - invalid or excess argument(s)
|
||||
+# 3 - unimplemented feature (e.g. "reload")
|
||||
+# 4 - user had insufficient privileges
|
||||
+# 5 - program is not installed
|
||||
+# 6 - program is not configured
|
||||
+# 7 - program is not running
|
||||
+# 8--199 - reserved (8--99 LSB, 100--149 distrib, 150--199 appl)
|
||||
+#
|
||||
+# Note that starting an already running service, stopping
|
||||
+# or restarting a not-running service as well as the restart
|
||||
+# with force-reload (in case signaling is not supported) are
|
||||
+# considered a success.
|
||||
+
|
||||
+RETVAL=0
|
||||
+
|
||||
+prog="cloud-init"
|
||||
+cloud_init="/usr/bin/cloud-init"
|
||||
+conf="/etc/cloud/cloud.cfg"
|
||||
+
|
||||
+# 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
|
||||
+
|
||||
+. /etc/rc.status
|
||||
+rc_reset
|
||||
+
|
||||
+start() {
|
||||
+ [ -x $cloud_init ] || return 5
|
||||
+ [ -f $conf ] || return 6
|
||||
+
|
||||
+ echo -n $"Starting $prog: "
|
||||
+ $cloud_init $CLOUDINITARGS init --local
|
||||
+ RETVAL=$?
|
||||
+ return $RETVAL
|
||||
+}
|
||||
+
|
||||
+stop() {
|
||||
+ echo -n $"Shutting down $prog: "
|
||||
+ # No-op
|
||||
+ RETVAL=7
|
||||
+ return $RETVAL
|
||||
+}
|
||||
+
|
||||
+case "$1" in
|
||||
+ start)
|
||||
+ start
|
||||
+ RETVAL=$?
|
||||
+ ;;
|
||||
+ stop)
|
||||
+ stop
|
||||
+ RETVAL=$?
|
||||
+ ;;
|
||||
+ restart|try-restart|condrestart)
|
||||
+ ## Stop the service and regardless of whether it was
|
||||
+ ## running or not, start it again.
|
||||
+ #
|
||||
+ ## Note: try-restart is now part of LSB (as of 1.9).
|
||||
+ ## RH has a similar command named condrestart.
|
||||
+ start
|
||||
+ RETVAL=$?
|
||||
+ ;;
|
||||
+ reload|force-reload)
|
||||
+ # It does not support reload
|
||||
+ RETVAL=3
|
||||
+ ;;
|
||||
+ status)
|
||||
+ echo -n $"Checking for service $prog:"
|
||||
+ # Return value is slightly different for the status command:
|
||||
+ # 0 - service up and running
|
||||
+ # 1 - service dead, but /var/run/ pid file exists
|
||||
+ # 2 - service dead, but /var/lock/ lock file exists
|
||||
+ # 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}"
|
||||
+ RETVAL=3
|
||||
+ ;;
|
||||
+esac
|
||||
+
|
||||
+_rc_status=$RETVAL
|
||||
+rc_status -v
|
||||
+rc_exit
|
Loading…
Reference in New Issue
Block a user