'Initializes all the secondary self.*dir properties. Requires autodir,
clientdir and serverdir to already be initialized.'

def _initialize_dir_properties(self):

    def readonly_dir(*args):
        return self._job_directory(os.path.join(*args))
    def readwrite_dir(*args):
        return self._job_directory(os.path.join(*args), True)
    self._bindir = readonly_dir(self.clientdir)
    self._configdir = readonly_dir(self.clientdir, 'config')
    self._profdir = readonly_dir(self.clientdir, 'profilers')
    self._toolsdir = readonly_dir(self.clientdir, 'tools')
    try:
        autodir = os.path.abspath(os.environ['AUTODIR'])
    except KeyError:
        autodir = settings.get_value('COMMON', 'autotest_top_path')
    tmpdir = os.path.join(autodir, 'tmp')
    test_out_dir = settings.get_value('COMMON', 'test_output_dir', default=tmpdir)
    if self.serverdir:
        root = self.serverdir
    else:
        root = self.clientdir
    test_dir = settings.get_value('COMMON', 'test_dir', default=os.path.join(root, 'tests'))
    self._tmpdir = readwrite_dir(test_out_dir, 'tmp')
    pkg_dir = test_out_dir
    if (pkg_dir == self.serverdir):
        pkg_dir = self.clientdir
    self._pkgdir = readwrite_dir(pkg_dir, 'packages')
    self._testdir = readonly_dir(test_dir)
    if ('CUSTOM_DIR' in os.environ):
        self._customtestdir = readonly_dir(os.environ['CUSTOM_DIR'])
    else:
        self._customtestdir = readonly_dir(test_dir)
    self._site_testdir = readwrite_dir(test_out_dir, 'site_tests')
    if self.serverdir:
        if os.path.isdir('/usr/share/conmux'):
            self._conmuxdir = readonly_dir('/usr/share/conmux')
        else:
            self._conmuxdir = readonly_dir(self.autodir, 'conmux')
        logging.info(('conmux    directory    set    to:    %s' % self._conmuxdir))
    else:
        self._conmuxdir = None
