def parse_systemd_envfile(filepath):
    """Parse systemd environment file into a dict.

    """
    result = dict()
    with open(filepath, 'r') as fo:
        for ln in fo.readlines():
            ln = ln.strip()
            if ln == '' or ln.strip().startswith("#"):
                continue
            k, v = map(str.strip, ln.split('=', 1))
            result[k] = v
    return result