Change the system runlevel on sysV compatible systems

    CLI Example:

    state : string
        Init state

    .. code-block:: bash

        salt '*' system.init 3

    .. note:

        state 0
            Stop the operating system.

        state 1
            State 1 is referred to as the administrative state. In
            state 1 file systems required for multi-user operations
            are mounted, and logins requiring access to multi-user
            file systems can be used. When the system comes up from
            firmware mode into state 1, only the console is active
            and other multi-user (state 2) services are unavailable.
            Note that not all user processes are stopped when
            transitioning from multi-user state to state 1.

        state s, S
            State s (or S) is referred to as the single-user state.
            All user processes are stopped on transitions to this
            state. In the single-user state, file systems required
            for multi-user logins are unmounted and the system can
            only be accessed through the console. Logins requiring
            access to multi-user file systems cannot be used.

       state 5
            Shut the machine down so that it is safe to remove the
            power. Have the machine remove power, if possible. The
            rc0 procedure is called to perform this task.

       state 6
             Stop the operating system and reboot to the state defined
             by the initdefault entry in /etc/inittab. The rc6
             procedure is called to perform this task.

def init(state):
    '''
    Change the system runlevel on sysV compatible systems

    CLI Example:

    state : string
        Init state

    .. code-block:: bash

        salt '*' system.init 3

    .. note:

        state 0
            Stop the operating system.

        state 1
            State 1 is referred to as the administrative state. In
            state 1 file systems required for multi-user operations
            are mounted, and logins requiring access to multi-user
            file systems can be used. When the system comes up from
            firmware mode into state 1, only the console is active
            and other multi-user (state 2) services are unavailable.
            Note that not all user processes are stopped when
            transitioning from multi-user state to state 1.

        state s, S
            State s (or S) is referred to as the single-user state.
            All user processes are stopped on transitions to this
            state. In the single-user state, file systems required
            for multi-user logins are unmounted and the system can
            only be accessed through the console. Logins requiring
            access to multi-user file systems cannot be used.

       state 5
            Shut the machine down so that it is safe to remove the
            power. Have the machine remove power, if possible. The
            rc0 procedure is called to perform this task.

       state 6
             Stop the operating system and reboot to the state defined
             by the initdefault entry in /etc/inittab. The rc6
             procedure is called to perform this task.
    '''
    cmd = ['shutdown', '-i', state, '-g', '0', '-y']
    ret = __salt__['cmd.run'](cmd, python_shell=False)
    return ret