def convert_sysv_runlevel(level):
    """
    Convert runlevel to systemd target.

    :param level: sys_v runlevel
    :type level: str or int
    :return: systemd target
    :rtype: str
    :raise ValueError: when runlevel is unknown
    """
    runlevel = str(level)
    if runlevel == '0':
        target = 'poweroff.target'
    elif runlevel in ['1', 's', 'single']:
        target = 'rescue.target'
    elif runlevel in ['2', '3', '4']:
        target = 'multi-user.target'
    elif runlevel == '5':
        target = 'graphical.target'
    elif runlevel == '6':
        target = 'reboot.target'
    else:
        raise ValueError('unknown runlevel %s' % level)
    return target
