[Previous] [Contents] [Next]

slay

Kill or modify a process by name (QNX)

Syntax:

slay [options]... process_name...

Options:

- signal_number
A signal number specifying which signal to raise on the processes matching process_names.
-f
Force the action to be taken on all processes sharing the same process_name. Normally, slay prompts for confirmation when more than one process bears the specified name.
-h
Set a SIGSTOP signal on a process, effectively holding its execution.
-n nid
Search for the specified processes on the remote node nid.
-P prio[f|r|o]
Set the processes matching process_name to priority prio. Non-root users are limited to a maximum priority of 19. The priority may be followed by f, r or o to change the scheduling policy to FIFO, RR or OTHER, respectively.
-q
Query before dealing with the process, even if only one process is found with a matching name (overrides option -f). This option is useful for viewing the other process information that slay presents.
-Q
Be quiet. This option is useful when slay is invoked from a C program.
-s sig
Define a signal to send. This option causes the signal sig to be raised for the processes matching the process_names.
-S
Suppress killing processes that have child processes. A typical use of this command would be within a shell command that shuts down shells on other devices. Setting this option would prevent slay from killing those shells that had other processes (such as editors) running. If -q is also specified, slay will prompt for a forced kill even if the named process has child processes.
-t ttyname
Match only those processes whose name is process_name, with ttyname as the controlling terminal. If ttyname doesn't begin with a slash (/), slay assumes that it starts with the /dev/ prefix.
-u
Set a SIGCONT signal on a process. If execution of the process was being held by a SIGSTOP signal, execution will begin where it left off. If the process had not previously had a SIGSTOP set upon it, the SIGCONT signal has no effect.
-v
Be verbose; display messages about processes being signaled.
process_name
The name of a process to operate on.

Description:

You use the slay utility to kill a process by name rather than by process ID. This saves you from having to first run the ps utility to obtain a pid before issuing a kill command. Process names are specified without the path. For example, let's say you have a process called /bin/sleep that you wish to kill. Entering sleep as the process name would be sufficient to allow slay to find and kill it.

There are many forms of this command. The simplest and most often used form is:

    slay process_name

This command locates the process bearing the specified name. If only one is found, a SIGTERM signal is set on it. If more than one process bears the specified name, you are prompted for a yes/no response for each process. When each process is listed in this form, the process name, pid, and tty group/member numbers are also displayed to help you make a selection.


Note: To set a signal on a process you must either own the process or be logged in as root.

Examples:

Kill spooler process on node 2:

    slay -n 2 spooler

As root, change priority of the test process to 20:

    slay -P 20 test

Exit status:

0
No processes matched the supplied criteria, an error occurred, or the number of processes matched and acted upon was an even multiple of 256.
1-128
The number of processes matched and acted upon modulo 256 (e.g. a status of 1 could mean 1 process, 257 processes, 513 processes etc.)
129-160
If the exit status was gleaned through direct spawning, this is the number of processes matched and acted upon modulo 256. If slay was run through the shell, this will be either the number of processes matched and acted upon, or will be the cause of slay dying due to a signal (subtract 128 from the exit status to determine the signal number).
161-255
The number of processes matched and acted upon, modulo 256.

Caveats:

The exit status of slay is non-standard for historical reasons. It is strongly recommended that slay not be used in any situation where the exit status will be relied upon because the status is ambiguous in some circumstances.

See also:

kill, ps, sin


[Previous] [Contents] [Next]