z/OS UNIX System Services Planning
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Steps for ending a specified process

z/OS UNIX System Services Planning
GA32-0884-00

A process is the execution of a program. MVS™ calls the basic unit of execution a job or a task; in UNIX, it's called a process. You can find out whether a process is active, and you can end it.

Before you begin: You need to know which processes you want to end and whether they are active.

Examples: Use the DISPLAY OMVS operator command or the ps command to display all active processes.
  1. To list the address space identifiers for processes, issue:
    DISPLAY OMVS,A=ALL
  2. To display a particular ASID, where asid is a specified ASID:
    DISPLAY OMVS,A=asid
  3. To display information about all accessible processes, providing that you have the appropriate privileges:
    ps -elf

Perform the following steps to end a specified process, where pppp is the process identifier (pid).

  1. Send a SIGTERM signal using the shell kill command or use the TERM parameter of the MODIFY operator command. For example:
    1. kill -s term pppp 
    2. F BPXOINIT,TERM=pppp

    If the process is not ended, then go to Step 2. Otherwise, you have canceled the process and you are finished.

    _______________________________________________________________

  2. Send a SIGKILL signal using the shell kill command or use the FORCE parameter of the MODIFY operator command. For example:
    1. kill -s kill pppp
    2. F BPXOINIT,FORCE=pppp

    If the process is still not ended, then go to Step 3. Otherwise, you have canceled the process and you are all done.

    _______________________________________________________________

  3. Send a stronger SIGKILL signal using the shell kill command or use the SUPERKILL parameter of the MODIFY operator command. For example:
    • kill -K pppp
    • F BPXOINIT,SUPERKILL=pppp

    If the process is still not ended, then go to Step 4. Otherwise, you have canceled the process and you are finished.

    _______________________________________________________________

  4. If the previous steps did not end the process, then use the CANCEL command. Issue:
    CANCEL jobname,a=asid
    Example: The following example shows how to obtain the ASIDs for a user with the TSO/E user ID JOE and then cancel the user's process that is running the sleep 6000 command.
    display omvs,u=joe
    BPXO001I 17.12.23 DISPLAY OMVS 361
    
    OMVS      ACTIVE             OMVS=(93)
    USER     JOBNAME  ASID        PID       PPID  STATE   START    CT_SECS
    JOE      JOE      001D          5          1  1RI   17.00.10     1.203
    JOE      JOE3     001B     131076     262147  1SI   17.00.10      .111
      LATCHWAITPID=          0 CMD=sleep 6000
    JOE      JOE1     0041     262147          5  1WI   17.00.10      .595
      LATCHWAITPID=          0 CMD=-sh
    
    cancel joe3,a=1b
     

    _______________________________________________________________

When you are done, you have ended the specified process.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014