def str_to_bool(s: str):
    """Return a boolean for the given string, follows the same semantics systemd does."""
    if s.lower() in ('1', 'yes', 'true', 'on'):
        return True
    elif s.lower() in ('0', 'no', 'false', 'off'):
        return False
    else:
        raise NotImplementedError(f"Unknown boolean value from string: {s}")