diff --git a/azurelinuxagent/agent.py b/azurelinuxagent/agent.py
index 8c303482e85a6e057d250952c67b9faecb3e00b3..ba36e6362e6529291cb432f0de8cf2d4e21f12dc 100644
--- a/azurelinuxagent/agent.py
+++ b/azurelinuxagent/agent.py
@@ -65,6 +65,7 @@ class AgentCommands(object):
     CollectLogs = "collect-logs"
     SetupFirewall = "setup-firewall"
     Provision = "provision"
+    Resourcedisk = "resourcedisk"
 
 
 class Agent(object):
@@ -190,6 +191,11 @@ class Agent(object):
         update_handler = get_update_handler()
         update_handler.run(debug)
 
+    def resourcedisk(self):
+        from azurelinuxagent.daemon.resourcedisk import get_resourcedisk_handler
+        resourcedisk_handler = get_resourcedisk_handler()
+        resourcedisk_handler.run()
+
     def show_configuration(self):
         configuration = conf.get_configuration()
         for k in sorted(configuration.keys()):
@@ -280,6 +286,8 @@ def main(args=None):
                 agent.daemon()
             elif command == AgentCommands.RunExthandlers:
                 agent.run_exthandlers(debug)
+            elif command == AgentCommands.Resourcedisk:
+                agent.resourcedisk()
             elif command == AgentCommands.ShowConfig:
                 agent.show_configuration()
             elif command == AgentCommands.CollectLogs:
@@ -334,6 +342,8 @@ def parse_args(sys_args):
             cmd = AgentCommands.RegisterService
         elif re.match(regex_cmd_format.format(AgentCommands.RunExthandlers), arg):
             cmd = AgentCommands.RunExthandlers
+        elif re.match(regex_cmd_format.format(AgentCommands.Resourcedisk), arg):
+            cmd = AgentCommands.Resourcedisk
         elif re.match(regex_cmd_format.format(AgentCommands.Version), arg):
             cmd = AgentCommands.Version
         elif re.match(regex_cmd_format.format("verbose"), arg):
diff --git a/azurelinuxagent/common/osutil/debian.py b/azurelinuxagent/common/osutil/debian.py
index 5302b059f1ccd5b1923ba238030bf00fd0bff3bf..c0041a98d5559e12233fe4a4f08b85d9bd530338 100644
--- a/azurelinuxagent/common/osutil/debian.py
+++ b/azurelinuxagent/common/osutil/debian.py
@@ -33,20 +33,25 @@ import azurelinuxagent.common.utils.textutil as textutil  # pylint: disable=W061
 from azurelinuxagent.common.osutil.default import DefaultOSUtil
 
 
-class DebianOSBaseUtil(DefaultOSUtil):
+class DebianOSUtil(DefaultOSUtil):
 
     def __init__(self):
-        super(DebianOSBaseUtil, self).__init__()
+        super(DebianOSUtil, self).__init__()
         self.jit_enabled = True
+        self.service_name = self.get_service_name()
+
+    @staticmethod
+    def get_service_name():
+        return "walinuxagent"
 
     def restart_ssh_service(self):
         return shellutil.run("systemctl --job-mode=ignore-dependencies try-reload-or-restart ssh", chk_err=False)
 
     def stop_agent_service(self):
-        return shellutil.run("service azurelinuxagent stop", chk_err=False)
+        return shellutil.run("systemctl stop {0}".format(self.service_name), chk_err=False)
 
     def start_agent_service(self):
-        return shellutil.run("service azurelinuxagent start", chk_err=False)
+        return shellutil.run("systemctl start {0}".format(self.service_name), chk_err=False)
 
     def start_network(self):
         pass
@@ -59,21 +64,3 @@ class DebianOSBaseUtil(DefaultOSUtil):
 
     def get_dhcp_lease_endpoint(self):
         return self.get_endpoint_from_leases_path('/var/lib/dhcp/dhclient.*.leases')
-
-
-class DebianOSModernUtil(DebianOSBaseUtil):
-
-    def __init__(self):
-        super(DebianOSModernUtil, self).__init__()
-        self.jit_enabled = True
-        self.service_name = self.get_service_name()
-
-    @staticmethod
-    def get_service_name():
-        return "walinuxagent"
-
-    def stop_agent_service(self):
-        return shellutil.run("systemctl stop {0}".format(self.service_name), chk_err=False)
-
-    def start_agent_service(self):
-        return shellutil.run("systemctl start {0}".format(self.service_name), chk_err=False)
diff --git a/azurelinuxagent/common/osutil/default.py b/azurelinuxagent/common/osutil/default.py
index 9fb97f157f5b23662dbe454d185f66b2e5972994..961604a6e367c5aa44aad27ea849772e68c7db4f 100644
--- a/azurelinuxagent/common/osutil/default.py
+++ b/azurelinuxagent/common/osutil/default.py
@@ -409,9 +409,9 @@ class DefaultOSUtil(object):
             return
 
         if expiration is not None:
-            cmd = ["useradd", "-m", username, "-e", expiration]
+            cmd = ["useradd", "-m", username, "-s", "/bin/bash", "-e", expiration]
         else:
-            cmd = ["useradd", "-m", username]
+            cmd = ["useradd", "-m", username, "-s", "/bin/bash"]
 
         if comment is not None:
             cmd.extend(["-c", comment])
diff --git a/azurelinuxagent/common/osutil/factory.py b/azurelinuxagent/common/osutil/factory.py
index 83123e3f53f3cee3f09e803531efb706784a2724..9eb29beea04baa2d96b8ce8fd0d91ea158e88997 100644
--- a/azurelinuxagent/common/osutil/factory.py
+++ b/azurelinuxagent/common/osutil/factory.py
@@ -25,7 +25,7 @@ from .arch import ArchUtil
 from .bigip import BigIpOSUtil
 from .clearlinux import ClearLinuxUtil
 from .coreos import CoreOSUtil
-from .debian import DebianOSBaseUtil, DebianOSModernUtil
+from .debian import DebianOSUtil
 from .default import DefaultOSUtil
 from .devuan import DevuanOSUtil
 from .freebsd import FreeBSDOSUtil
@@ -85,7 +85,7 @@ def _get_osutil(distro_name, distro_code_name, distro_version, distro_full_name)
         return AlpineOSUtil()
 
     if distro_name == "kali":
-        return DebianOSBaseUtil()
+        return DebianOSUtil()
 
     if distro_name in ("flatcar", "coreos") or distro_code_name in ("flatcar", "coreos"):
         return CoreOSUtil()
@@ -99,10 +99,8 @@ def _get_osutil(distro_name, distro_code_name, distro_version, distro_full_name)
         return SUSEOSUtil()
 
     if distro_name == "debian":
-        if "sid" in distro_version or Version(distro_version) > Version("7"):
-            return DebianOSModernUtil()
+        return DebianOSUtil()
 
-        return DebianOSBaseUtil()
 
     # Devuan support only works with v4+ 
     # Reason is that Devuan v4 (Chimaera) uses python v3.9, in which the 
diff --git a/azurelinuxagent/daemon/resourcedisk/default.py b/azurelinuxagent/daemon/resourcedisk/default.py
index df4bb76f8c43e4f1c807e4999d315d46c4b772b0..a6cffb00d09a6906ee39d208fcbf8531f4a3416b 100644
--- a/azurelinuxagent/daemon/resourcedisk/default.py
+++ b/azurelinuxagent/daemon/resourcedisk/default.py
@@ -18,6 +18,7 @@
 import os
 import re
 import stat
+import subprocess
 import sys
 import threading
 from time import sleep
@@ -31,6 +32,7 @@ import azurelinuxagent.common.utils.shellutil as shellutil
 from azurelinuxagent.common.exception import ResourceDiskError
 from azurelinuxagent.common.osutil import get_osutil
 from azurelinuxagent.common.version import AGENT_NAME
+from azurelinuxagent.pa.provision.cloudinit import cloud_init_is_enabled
 
 DATALOSS_WARNING_FILE_NAME = "DATALOSS_WARNING_README.txt"
 DATA_LOSS_WARNING = """\
@@ -55,6 +57,10 @@ class ResourceDiskHandler(object):
         disk_thread.start()
 
     def run(self):
+        if cloud_init_is_enabled():
+            logger.info('Using cloud-init for provisioning')
+            return
+
         mount_point = None
         if conf.get_resourcedisk_format():
             mount_point = self.activate_resource_disk()
@@ -89,9 +95,8 @@ class ResourceDiskHandler(object):
             logger.error("Failed to enable swap {0}", e)
 
     def reread_partition_table(self, device):
-        if shellutil.run("sfdisk -R {0}".format(device), chk_err=False):
-            shellutil.run("blockdev --rereadpt {0}".format(device),
-                          chk_err=False)
+        shellutil.run("blockdev --rereadpt {0}".format(device),
+                      chk_err=False)
 
     def mount_resource_disk(self, mount_point):
         device = self.osutil.device_for_ide_port(1)
@@ -118,7 +123,7 @@ class ResourceDiskHandler(object):
             raise ResourceDiskError(msg=msg, inner=ose)
 
         logger.info("Examining partition table")
-        ret = shellutil.run_get_output("parted {0} print".format(device))
+        ret = shellutil.run_get_output("blkid -o value -s PTTYPE {0}".format(device))
         if ret[0]:
             raise ResourceDiskError("Could not determine partition info for "
                                     "{0}: {1}".format(device, ret[1]))
@@ -129,8 +134,9 @@ class ResourceDiskHandler(object):
         mkfs_string = "mkfs.{0} -{2} {1}".format(
             self.fs, partition, force_option)
 
-        if "gpt" in ret[1]:
+        if ret[1].strip() == "gpt":
             logger.info("GPT detected, finding partitions")
+            ret = shellutil.run_get_output("parted {0} print".format(device))
             parts = [x for x in ret[1].split("\n") if
                      re.match(r"^\s*[0-9]+", x)]
             logger.info("Found {0} GPT partition(s).", len(parts))
@@ -148,21 +154,13 @@ class ResourceDiskHandler(object):
                 shellutil.run(mkfs_string)
         else:
             logger.info("GPT not detected, determining filesystem")
-            ret = self.change_partition_type(
-                suppress_message=True,
-                option_str="{0} 1 -n".format(device))
-            ptype = ret[1].strip()
-            if ptype == "7" and self.fs != "ntfs":
+            ret = shellutil.run_get_output("blkid -o value -s TYPE {0}".format(partition))
+            if ret[1].strip() == 'ntfs' and self.fs != 'ntfs':
                 logger.info("The partition is formatted with ntfs, updating "
                             "partition type to 83")
-                self.change_partition_type(
-                    suppress_message=False,
-                    option_str="{0} 1 83".format(device))
-                self.reread_partition_table(device)
+                subprocess.call(['sfdisk', '-c', '-f', device, '1', '83'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
                 logger.info("Format partition [{0}]", mkfs_string)
                 shellutil.run(mkfs_string)
-            else:
-                logger.info("The partition type is {0}", ptype)
 
         mount_options = conf.get_resourcedisk_mountoptions()
         mount_string = self.get_mount_string(mount_options,
@@ -217,39 +215,6 @@ class ResourceDiskHandler(object):
                     self.fs)
         return mount_point
 
-    def change_partition_type(self, suppress_message, option_str):
-        """
-            use sfdisk to change partition type.
-            First try with --part-type; if fails, fall back to -c
-        """
-
-        option_to_use = '--part-type'
-        command = "sfdisk {0} {1} {2}".format(
-            option_to_use, '-f' if suppress_message else '', option_str)
-        err_code, output = shellutil.run_get_output(
-            command, chk_err=False, log_cmd=True)
-
-        # fall back to -c
-        if err_code != 0:
-            logger.info(
-                "sfdisk with --part-type failed [{0}], retrying with -c",
-                err_code)
-            option_to_use = '-c'
-            command = "sfdisk {0} {1} {2}".format(
-                option_to_use, '-f' if suppress_message else '', option_str)
-            err_code, output = shellutil.run_get_output(command, log_cmd=True)
-
-        if err_code == 0:
-            logger.info('{0} succeeded',
-                        command)
-        else:
-            logger.error('{0} failed [{1}: {2}]',
-                         command,
-                         err_code,
-                         output)
-
-        return err_code, output
-
     def get_mount_string(self, mount_options, partition, mount_point):
         if mount_options is not None:
             return 'mount -t {0} -o {1} {2} {3}'.format(
diff --git a/azurelinuxagent/ga/update.py b/azurelinuxagent/ga/update.py
index 2b0975b05ba6b00648c851f377055ccdc4e3b152..b695ac2674a6e4b60b25f0306ad421f14820f4be 100644
--- a/azurelinuxagent/ga/update.py
+++ b/azurelinuxagent/ga/update.py
@@ -230,6 +230,9 @@ class UpdateHandler(object):
         if child_args is not None:
             agent_cmd = "{0} {1}".format(agent_cmd, child_args)
 
+        env = os.environ.copy()
+        env['PYTHONDONTWRITEBYTECODE'] = '1'
+
         try:
 
             # Launch the correct Python version for python-based agents
@@ -245,7 +248,7 @@ class UpdateHandler(object):
                 cwd=agent_dir,
                 stdout=sys.stdout,
                 stderr=sys.stderr,
-                env=os.environ)
+                env=env)
 
             logger.verbose(u"Agent {0} launched with command '{1}'", agent_name, agent_cmd)
 
diff --git a/config/debian/waagent.conf b/config/debian/waagent.conf
index dfd7afcd6d82d69433f64808a905a153a22d4070..649d9c15d3f008cd9b7f34c75475b451e6535e5a 100644
--- a/config/debian/waagent.conf
+++ b/config/debian/waagent.conf
@@ -8,7 +8,7 @@ Extensions.Enabled=y
 
 # Which provisioning agent to use. Supported values are "auto" (default), "waagent",
 # "cloud-init", or "disabled".
-Provisioning.Agent=auto
+Provisioning.Agent=cloud-init
 
 # Password authentication for root account will be unavailable.
 Provisioning.DeleteRootPassword=y
@@ -110,7 +110,7 @@ OS.SshDir=/etc/ssh
 # OS.EnableRDMA=y
 
 # Enable or disable goal state processing auto-update, default is enabled
-# AutoUpdate.Enabled=y
+AutoUpdate.Enabled=n
 
 # Determine the update family, this should not be changed
 # AutoUpdate.GAFamily=Prod
diff --git a/setup.py b/setup.py
index 8f5d92b42e8b40586c7002c0064a8fda8503b75e..8c11c46f972927a0f43435a97d8aee0ca137077b 100755
--- a/setup.py
+++ b/setup.py
@@ -39,9 +39,8 @@ def set_files(data_files, dest=None, src=None):
 
 
 def set_bin_files(data_files, dest, src=None):
-    if src is None:
-        src = ["bin/waagent", "bin/waagent2.0"]
-    data_files.append((dest, src))
+    pass
+
 
 
 def set_conf_files(data_files, dest="/etc", src=None):
@@ -216,9 +215,7 @@ def get_data_files(name, version, fullname):  # pylint: disable=R0912
                       src=["bin/py3/waagent", "bin/waagent2.0"])
         set_conf_files(data_files, src=["config/debian/waagent.conf"])
         set_logrotate_files(data_files)
-        set_udev_files(data_files, dest="/lib/udev/rules.d")
-        if debian_has_systemd():
-            set_systemd_files(data_files, dest=systemd_dir_path)
+        set_udev_files(data_files, dest="/usr/lib/udev/rules.d")
     elif name == 'devuan':
         set_bin_files(data_files, dest=agent_bin_path,
                       src=["bin/py3/waagent", "bin/waagent2.0"])
@@ -313,14 +310,7 @@ class install(_install):  # pylint: disable=C0103
             osutil.start_agent_service()
 
 
-# Note to packagers and users from source.
-# In version 3.5 of Python distribution information handling in the platform
-# module was deprecated. Depending on the Linux distribution the
-# implementation may be broken prior to Python 3.7 wher the functionality
-# will be removed from Python 3
-requires = []  # pylint: disable=invalid-name
-if float(sys.version[:3]) >= 3.7:
-    requires = ['distro']  # pylint: disable=invalid-name
+requires = ['distro']
 
 modules = []  # pylint: disable=invalid-name
 
@@ -341,6 +331,9 @@ setuptools.setup(
     install_requires=requires,
     cmdclass={
         'install': install
-    }
+    },
+    entry_points = {
+        'console_scripts': ['waagent=azurelinuxagent.agent:main'],
+    },
 )
 
diff --git a/tests/common/osutil/test_factory.py b/tests/common/osutil/test_factory.py
index 7bd729c3b35ffb7f364cadaca921be4723fb3559..0d626b421029dfaad6bb05165f95762b9ea149cf 100644
--- a/tests/common/osutil/test_factory.py
+++ b/tests/common/osutil/test_factory.py
@@ -20,7 +20,7 @@ from azurelinuxagent.common.osutil.arch import ArchUtil
 from azurelinuxagent.common.osutil.bigip import BigIpOSUtil
 from azurelinuxagent.common.osutil.clearlinux import ClearLinuxUtil
 from azurelinuxagent.common.osutil.coreos import CoreOSUtil
-from azurelinuxagent.common.osutil.debian import DebianOSBaseUtil, DebianOSModernUtil
+from azurelinuxagent.common.osutil.debian import DebianOSUtil
 from azurelinuxagent.common.osutil.devuan import DevuanOSUtil
 from azurelinuxagent.common.osutil.default import DefaultOSUtil
 from azurelinuxagent.common.osutil.factory import _get_osutil
@@ -134,8 +134,8 @@ class TestOsUtilFactory(AgentTestCase):
                           distro_code_name="",
                           distro_version="",
                           distro_full_name="")
-        self.assertTrue(isinstance(ret, DebianOSBaseUtil))
-        self.assertEqual(ret.get_service_name(), "waagent")
+        self.assertTrue(isinstance(ret, DebianOSUtil))
+        self.assertEqual(ret.get_service_name(), "walinuxagent")
 
     def test_get_osutil_it_should_return_coreos(self):
         ret = _get_osutil(distro_name="coreos",
@@ -173,19 +173,11 @@ class TestOsUtilFactory(AgentTestCase):
         self.assertTrue(isinstance(ret, SUSE11OSUtil))
         self.assertEqual(ret.get_service_name(), "waagent")
 
-    def test_get_osutil_it_should_return_debian(self):
         ret = _get_osutil(distro_name="debian",
                           distro_code_name="",
                           distro_full_name="",
-                          distro_version="7")
-        self.assertTrue(isinstance(ret, DebianOSBaseUtil))
-        self.assertEqual(ret.get_service_name(), "waagent")
-
-        ret = _get_osutil(distro_name="debian",
-                          distro_code_name="",
-                          distro_full_name="",
-                          distro_version="8")
-        self.assertTrue(isinstance(ret, DebianOSModernUtil))
+                          distro_version="")
+        self.assertTrue(isinstance(ret, DebianOSUtil))
         self.assertEqual(ret.get_service_name(), "walinuxagent")
 
     def test_get_osutil_it_should_return_devuan(self):
diff --git a/tests/ga/test_update.py b/tests/ga/test_update.py
index e5f15fbd07bac1bee546fb5e4c93dff2a0ee4850..a9939f058085ff8900300082583b0324d758b1b3 100644
--- a/tests/ga/test_update.py
+++ b/tests/ga/test_update.py
@@ -1041,6 +1041,7 @@ class TestUpdate(UpdateTestCase):
         self._test_run_latest(mock_time=mock_time)
         self.assertEqual(1, mock_time.sleep_interval)
 
+    @unittest.expectedFailure
     def test_run_latest_defaults_to_current(self):
         self.assertEqual(None, self.update_handler.get_latest_agent_greater_than_daemon())
 
diff --git a/tests/utils/test_rest_util.py b/tests/utils/test_rest_util.py
index a0b00f6cd91fe663d61c9c641af28a4c973817d0..48f215d2bcf8beb6c9dac743d775e62ab7f57ded 100644
--- a/tests/utils/test_rest_util.py
+++ b/tests/utils/test_rest_util.py
@@ -196,6 +196,7 @@ class TestHttpOperations(AgentTestCase):
         for x in urls_tuples:
             self.assertEqual(restutil.redact_sas_tokens_in_urls(x[0]), x[1]) 
 
+    @skip_if_predicate_true(lambda: os.environ.get('https_proxy') is not None, "Skip if proxy is defined")
     @patch('azurelinuxagent.common.conf.get_httpproxy_port')
     @patch('azurelinuxagent.common.conf.get_httpproxy_host')
     def test_get_http_proxy_none_is_default(self, mock_host, mock_port):
@@ -216,6 +217,7 @@ class TestHttpOperations(AgentTestCase):
         self.assertEqual(1, mock_host.call_count)
         self.assertEqual(1, mock_port.call_count)
 
+    @skip_if_predicate_true(lambda: os.environ.get('https_proxy') is not None, "Skip if proxy is defined")
     @patch('azurelinuxagent.common.conf.get_httpproxy_port')
     @patch('azurelinuxagent.common.conf.get_httpproxy_host')
     def test_get_http_proxy_configuration_requires_host(self, mock_host, mock_port):
