diff options
Diffstat (limited to 'waagent')
-rw-r--r-- | waagent | 27 |
1 files changed, 15 insertions, 12 deletions
@@ -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") |