def status(name, sig=None):
    '''
    Return the status for a service via daemontools, return pid if running

    CLI Example:

    .. code-block:: bash

        salt '*' daemontools.status <service name>
    '''
    cmd = 'svstat {0}'.format(_service_path(name))
    out = __salt__['cmd.run_stdout'](cmd, python_shell=False)
    try:
        pid = re.search(r'\(pid (\d+)\)', out).group(1)
    except AttributeError:
        pid = ''
    return pid
def status ( name , sig = None ) : cmd = 'svstat {0}' . format ( _service_path ( name ) ) out = __salt__ [ 'cmd.run_stdout' ] ( cmd , python_shell = False ) try : pid = re . search ( r'\(pid (\d+)\)' , out ) . group ( 1 ) except AttributeError : pid = '' return pid
Return the status for a service via daemontools, return pid if running

    CLI Example:

    .. code-block:: bash

        salt '*' daemontools.status <service name>