def signal_job(jid, sig):
 if (HAS_PSUTIL is False):
  log.warning('saltutil.signal job called, but psutil is not installed. Install psutil to ensure more reliable and accurate PID management.')
 for data in running():
  if (data['jid'] == jid):
   try:
    if HAS_PSUTIL:
     for proc in salt.utils.psutil_compat.Process(pid=data['pid']).children(recursive=True):
      proc.send_signal(sig)
    os.kill(int(data['pid']), sig)
    if ((HAS_PSUTIL is False) and ('child_pids' in data)):
     for pid in data['child_pids']:
      os.kill(int(pid), sig)
    return 'Signal {0} sent to job {1} at pid {2}'.format(int(sig), jid, data['pid'])
   except OSError:
    path = os.path.join(__opts__['cachedir'], 'proc', str(jid))
    if os.path.isfile(path):
     os.remove(path)
    return 'Job {0} was not running and job data has been  cleaned up'.format(jid)
 return ''

def signal_job ( jid , sig ) : if ( HAS_PSUTIL is False ) : log . warning ( 'saltutil.signal job called, but psutil is not installed. Install psutil to ensure more reliable and accurate PID management.' ) for data in running ( ) : if ( data [ 'jid' ] == jid ) : try : if HAS_PSUTIL : for proc in salt . utils . psutil_compat . Process ( pid = data [ 'pid' ] ) . children ( recursive = True ) : proc . send_signal ( sig ) os . kill ( int ( data [ 'pid' ] ) , sig ) if ( ( HAS_PSUTIL is False ) and ( 'child_pids' in data ) ) : for pid in data [ 'child_pids' ] : os . kill ( int ( pid ) , sig ) return 'Signal {0} sent to job {1} at pid {2}' . format ( int ( sig ) , jid , data [ 'pid' ] ) except OSError : path = os . path . join ( __opts__ [ 'cachedir' ] , 'proc' , str ( jid ) ) if os . path . isfile ( path ) : os . remove ( path ) return 'Job {0} was not running and job data has been  cleaned up' . format ( jid ) return ''
sends a signal to the named salt jobs process cli example: .