summaryrefslogtreecommitdiff
path: root/debian/patches/001-strip-init-d.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/001-strip-init-d.patch')
-rw-r--r--debian/patches/001-strip-init-d.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/debian/patches/001-strip-init-d.patch b/debian/patches/001-strip-init-d.patch
new file mode 100644
index 0000000..0d88fe4
--- /dev/null
+++ b/debian/patches/001-strip-init-d.patch
@@ -0,0 +1,36 @@
+--- a/waagent
++++ b/waagent
+@@ -2141,18 +2141,21 @@ def Install():
+ os.remove(GetLastPathElement(a))
+ shutil.move(a, ".")
+ Warn("Moved " + a + " -> " + LibDir + "/" + GetLastPathElement(a) )
+- filename = "waagent"
+- filepath = "/etc/init.d/" + filename
+- distro = IsRedHat() + IsDebian() * 2 + IsSuse() * 3
+- if distro == 0:
+- Error("Unable to detect Linux Distribution.")
+- return 1
+- init = [[Init_RedHat, "chkconfig --add " + filename],
+- [Init_Debian, "update-rc.d " + filename + " defaults"],
+- [Init_Suse, "insserv " + filename]][distro - 1]
+- SetFileContents(filepath, init[0])
+- os.chmod(filepath, 0755)
+- Run(init[1])
++
++ if not IsUbuntu():
++ filename = "waagent"
++ filepath = "/etc/init.d/" + filename
++ distro = IsRedHat() + IsDebian() * 2 + IsSuse() * 3
++ if distro == 0:
++ Error("Unable to detect Linux Distribution.")
++ return 1
++ init = [[Init_RedHat, "chkconfig --add " + filename],
++ [Init_Debian, "update-rc.d " + filename + " defaults"],
++ [Init_Suse, "insserv " + filename]][distro - 1]
++ 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")