diff options
author | Ben Howard <ben.howard@ubuntu.com> | 2015-12-07 16:48:51 -0700 |
---|---|---|
committer | usd-importer <ubuntu-server@lists.ubuntu.com> | 2015-12-08 16:10:11 +0000 |
commit | 83432149e212155469b1e9f06eb0095121377356 (patch) | |
tree | 9029a2e7836dce3025d5c5a6527d74bbf8d799e5 /init | |
parent | 04946cba49f19c0b6b876bccdbb36d47334af002 (diff) | |
download | vyos-walinuxagent-83432149e212155469b1e9f06eb0095121377356.tar.gz vyos-walinuxagent-83432149e212155469b1e9f06eb0095121377356.zip |
Import patches-unapplied version 2.1.2-0ubuntu1 to ubuntu/xenial-proposed
Imported using git-ubuntu import.
Changelog parent: 04946cba49f19c0b6b876bccdbb36d47334af002
New changelog entries:
* New upstream release (LP: #1523715):
- Bug fixes for Ubuntu 15.10 on Azure
- Enablement for Azure Stack
- Dropped patch for systemd job as upstream now includes it.
Diffstat (limited to 'init')
-rwxr-xr-x | init/suse/waagent | 112 | ||||
-rw-r--r-- | init/ubuntu/walinuxagent | 2 | ||||
-rw-r--r-- | init/ubuntu/walinuxagent.conf | 2 | ||||
-rwxr-xr-x | init/ubuntu/walinuxagent.service | 6 |
4 files changed, 118 insertions, 4 deletions
diff --git a/init/suse/waagent b/init/suse/waagent new file mode 100755 index 0000000..b77b0fa --- /dev/null +++ b/init/suse/waagent @@ -0,0 +1,112 @@ +#! /bin/sh +# +# Microsoft Azure Linux Agent sysV init script +# +# Copyright 2013 Microsoft Corporation +# Copyright SUSE LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# /etc/init.d/waagent +# +# and symbolic link +# +# /usr/sbin/rcwaagent +# +# System startup script for the waagent +# +### BEGIN INIT INFO +# Provides: MicrosoftAzureLinuxAgent +# Required-Start: $network sshd +# Required-Stop: $network sshd +# Default-Start: 3 5 +# Default-Stop: 0 1 2 6 +# Description: Start the MicrosoftAzureLinuxAgent +### END INIT INFO + +PYTHON=/usr/bin/python +WAZD_BIN=/usr/sbin/waagent +WAZD_CONF=/etc/waagent.conf +WAZD_PIDFILE=/var/run/waagent.pid + +test -x "$WAZD_BIN" || { echo "$WAZD_BIN not installed"; exit 5; } +test -e "$WAZD_CONF" || { echo "$WAZD_CONF not found"; exit 6; } + +. /etc/rc.status + +# First reset status of this service +rc_reset + +# Return values acc. to LSB for all commands but status: +# 0 - success +# 1 - misc error +# 2 - invalid or excess args +# 3 - unimplemented feature (e.g. reload) +# 4 - insufficient privilege +# 5 - program not installed +# 6 - program not configured +# +# Note that starting an already running service, stopping +# or restarting a not-running service as well as the restart +# with force-reload (in case signalling is not supported) are +# considered a success. + + +case "$1" in + start) + echo -n "Starting MicrosoftAzureLinuxAgent" + ## Start daemon with startproc(8). If this fails + ## the echo return value is set appropriate. + startproc -f ${PYTHON} ${WAZD_BIN} -start + rc_status -v + ;; + stop) + echo -n "Shutting down MicrosoftAzureLinuxAgent" + ## Stop daemon with killproc(8) and if this fails + ## set echo the echo return value. + killproc -p ${WAZD_PIDFILE} ${PYTHON} ${WAZD_BIN} + rc_status -v + ;; + try-restart) + ## Stop the service and if this succeeds (i.e. the + ## service was running before), start it again. + $0 status >/dev/null && $0 restart + rc_status + ;; + restart) + ## Stop the service and regardless of whether it was + ## running or not, start it again. + $0 stop + sleep 1 + $0 start + rc_status + ;; + force-reload|reload) + rc_status + ;; + status) + echo -n "Checking for service MicrosoftAzureLinuxAgent " + ## Check status with checkproc(8), if process is running + ## checkproc will return with exit status 0. + + checkproc -p ${WAZD_PIDFILE} ${PYTHON} ${WAZD_BIN} + rc_status -v + ;; + probe) + ;; + *) + echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}" + exit 1 + ;; +esac +rc_exit diff --git a/init/ubuntu/walinuxagent b/init/ubuntu/walinuxagent index a17174c..0253202 100644 --- a/init/ubuntu/walinuxagent +++ b/init/ubuntu/walinuxagent @@ -1,2 +1,2 @@ -# To disable the Windows Azure Agent, set WALINUXAGENT_ENABLED=0 +# To disable the Microsoft Azure Agent, set WALINUXAGENT_ENABLED=0 WALINUXAGENT_ENABLED=1 diff --git a/init/ubuntu/walinuxagent.conf b/init/ubuntu/walinuxagent.conf index 2ce6608..331125f 100644 --- a/init/ubuntu/walinuxagent.conf +++ b/init/ubuntu/walinuxagent.conf @@ -1,4 +1,4 @@ -description "Windows Azure Linux agent" +description "Microsoft Azure Linux agent" author "Ben Howard <ben.howard@canonical.com>" start on runlevel [2345] diff --git a/init/ubuntu/walinuxagent.service b/init/ubuntu/walinuxagent.service index 1a67835..681435e 100755 --- a/init/ubuntu/walinuxagent.service +++ b/init/ubuntu/walinuxagent.service @@ -1,7 +1,9 @@ [Unit] Description=Azure Linux Agent -After=network.target -After=sshd.service + +After=network-online.target cloud-final.service +Wants=network-online.target sshd.service sshd-keygen.service cloud-final.service + ConditionFileIsExecutable=/usr/sbin/waagent ConditionPathExists=/etc/waagent.conf |