summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorBen Howard <ben.howard@ubuntu.com>2015-08-14 16:40:41 -0600
committerusd-importer <ubuntu-server@lists.ubuntu.com>2015-08-15 14:33:21 +0000
commitf78b9650d0e7b008d430673a075aad95dda863be (patch)
treea6749619e78483d45a66d4bad4d6e922391541fc /init
parent0afc048f2a6ff3638ecfa33e7ded5dc8dddf041a (diff)
downloadvyos-walinuxagent-f78b9650d0e7b008d430673a075aad95dda863be.tar.gz
vyos-walinuxagent-f78b9650d0e7b008d430673a075aad95dda863be.zip
Import patches-unapplied version 2.1.1-0ubuntu1 to ubuntu/wily-proposed
Imported using git-ubuntu import. Changelog parent: 0afc048f2a6ff3638ecfa33e7ded5dc8dddf041a New changelog entries: * New upstream release for Ubuntu. - Switch to Python3 - Applies Ubuntu specific patches
Diffstat (limited to 'init')
-rw-r--r--init/coreos/cloud-config.yml52
-rw-r--r--init/ubuntu/walinuxagent2
-rw-r--r--init/ubuntu/walinuxagent.conf26
-rwxr-xr-xinit/ubuntu/walinuxagent.service15
-rwxr-xr-xinit/waagent57
-rwxr-xr-xinit/waagent.service14
6 files changed, 166 insertions, 0 deletions
diff --git a/init/coreos/cloud-config.yml b/init/coreos/cloud-config.yml
new file mode 100644
index 0000000..461dc1a
--- /dev/null
+++ b/init/coreos/cloud-config.yml
@@ -0,0 +1,52 @@
+#cloud-config
+
+coreos:
+ units:
+ - name: etcd.service
+ runtime: true
+ drop-ins:
+ - name: 10-oem.conf
+ content: |
+ [Service]
+ Environment=ETCD_PEER_ELECTION_TIMEOUT=1200
+
+ - name: etcd2.service
+ runtime: true
+ drop-ins:
+ - name: 10-oem.conf
+ content: |
+ [Service]
+ Environment=ETCD_ELECTION_TIMEOUT=1200
+
+ - name: waagent.service
+ command: start
+ runtime: true
+ content: |
+ [Unit]
+ Description=Microsoft Azure Agent
+ Wants=network-online.target sshd-keygen.service
+ After=network-online.target sshd-keygen.service
+
+ [Service]
+ Type=simple
+ Restart=always
+ RestartSec=5s
+ ExecStart=/usr/share/oem/python/bin/python /usr/share/oem/bin/waagent -daemon
+
+ - name: oem-cloudinit.service
+ command: restart
+ runtime: yes
+ content: |
+ [Unit]
+ Description=Cloudinit from Azure metadata
+
+ [Service]
+ Type=oneshot
+ ExecStart=/usr/bin/coreos-cloudinit --oem=azure
+
+ oem:
+ id: azure
+ name: Microsoft Azure
+ version-id: 2.1.0
+ home-url: https://azure.microsoft.com/
+ bug-report-url: https://github.com/coreos/bugs/issues
diff --git a/init/ubuntu/walinuxagent b/init/ubuntu/walinuxagent
new file mode 100644
index 0000000..a17174c
--- /dev/null
+++ b/init/ubuntu/walinuxagent
@@ -0,0 +1,2 @@
+# To disable the Windows Azure Agent, set WALINUXAGENT_ENABLED=0
+WALINUXAGENT_ENABLED=1
diff --git a/init/ubuntu/walinuxagent.conf b/init/ubuntu/walinuxagent.conf
new file mode 100644
index 0000000..2ce6608
--- /dev/null
+++ b/init/ubuntu/walinuxagent.conf
@@ -0,0 +1,26 @@
+description "Windows Azure Linux agent"
+author "Ben Howard <ben.howard@canonical.com>"
+
+start on runlevel [2345]
+stop on runlevel [!2345]
+
+pre-start script
+
+ [ -r /etc/default/walinuxagent ] && . /etc/default/walinuxagent
+
+ if [ "$WALINUXAGENT_ENABLED" != "1" ]; then
+ stop ; exit 0
+ fi
+
+ if [ ! -x /usr/sbin/waagent ]; then
+ stop ; exit 0
+ fi
+
+ #Load the udf module
+ modprobe -b udf
+
+end script
+
+exec /usr/sbin/waagent -daemon
+
+respawn
diff --git a/init/ubuntu/walinuxagent.service b/init/ubuntu/walinuxagent.service
new file mode 100755
index 0000000..1a67835
--- /dev/null
+++ b/init/ubuntu/walinuxagent.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Azure Linux Agent
+After=network.target
+After=sshd.service
+ConditionFileIsExecutable=/usr/sbin/waagent
+ConditionPathExists=/etc/waagent.conf
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/python3 /usr/sbin/waagent -daemon
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/init/waagent b/init/waagent
new file mode 100755
index 0000000..fe30d4d
--- /dev/null
+++ b/init/waagent
@@ -0,0 +1,57 @@
+#!/bin/bash
+#
+# Init file for AzureLinuxAgent.
+#
+# chkconfig: 2345 60 80
+# description: AzureLinuxAgent
+#
+
+# source function library
+. /etc/rc.d/init.d/functions
+
+RETVAL=0
+FriendlyName="AzureLinuxAgent"
+WAZD_BIN=/usr/sbin/waagent
+
+start()
+{
+ echo -n $"Starting $FriendlyName: "
+ $WAZD_BIN -start
+ RETVAL=$?
+ echo
+ return $RETVAL
+}
+
+stop()
+{
+ echo -n $"Stopping $FriendlyName: "
+ killproc -p /var/run/waagent.pid $WAZD_BIN
+ RETVAL=$?
+ echo
+ return $RETVAL
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ reload)
+ ;;
+ report)
+ ;;
+ status)
+ status $WAZD_BIN
+ RETVAL=$?
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|status}"
+ RETVAL=1
+esac
+exit $RETVAL
diff --git a/init/waagent.service b/init/waagent.service
new file mode 100755
index 0000000..f465f79
--- /dev/null
+++ b/init/waagent.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Azure Linux Agent
+After=network.target
+After=sshd.service
+ConditionFileIsExecutable=/usr/sbin/waagent
+ConditionPathExists=/etc/waagent.conf
+
+[Service]
+Type=simple
+ExecStart=/usr/sbin/waagent -daemon
+Restart=always
+
+[Install]
+WantedBy=multi-user.target