'Set the default systemd target.
Create the symlink in a temp directory and then use
atomic rename to move the symlink into place.
:param runlevel: default systemd target
:type runlevel: str'

@staticmethod
def change_default_runlevel(runlevel='multi-user.target'):

    tmp_symlink = mktemp(dir='/etc/systemd/system')
    os.symlink(('/usr/lib/systemd/system/%s' % runlevel), tmp_symlink)
    os.rename(tmp_symlink, '/etc/systemd/system/default.target')
