summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2013-07-25 17:03:55 -0400
committerScott Moser <smoser@ubuntu.com>2013-07-25 17:03:55 -0400
commitf8114e58dbbd84ec91a6fb8a8adec9be3bfbab52 (patch)
tree6c30f14fada642e8e331e40c901d7ce4036a532f
parent4d9668dac5fed8f713f3b4300fdb574f399c14ee (diff)
parent60dfcb852c3dafdcf3563cc3e6c631dfbc2bafd8 (diff)
downloadvyos-cloud-init-f8114e58dbbd84ec91a6fb8a8adec9be3bfbab52.tar.gz
vyos-cloud-init-f8114e58dbbd84ec91a6fb8a8adec9be3bfbab52.zip
add debian init scripts
These are debian's init scripts as taken from their trunk svn as of today. Thanks Juerg.
-rwxr-xr-xpackages/bddeb8
-rwxr-xr-xsetup.py4
-rw-r--r--sysvinit/debian/cloud-config64
-rw-r--r--sysvinit/debian/cloud-final66
-rwxr-xr-xsysvinit/debian/cloud-init64
-rw-r--r--sysvinit/debian/cloud-init-local63
-rwxr-xr-xsysvinit/redhat/cloud-config (renamed from sysvinit/cloud-config)0
-rwxr-xr-xsysvinit/redhat/cloud-final (renamed from sysvinit/cloud-final)0
-rwxr-xr-xsysvinit/redhat/cloud-init (renamed from sysvinit/cloud-init)0
-rwxr-xr-xsysvinit/redhat/cloud-init-local (renamed from sysvinit/cloud-init-local)0
10 files changed, 267 insertions, 2 deletions
diff --git a/packages/bddeb b/packages/bddeb
index 7ae07a80..15d424f2 100755
--- a/packages/bddeb
+++ b/packages/bddeb
@@ -95,12 +95,20 @@ def main():
default=False,
action='store_true')
+ parser.add_argument("--init-system", dest="init_system",
+ help=("build deb with INIT_SYSTEM=xxx"
+ " (default: %(default)s"),
+ default=os.environ.get("INIT_SYSTEM", "upstart"))
+
+
for ent in DEBUILD_ARGS:
parser.add_argument(ent, dest="debuild_args", action='append_const',
const=ent, help=("pass through '%s' to debuild" % ent))
args = parser.parse_args()
+ os.environ['INIT_SYSTEM'] = args.init_system
+
capture = True
if args.verbose:
capture = False
diff --git a/setup.py b/setup.py
index 4aa1a47c..8d18b97e 100755
--- a/setup.py
+++ b/setup.py
@@ -37,8 +37,8 @@ def is_f(p):
INITSYS_FILES = {
- 'sysvinit': [f for f in glob('sysvinit/*') if is_f(f)],
- 'sysvinit_deb': [f for f in glob('sysvinit/*') if is_f(f)],
+ 'sysvinit': [f for f in glob('sysvinit/redhat/*') if is_f(f)],
+ 'sysvinit_deb': [f for f in glob('sysvinit/debian/*') if is_f(f)],
'systemd': [f for f in glob('systemd/*') if is_f(f)],
'upstart': [f for f in glob('upstart/*') if is_f(f)],
}
diff --git a/sysvinit/debian/cloud-config b/sysvinit/debian/cloud-config
new file mode 100644
index 00000000..53322748
--- /dev/null
+++ b/sysvinit/debian/cloud-config
@@ -0,0 +1,64 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: cloud-config
+# Required-Start: cloud-init cloud-init-local
+# Required-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Cloud init modules --mode config
+# Description: Cloud configuration initialization
+### END INIT INFO
+
+# Authors: Julien Danjou <acid@debian.org>
+# Juerg Haefliger <juerg.haefliger@hp.com>
+# Thomas Goirand <zigo@debian.org>
+
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="Cloud service"
+NAME=cloud-init
+DAEMON=/usr/bin/$NAME
+DAEMON_ARGS="modules --mode config"
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
+# and status_of_proc is working.
+. /lib/lsb/init-functions
+
+if init_is_upstart; then
+ case "$1" in
+ stop)
+ exit 0
+ ;;
+ *)
+ exit 1
+ ;;
+ esac
+fi
+
+case "$1" in
+start)
+ log_daemon_msg "Starting $DESC" "$NAME"
+ $DAEMON ${DAEMON_ARGS}
+ case "$?" in
+ 0|1) log_end_msg 0 ;;
+ 2) log_end_msg 1 ;;
+ esac
+;;
+stop|restart|force-reload)
+ echo "Error: argument '$1' not supported" >&2
+ exit 3
+;;
+*)
+ echo "Usage: $SCRIPTNAME {start}" >&2
+ exit 3
+;;
+esac
+
+:
diff --git a/sysvinit/debian/cloud-final b/sysvinit/debian/cloud-final
new file mode 100644
index 00000000..55afc8b0
--- /dev/null
+++ b/sysvinit/debian/cloud-final
@@ -0,0 +1,66 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: cloud-final
+# Required-Start: $all cloud-config
+# Required-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Cloud init modules final jobs
+# Description: This runs the cloud configuration initialization "final" jobs
+# and can be seen as the traditional "rc.local" time for the cloud.
+# It runs after all cloud-config jobs are run
+### END INIT INFO
+
+# Authors: Julien Danjou <acid@debian.org>
+# Juerg Haefliger <juerg.haefliger@hp.com>
+# Thomas Goirand <zigo@debian.org>
+
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="Cloud service"
+NAME=cloud-init
+DAEMON=/usr/bin/$NAME
+DAEMON_ARGS="modules --mode final"
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
+# and status_of_proc is working.
+. /lib/lsb/init-functions
+
+if init_is_upstart; then
+ case "$1" in
+ stop)
+ exit 0
+ ;;
+ *)
+ exit 1
+ ;;
+ esac
+fi
+
+case "$1" in
+start)
+ log_daemon_msg "Starting $DESC" "$NAME"
+ $DAEMON ${DAEMON_ARGS}
+ case "$?" in
+ 0|1) log_end_msg 0 ;;
+ 2) log_end_msg 1 ;;
+ esac
+;;
+stop|restart|force-reload)
+ echo "Error: argument '$1' not supported" >&2
+ exit 3
+;;
+*)
+ echo "Usage: $SCRIPTNAME {start}" >&2
+ exit 3
+;;
+esac
+
+:
diff --git a/sysvinit/debian/cloud-init b/sysvinit/debian/cloud-init
new file mode 100755
index 00000000..48fa0423
--- /dev/null
+++ b/sysvinit/debian/cloud-init
@@ -0,0 +1,64 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: cloud-init
+# Required-Start: $local_fs $remote_fs $syslog $network cloud-init-local
+# Required-Stop: $remote_fs
+# X-Start-Before: sshd
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Cloud init
+# Description: Cloud configuration initialization
+### END INIT INFO
+
+# Authors: Julien Danjou <acid@debian.org>
+# Thomas Goirand <zigo@debian.org>
+
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="Cloud service"
+NAME=cloud-init
+DAEMON=/usr/bin/$NAME
+DAEMON_ARGS="init"
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
+# and status_of_proc is working.
+. /lib/lsb/init-functions
+
+if init_is_upstart; then
+ case "$1" in
+ stop)
+ exit 0
+ ;;
+ *)
+ exit 1
+ ;;
+ esac
+fi
+
+case "$1" in
+ start)
+ log_daemon_msg "Starting $DESC" "$NAME"
+ $DAEMON ${DAEMON_ARGS}
+ case "$?" in
+ 0|1) log_end_msg 0 ;;
+ 2) log_end_msg 1 ;;
+ esac
+ ;;
+ stop|restart|force-reload)
+ echo "Error: argument '$1' not supported" >&2
+ exit 3
+ ;;
+ *)
+ echo "Usage: $SCRIPTNAME {start}" >&2
+ exit 3
+ ;;
+esac
+
+:
diff --git a/sysvinit/debian/cloud-init-local b/sysvinit/debian/cloud-init-local
new file mode 100644
index 00000000..802ee8e9
--- /dev/null
+++ b/sysvinit/debian/cloud-init-local
@@ -0,0 +1,63 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: cloud-init-local
+# Required-Start: $local_fs $remote_fs
+# Required-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Cloud init local
+# Description: Cloud configuration initialization
+### END INIT INFO
+
+# Authors: Julien Danjou <acid@debian.org>
+# Juerg Haefliger <juerg.haefliger@hp.com>
+
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="Cloud service"
+NAME=cloud-init
+DAEMON=/usr/bin/$NAME
+DAEMON_ARGS="init --local"
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
+# and status_of_proc is working.
+. /lib/lsb/init-functions
+
+if init_is_upstart; then
+ case "$1" in
+ stop)
+ exit 0
+ ;;
+ *)
+ exit 1
+ ;;
+ esac
+fi
+
+case "$1" in
+start)
+ log_daemon_msg "Starting $DESC" "$NAME"
+ $DAEMON ${DAEMON_ARGS}
+ case "$?" in
+ 0|1) log_end_msg 0 ;;
+ 2) log_end_msg 1 ;;
+ esac
+;;
+stop|restart|force-reload)
+ echo "Error: argument '$1' not supported" >&2
+ exit 3
+;;
+*)
+ echo "Usage: $SCRIPTNAME {start}" >&2
+ exit 3
+;;
+esac
+
+:
diff --git a/sysvinit/cloud-config b/sysvinit/redhat/cloud-config
index ad8ed831..ad8ed831 100755
--- a/sysvinit/cloud-config
+++ b/sysvinit/redhat/cloud-config
diff --git a/sysvinit/cloud-final b/sysvinit/redhat/cloud-final
index aeae8903..aeae8903 100755
--- a/sysvinit/cloud-final
+++ b/sysvinit/redhat/cloud-final
diff --git a/sysvinit/cloud-init b/sysvinit/redhat/cloud-init
index c1c92ad0..c1c92ad0 100755
--- a/sysvinit/cloud-init
+++ b/sysvinit/redhat/cloud-init
diff --git a/sysvinit/cloud-init-local b/sysvinit/redhat/cloud-init-local
index b53e0db2..b53e0db2 100755
--- a/sysvinit/cloud-init-local
+++ b/sysvinit/redhat/cloud-init-local