Kill Processes using the CLI

In order to kill a job, you must be on the machine on which the job is running, identify the PID of the job and then send the Kill signal to the PID.

In contrast, you can stop a job from any machine, because you are essentially telling the vovserver to tell the vovtasker to kill the job.

You can kill the job using kill directly, but you may find the utility vovkill to be quite useful because it kills not only a process but also all of its children.

In order to identify the PID of the process to kill, you may also consider using the utility vovps to identify the children and parents of a process.

vovkill

This utility is used to kill processes.


vovkill: Usage Message
  
  DESCRIPTION: 
      This utility is used to kill processes,
  
      It differs from kill because:
      - It kills a process and all of its children;
      - It can send a list of signals to try to kill a process.
  
  USAGE: vovkill [options] <pid> ...
      Kill the given process and all of its children.
      The processes are first sent TERM, then HUP, then INT, then KILL.
  
  OPTIONS: 
      -v                 -- Increase verbosity.
      -n                 -- Just show what you would do but do not do it.
      -rx      <rx>      -- Kill processes that match the given rx.
      -exclude <pid>     -- Exclude pid from list of processes to kill.
      -pid     <pid>     -- Process to kill.
      -signal  <s>       -- Which signal you want to send.
      -gentle            -- Send only HUP.
  
  EXAMPLES: 
      % vovkill 22123
      % vovkill -signal INT 22123
      % vovkill -gentle 22123
      % vovkill -rx grep -signal 9  223
  

vovps

vovps lists all processes, similar to the UNIX command ps. It is useful to understand the process hierarchy of Accelerator jobs, and sometimes to find which PIDs to kill in a shell.

The -c and -p options show the child processes and parent processes respectively of a given pid. The results are a Tcl list of pid, program name, and owner.

usage: vovps [-an] [-c pid] [-dgsSJj] [-p pid] [-mP]
   -a:         Print all processes, one per line, like a simple version of 'ps'
   -n:         Only print pids: must come before -c or -p
   -c:         Print the children of process <pid>. The printing is in Tcl
               format, but it is also easy to parse.
   -d:         Debug process info collection
   -g:         Include list of processes with same PGID to children
   -s:         Include list of processes with same SID to children
   -S:         Include state of process R,S,T,Z... 
   -J:         Include list of processes with same VOV_JOBID to children
   -j:         Like -a, but show the VOV_JOBID also and LM_PROJECT instead of
               command line
   -p:         Print the parents of process <pid>. Same format as for -c
   -m:         Print more detailed memory usage information (Linux).
   -P:         Use 'ps' program to scan the processes. This behavior can also
               be selected by setting the environment variable VOV_USE_PS.

Examples

Example 1:

% vovps -a | grep fire
31155 28981   1h06m    0    0    0.00    0.01 bkring    vovfire28981.cs
32381 32260  56m35s  977  219    6.45   70.33 bkring    firefox
Example 2: (the shell substitutes the current pid for '$$'):
% vovps -p $$
set parents(28756) {
   28754 "xterm" cadmgr
       1 "init" root
}