#NEWLINE# def status( name , sig = None ) : #NEWLINE# #INDENT# "\n    Return the status for a service, returns a bool whether the service is\n    running.\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt '*' service.status <service name>\n    " #NEWLINE# if _service_is_upstart ( name ) : #NEWLINE# #INDENT# cmd = 'status {0}' . format ( name ) #NEWLINE# return ( 'start/running' in __salt__ [ 'cmd.run' ] ( cmd , python_shell = False ) ) #NEWLINE# #UNINDENT# if sig : #NEWLINE# #INDENT# return bool ( __salt__ [ 'status.pid' ] ( sig ) ) #NEWLINE# #UNINDENT# cmd = '/sbin/service {0} status' . format ( name ) #NEWLINE# return ( __salt__ [ 'cmd.retcode' ] ( cmd , python_shell = False , ignore_retcode = True ) == 0 )