summaryrefslogtreecommitdiff
path: root/debian/patches/000_use_packaged_upstart
diff options
context:
space:
mode:
authorBen Howard <ben.howard@ubuntu.com>2013-03-21 12:57:08 -0600
committerusd-importer <ubuntu-server@lists.ubuntu.com>2013-03-26 22:33:20 +0000
commit571bdcfe4b3d37c0fc94689d511712c2a0a13b69 (patch)
tree3c8b1b9ef1a85c122f210c91e7e2527533a56386 /debian/patches/000_use_packaged_upstart
parent608a9999c43d3500a13f03621c3982db505ec781 (diff)
downloadvyos-walinuxagent-571bdcfe4b3d37c0fc94689d511712c2a0a13b69.tar.gz
vyos-walinuxagent-571bdcfe4b3d37c0fc94689d511712c2a0a13b69.zip
Import patches-unapplied version 1.3.2-0ubuntu1 to ubuntu/raring-proposed
Imported using git-ubuntu import. Changelog parent: 608a9999c43d3500a13f03621c3982db505ec781 New changelog entries: * Updated to 1.3.2 as part of Windows Azure requirement (LP: #1158465). * Upstream now supports packaging; incorporated upstream packaging into Ubuntu Packaging.
Diffstat (limited to 'debian/patches/000_use_packaged_upstart')
-rw-r--r--debian/patches/000_use_packaged_upstart118
1 files changed, 0 insertions, 118 deletions
diff --git a/debian/patches/000_use_packaged_upstart b/debian/patches/000_use_packaged_upstart
deleted file mode 100644
index 463ae57..0000000
--- a/debian/patches/000_use_packaged_upstart
+++ /dev/null
@@ -1,118 +0,0 @@
---- a/waagent
-+++ b/waagent
-@@ -52,6 +52,7 @@ ProtocolVersion = "2011-12-31"
-
- Config = None
- LinuxDistro = "UNKNOWN"
-+PackagedForDistro = "UNKNOWN"
- Verbose = False
- WaAgent = None
- DiskActivated = False
-@@ -79,11 +80,23 @@ def IsLinux():
-
- def DetectLinuxDistro():
- global LinuxDistro
-+ global PackagedForDistro
- if os.path.isfile("/etc/redhat-release"):
- LinuxDistro = "RedHat"
- return True
- if os.path.isfile("/etc/lsb-release") and "Ubuntu" in GetFileContents("/etc/lsb-release"):
- LinuxDistro = "Ubuntu"
-+
-+ # Should this run as if it is packaged Ubuntu?
-+ try:
-+ cmd="dpkg -S %s" % os.path.basename(__file__)
-+ retcode, krn = RunSafe(cmd)
-+ if not retcode:
-+ PackagedForDistro = "Ubuntu"
-+
-+ except IOError as e:
-+ pass
-+
- return True
- if os.path.isfile("/etc/debian_version"):
- LinuxDistro = "Debian"
-@@ -99,12 +112,21 @@ def IsRedHat():
- def IsUbuntu():
- return "Ubuntu" in LinuxDistro
-
-+def IsPackagedUbuntu():
-+ return "Ubuntu" in PackagedForDistro
-+
- def IsDebian():
- return IsUbuntu() or "Debian" in LinuxDistro
-
- def IsSuse():
- return "Suse" in LinuxDistro
-
-+def IsPackaged():
-+ if PackagedForDistro == "UNKNOWN":
-+ return False
-+
-+ return True
-+
- def UsesRpm():
- return IsRedHat() or IsSuse()
-
-@@ -2252,14 +2274,14 @@ def Install():
- shutil.move(a, ".")
- Warn("Moved " + a + " -> " + LibDir + "/" + GetLastPathElement(a) )
-
-- if IsUbuntu():
-+ if IsUbuntu() and not IsPackagedUbuntu():
- # Support for Ubuntu's upstart configuration
- filename="waagent.conf"
- filepath = "/etc/init/" + filename
- SetFileContents(filepath, Init_Ubuntu)
- os.chmod(filepath, 0644)
-
-- else:
-+ elif not IsPackagedUbuntu():
- # Regular init.d configurations
- filename = "waagent"
- filepath = "/etc/init.d/" + filename
-@@ -2273,6 +2295,7 @@ def Install():
- SetFileContents(filepath, init[0])
- os.chmod(filepath, 0755)
- Run(init[1])
-+
- if os.path.isfile("/etc/waagent.conf"):
- try:
- os.remove("/etc/waagent.conf.old")
-@@ -2310,12 +2333,30 @@ def Uninstall():
- if a == 0:
- Error("Unable to detect Linux Distribution.")
- return 1
-- Run("service " + filename + " stop")
-- cmd = ["chkconfig --del " + filename,
-- "update-rc.d -f " + filename + " remove",
-- "insserv -r " + filename][a - 1]
-- Run(cmd)
-- for f in os.listdir(LibDir) + ["/etc/init/waagent.conf","/etc/init.d/" + filename, "/etc/waagent.conf", "/etc/logrotate.d/waagent", "/etc/sudoers.d/waagent"]:
-+
-+ # Managed by dpkg for Packaged Ubuntu
-+ if not IsPackaged():
-+ Run("service " + filename + " stop")
-+ cmd = ["chkconfig --del " + filename,
-+ "update-rc.d -f " + filename + " remove",
-+ "insserv -r " + filename][a - 1]
-+ Run(cmd)
-+
-+ remove_f = [
-+ "/etc/waagent.conf",
-+ "/etc/logrotate.d/waagent",
-+ "/etc/sudoers.d/waagent",
-+ ]
-+
-+ # For packaged Ubuntu, the script should let the packaging
-+ # manage the removal of these files
-+ if not IsPackagedUbuntu():
-+ remove_f.append([
-+ "/etc/init/waagent.conf",
-+ "/etc/init.d/" + filename,
-+ ])
-+
-+ for f in os.listdir(LibDir) + remove_f:
- try:
- os.remove(f)
- except: