diff --git a/azurelinuxagent/agent.py b/azurelinuxagent/agent.py
index 2e3b26c..8590473 100644
--- a/azurelinuxagent/agent.py
+++ b/azurelinuxagent/agent.py
@@ -49,10 +49,6 @@ class Agent(object):
         self.conf_file_path = conf_file_path
         self.osutil = get_osutil()
 
-        #Init stdout log
-        level = logger.LogLevel.VERBOSE if verbose else logger.LogLevel.INFO
-        logger.add_logger_appender(logger.AppenderType.STDOUT, level)
-
         #Init config
         conf_file_path = self.conf_file_path \
                 if self.conf_file_path is not None \
@@ -140,6 +136,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()):
@@ -154,6 +155,11 @@ def main(args=[]):
     if len(args) <= 0:
         args = sys.argv[1:]
     command, force, verbose, debug, conf_file_path = parse_args(args)
+
+    #Init stdout log
+    level = logger.LogLevel.VERBOSE if verbose else logger.LogLevel.INFO
+    logger.add_logger_appender(logger.AppenderType.STDOUT, level)
+
     if command == "version":
         version()
     elif command == "help":
@@ -175,6 +181,8 @@ def main(args=[]):
                 agent.daemon()
             elif command == "run-exthandlers":
                 agent.run_exthandlers(debug)
+            elif command == "resourcedisk":
+                agent.resourcedisk()
             elif command == "show-configuration":
                 agent.show_configuration()
         except Exception:
@@ -205,6 +213,8 @@ def parse_args(sys_args):
             cmd = "deprovision+user"
         elif re.match("^([-/]*)deprovision", a):
             cmd = "deprovision"
+        elif re.match("^([-/]*)provision", a):
+            cmd = "provision"
         elif re.match("^([-/]*)daemon", a):
             cmd = "daemon"
         elif re.match("^([-/]*)start", a):
@@ -213,6 +223,8 @@ def parse_args(sys_args):
             cmd = "register-service"
         elif re.match("^([-/]*)run-exthandlers", a):
             cmd = "run-exthandlers"
+        elif re.match("^([-/]*)resourcedisk", a):
+            cmd = "resourcedisk"
         elif re.match("^([-/]*)version", a):
             cmd = "version"
         elif re.match("^([-/]*)verbose", a):
@@ -251,8 +263,8 @@ def usage():
     s  = "\n"
     s += ("usage: {0} [-verbose] [-force] [-help] "
            "-configuration-path:<path to configuration file>"
-           "-deprovision[+user]|-register-service|-version|-daemon|-start|"
-           "-run-exthandlers|-show-configuration]"
+           "-provision|-deprovision[+user]|-register-service|-version|-daemon|-start|"
+           "-run-exthandlers||-resourcedisk-show-configuration]"
            "").format(sys.argv[0])
     s += "\n"
     return s
diff --git a/azurelinuxagent/common/osutil/debian.py b/azurelinuxagent/common/osutil/debian.py
index 6e573ef..382a775 100644
--- a/azurelinuxagent/common/osutil/debian.py
+++ b/azurelinuxagent/common/osutil/debian.py
@@ -43,10 +43,10 @@ class DebianOSBaseUtil(DefaultOSUtil):
         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 --job-mode=ignore-dependencies stop walinuxagent", chk_err=False)
 
     def start_agent_service(self):
-        return shellutil.run("service azurelinuxagent start", chk_err=False)
+        return shellutil.run("systemctl --job-mode=ignore-dependencies start walinuxagent", chk_err=False)
 
     def start_network(self):
         pass
diff --git a/azurelinuxagent/common/osutil/default.py b/azurelinuxagent/common/osutil/default.py
index 7ccc534..27a9f8b 100644
--- a/azurelinuxagent/common/osutil/default.py
+++ b/azurelinuxagent/common/osutil/default.py
@@ -423,9 +423,9 @@ class DefaultOSUtil(object):
             return
 
         if expiration is not None:
-            cmd = "useradd -m {0} -e {1}".format(username, expiration)
+            cmd = "useradd -m {0} -s /bin/bash -e {1}".format(username, expiration)
         else:
-            cmd = "useradd -m {0}".format(username)
+            cmd = "useradd -m {0} -s /bin/bash".format(username)
         
         if comment is not None:
             cmd += " -c {0}".format(comment)
diff --git a/azurelinuxagent/common/osutil/factory.py b/azurelinuxagent/common/osutil/factory.py
index 56515ed..90cf495 100644
--- a/azurelinuxagent/common/osutil/factory.py
+++ b/azurelinuxagent/common/osutil/factory.py
@@ -22,7 +22,7 @@ from .default import DefaultOSUtil
 from .arch import ArchUtil
 from .clearlinux import ClearLinuxUtil
 from .coreos import CoreOSUtil
-from .debian import DebianOSBaseUtil, DebianOSModernUtil
+from .debian import DebianOSModernUtil
 from .freebsd import FreeBSDOSUtil
 from .openbsd import OpenBSDOSUtil
 from .redhat import RedhatOSUtil, Redhat6xOSUtil
@@ -90,10 +90,7 @@ 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()
-        else:
-            return DebianOSBaseUtil()
+        return DebianOSModernUtil()
 
     if distro_name == "redhat" \
             or distro_name == "centos" \
diff --git a/azurelinuxagent/common/utils/shellutil.py b/azurelinuxagent/common/utils/shellutil.py
index 1260f9d..2ecf76f 100644
--- a/azurelinuxagent/common/utils/shellutil.py
+++ b/azurelinuxagent/common/utils/shellutil.py
@@ -87,7 +87,6 @@ def run_get_output(cmd, chk_err=True, log_cmd=True, expected_errors=[]):
         logger.verbose(u"Command: [{0}]", cmd)
     try:
         output = subprocess.check_output(cmd,
-                                         stderr=subprocess.STDOUT,
                                          shell=True)
         output = _encode_command_output(output)
     except subprocess.CalledProcessError as e:
diff --git a/azurelinuxagent/daemon/resourcedisk/default.py b/azurelinuxagent/daemon/resourcedisk/default.py
index 5ed14b0..73c764f 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()
@@ -88,9 +94,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)
@@ -117,7 +122,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]))
@@ -128,8 +133,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))
@@ -147,21 +153,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,
@@ -216,39 +214,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
-        """
-
-        command_to_use = '--part-type'
-        input = "sfdisk {0} {1} {2}".format(
-            command_to_use, '-f' if suppress_message else '', option_str)
-        err_code, output = shellutil.run_get_output(
-            input, 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)
-            command_to_use = '-c'
-            input = "sfdisk {0} {1} {2}".format(
-                command_to_use, '-f' if suppress_message else '', option_str)
-            err_code, output = shellutil.run_get_output(input, log_cmd=True)
-
-        if err_code == 0:
-            logger.info('{0} succeeded',
-                        input)
-        else:
-            logger.error('{0} failed [{1}: {2}]',
-                         input,
-                         err_code,
-                         output)
-
-        return err_code, output
-
     @staticmethod
     def get_mount_string(mount_options, partition, mount_point):
         if mount_options is not None:
diff --git a/azurelinuxagent/ga/update.py b/azurelinuxagent/ga/update.py
index c882bc1..073587b 100644
--- a/azurelinuxagent/ga/update.py
+++ b/azurelinuxagent/ga/update.py
@@ -147,6 +147,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
@@ -162,7 +165,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 28e496e..e605009 100644
--- a/config/debian/waagent.conf
+++ b/config/debian/waagent.conf
@@ -106,7 +106,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 ee0d839..889a494 100755
--- a/setup.py
+++ b/setup.py
@@ -37,11 +37,6 @@ def set_files(data_files, dest=None, src=None):
     data_files.append((dest, src))
 
 
-def set_bin_files(data_files, dest="/usr/sbin",
-                  src=["bin/waagent", "bin/waagent2.0"]):
-    data_files.append((dest, src))
-
-
 def set_conf_files(data_files, dest="/etc", src=["config/waagent.conf"]):
     data_files.append((dest, src))
 
@@ -83,7 +78,6 @@ def get_data_files(name, version, fullname):
     data_files = []
 
     if name == 'redhat' or name == 'centos':
-        set_bin_files(data_files)
         set_conf_files(data_files)
         set_logrotate_files(data_files)
         set_udev_files(data_files)
@@ -96,13 +90,11 @@ def get_data_files(name, version, fullname):
                 # TODO this is a mitigation to systemctl bug on 7.1
                 set_sysv_files(data_files)
     elif name == 'arch':
-        set_bin_files(data_files, dest="/usr/bin")
         set_conf_files(data_files, src=["config/arch/waagent.conf"])
         set_udev_files(data_files)
         set_systemd_files(data_files, dest='/usr/lib/systemd/system',
                           src=["init/arch/waagent.service"])
     elif name == 'coreos':
-        set_bin_files(data_files, dest="/usr/share/oem/bin")
         set_conf_files(data_files, dest="/usr/share/oem",
                        src=["config/coreos/waagent.conf"])
         set_logrotate_files(data_files)
@@ -110,13 +102,11 @@ def get_data_files(name, version, fullname):
         set_files(data_files, dest="/usr/share/oem",
                   src=["init/coreos/cloud-config.yml"])
     elif "Clear Linux" in fullname:
-        set_bin_files(data_files, dest="/usr/bin")
         set_conf_files(data_files, dest="/usr/share/defaults/waagent",
                        src=["config/clearlinux/waagent.conf"])
         set_systemd_files(data_files, dest='/usr/lib/systemd/system',
                           src=["init/clearlinux/waagent.service"])
     elif name == 'ubuntu':
-        set_bin_files(data_files)
         set_conf_files(data_files, src=["config/ubuntu/waagent.conf"])
         set_logrotate_files(data_files)
         set_udev_files(data_files)
@@ -134,7 +124,6 @@ def get_data_files(name, version, fullname):
             set_systemd_files(data_files,
                               src=["init/ubuntu/walinuxagent.service"])
     elif name == 'suse' or name == 'opensuse':
-        set_bin_files(data_files)
         set_conf_files(data_files, src=["config/suse/waagent.conf"])
         set_logrotate_files(data_files)
         set_udev_files(data_files)
@@ -148,15 +137,12 @@ def get_data_files(name, version, fullname):
             # sles 12+ and openSUSE 13.2+ use systemd
             set_systemd_files(data_files, dest='/usr/lib/systemd/system')
     elif name == 'freebsd':
-        set_bin_files(data_files, dest="/usr/local/sbin")
         set_conf_files(data_files, src=["config/freebsd/waagent.conf"])
         set_freebsd_rc_files(data_files)
     elif name == 'openbsd':
-        set_bin_files(data_files, dest="/usr/local/sbin")
         set_conf_files(data_files, src=["config/openbsd/waagent.conf"])
         set_openbsd_rc_files(data_files)
     elif name == 'debian':
-        set_bin_files(data_files)
         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")
@@ -178,7 +164,6 @@ def get_data_files(name, version, fullname):
         set_sysv_files(data_files, dest='/etc/init.d', src=["init/openwrt/waagent"])  
     else:
         # Use default setting
-        set_bin_files(data_files)
         set_conf_files(data_files)
         set_logrotate_files(data_files)
         set_udev_files(data_files)
@@ -258,5 +243,8 @@ setuptools.setup(
     install_requires=requires,
     cmdclass={
         'install': install
-    }
+    },
+    entry_points = {
+        'console_scripts': ['waagent=azurelinuxagent.agent:main'],
+    },
 )
diff --git a/tests/ga/test_update.py b/tests/ga/test_update.py
index c435dcc..552de30 100644
--- a/tests/ga/test_update.py
+++ b/tests/ga/test_update.py
@@ -3,6 +3,8 @@
 
 from __future__ import print_function
 
+import unittest
+
 from azurelinuxagent.common.event import *
 from azurelinuxagent.common.protocol.hostplugin import *
 from azurelinuxagent.common.protocol.metadata import *
@@ -1111,6 +1113,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())
 
diff --git a/tests/protocol/test_wire.py b/tests/protocol/test_wire.py
index b7a324a..a0fa32f 100644
--- a/tests/protocol/test_wire.py
+++ b/tests/protocol/test_wire.py
@@ -205,6 +205,7 @@ class TestWireProtocol(AgentTestCase):
         self.assertEqual(patch_http.call_args_list[1][0][1], host_uri)
 
     @skip_if_predicate_true(running_under_travis, "Travis unit tests should not have external dependencies")
+    @skip_if_predicate_true(lambda: os.environ.get('https_proxy') is not None, "Skip if proxy is defined")
     def test_download_ext_handler_pkg_stream(self, *args):
         ext_uri = 'https://dcrdata.blob.core.windows.net/files/packer.zip'
         tmp = tempfile.mkdtemp()
diff --git a/tests/utils/test_rest_util.py b/tests/utils/test_rest_util.py
index f097f10..49307c8 100644
--- a/tests/utils/test_rest_util.py
+++ b/tests/utils/test_rest_util.py
@@ -174,6 +174,7 @@ class TestHttpOperations(AgentTestCase):
         for x in urls_tuples:
             self.assertEquals(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):
@@ -194,6 +195,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):
