Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix install for debian wheezy #19

Closed
wants to merge 13 commits into from
7 changes: 7 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
walinuxagent (2.0.2-0wheezy1) UNRELEASED; urgency=low

* new upstream verion
* Non-maintainer upload.

-- g-k-r <[email protected]> Sat, 09 Nov 2013 20:38:55 +0100

walinuxagent (1.3-0ubuntu1) raring; urgency=low

* New upstream version (LP: #1101371)
Expand Down
4 changes: 2 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Section: python
Priority: extra
Maintainer: Ben Howard <[email protected]>
XSBC-Original-Maintainer: Microsoft Corporation <[email protected]>
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
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions debian/install
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
waagent usr/sbin
etc/logrotate.d/waagent
etc/init.d/waagent
etc/waagent.conf
10 changes: 6 additions & 4 deletions debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -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
;;

*)
Expand Down
23 changes: 15 additions & 8 deletions debian/preinst
Original file line number Diff line number Diff line change
Expand Up @@ -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
56 changes: 56 additions & 0 deletions distro/debian/waagent.sysV
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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',
Expand Down