diff --git a/debian/changelog b/debian/changelog index cab8551a0..854c01938 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +walinuxagent (2.0.2-0wheezy1) UNRELEASED; urgency=low + + * new upstream verion + * Non-maintainer upload. + + -- g-k-r Sat, 09 Nov 2013 20:38:55 +0100 + walinuxagent (1.3-0ubuntu1) raring; urgency=low * New upstream version (LP: #1101371) diff --git a/debian/control b/debian/control index a49d3d031..4c7f7d201 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: python Priority: extra Maintainer: Ben Howard XSBC-Original-Maintainer: Microsoft Corporation -Build-Depends: debhelper (>= 8), python-all +Build-Depends: debhelper (>= 8), python-all, python-setuptools Standards-Version: 3.9.3 XS-Python-Version: all Homepage: http://go.microsoft.com/fwlink/?LinkId=250998 @@ -16,7 +16,7 @@ Depends: python (>= 2.4), openssh-server (>=1:5.9p1), passwd (>=4.1.4.2), util-linux (>=2.0), - linux-image-extra-virtual, + linux-image (>=3.2), ${misc:Depends}, ${python:Depends} Conflicts: network-manager diff --git a/debian/install b/debian/install index 0c4c49287..d613de346 100644 --- a/debian/install +++ b/debian/install @@ -1 +1,4 @@ waagent usr/sbin +etc/logrotate.d/waagent +etc/init.d/waagent +etc/waagent.conf diff --git a/debian/postinst b/debian/postinst index 20aaccddf..c715e32db 100644 --- a/debian/postinst +++ b/debian/postinst @@ -7,13 +7,15 @@ fi case "$1" in configure) - waagent --setup --force + # no configuration needed all files part of debian package + # unclear: NUMA config + # waagent --setup --force ;; abort-upgrade|abort-remove|abort-deconfigure) - if [ -f /etc/init.d/waagent ]; then - rm /etc/init.d/waagent - fi + #if [ -f /etc/init.d/waagent ]; then + # rm /etc/init.d/waagent + #fi ;; *) diff --git a/debian/preinst b/debian/preinst index a9573de9a..df1ef132a 100644 --- a/debian/preinst +++ b/debian/preinst @@ -2,15 +2,22 @@ set -e -# If upgrading from package version -# with unmanaged upstart configuration -# and agent stop the agent and remove -# the upstart configuration. -if [ -f /etc/init/waagent.conf ]; then - stop waagent 2>&1 > /dev/null || true - rm -f /etc/init/waagent.conf +#only on install and only if previous main version in < 2. +if [ \( "$1" = "install" -o "$1" = "upgrade" \) -a \( -z "${2%%.*}" -o "0${2%%.*}" -lt 2 \) ]; then + # If upgrading from package version + # with unmanaged upstart configuration + # and agent stop the agent and remove + # the upstart configuration. + if [ -f /etc/init/waagent.conf ]; then + service stop waagent 2>&1 > /dev/null || true + rm -f /etc/init/waagent.conf + fi + # same for systemV init + if [ -f /etc/init.d/waagent ]; then + update-rc.d waagent remove 2>&1 > /dev/null || true + rm -f /etc/init.d/waagent + fi fi - #DEBHELPER# exit 0 diff --git a/distro/debian/waagent.sysV b/distro/debian/waagent.sysV new file mode 100755 index 000000000..0a297709b --- /dev/null +++ b/distro/debian/waagent.sysV @@ -0,0 +1,56 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: WindowsAzureLinuxAgent +# Required-Start: $network $syslog +# Required-Stop: $network $syslog +# Should-Start: $network $syslog +# Should-Stop: $network $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: WindowsAzureLinuxAgent +# Description: WindowsAzureLinuxAgent +### END INIT INFO + +. /lib/lsb/init-functions + +OPTIONS="-daemon" +WAZD_BIN=/usr/sbin/waagent +WAZD_PID=/var/run/waagent.pid + +case "$1" in + start) + log_begin_msg "Starting WindowsAzureLinuxAgent..." + pid=$( pidofproc $WAZD_BIN ) + if [ -n "$pid" ] ; then + log_begin_msg "Already running." + log_end_msg 0 + exit 0 + fi + start-stop-daemon --start --quiet --oknodo --background --exec $WAZD_BIN -- $OPTIONS + log_end_msg $? + ;; + + stop) + log_begin_msg "Stopping WindowsAzureLinuxAgent..." + start-stop-daemon --stop --quiet --oknodo --pidfile $WAZD_PID + ret=$? + rm -f $WAZD_PID + log_end_msg $ret + ;; + force-reload) + $0 restart + ;; + restart) + $0 stop + $0 start + ;; + status) + status_of_proc $WAZD_BIN && exit 0 || exit $? + ;; + *) + log_success_msg "Usage: /etc/init.d/waagent {start|stop|force-reload|restart|status}" + exit 1 + ;; +esac + +exit 0 diff --git a/setup.py b/setup.py index 846d8e703..d8b602c25 100755 --- a/setup.py +++ b/setup.py @@ -66,6 +66,7 @@ def finalize_options(self): if not os.path.exists('distro/%s' %self.lnx_distro): msg = 'Unknown distribution "%s"' %self.lnx_distro msg += ', no entry in distro directory' + print msg; sys.exit(1) def run(self): @@ -104,6 +105,7 @@ def run(self): for f in initScripts: newName = f.split('/')[-1].split('.')[0] self.copy_file(f, tgtDir + initdir + '/' + newName) + os.chmod(tgtDir + initdir + '/' + newName,0755) except: print 'Could not install systemV init script', sys.exit(1) @@ -183,7 +185,7 @@ def readme(): return f.read() setuptools.setup(name = 'waagent', - version = '1.4.0', + version = '2.0.2', description = 'Windows Azure Linux Agent', long_description = readme(), author = 'Stephen Zarkos, Eric Gable',