SKILL(1)

NAME
skill, snice - signal or reprioritize specified processes

SYNOPSIS
skill [-signal] [-ivfwn] {tty user command pid}
snice [(-|+)priority] [-ivfwn] {tty user command pid}
skill -l

DESCRIPTION
Skill sends the terminate signal to a set of processes. If a signal name (or number) preceded by a `-' is given, that signal will be substituted for terminate. The command `skill -l' displays a list of available signals.

Snice alters the scheduling priority of selected processes. By default, the new priority is +4, but an argument of the form `+n' (or `-n') can be used to specify different values. An invalid priority is quietly rounded down (or up) to the first acceptable value.

Options accepted by both commands are as follows:

-i  In interactive mode, the user is prompted with each process that is a candidate for action. Responding `y' will carry out the stated action. Also, a ^D at this prompt causes skill or snice to exit immediately.

-v  In verbose mode, the id of each process successfully acted upon is displayed.

-f  In fast mode, the machine-dependent code responsible for reading processes is allowed to make decisions to improve speed at the expense of error reporting (e.g. commands may not be displayed). This option mainly exists to aid in killing runaway processes on operating systems with complicated VM designs.

-w  Display warning messages for unreachable processes.

-n  Display process id's but do not act on them.

All command line arguments are order independent. Skill and snice allow processes to be specified using any combination of ttys, user names, and commands (as well as process id's). Only processes that match something in each category are acted upon. An empty category guarantees a match. For example, `skill -HUP vi ex tty00' will send the hangup signal to all vi(1) and ex(1) processes associated with tty00. Similarly, `snice +10 find root' will change the priority of all find(1) processes owned by root to +10.

Unprivileged users can only change their own processes so they need not specify their user name as part of the argument list. On the other hand, the super-user should be more careful (e.g. the command `snice -5 vi' will change the priority of every vi(1) process on the system).

Since skill and snice categorize their arguments, there is a chance that they will do so incorrectly (e.g. a system command is also a user name). Both programs try to match an argument with a tty, a user name, and a process id, before classifying it as a command. To override this, an argument can be forced to a particular type by preceding it with "-c" (command), "-u" (user), "-t" (tty), or "-p" (process id).

Process id's are not known beforehand, so both kernel memory and the swap device must be searched for the required information. Alternately, on some systems, the "/proc" file system is examined. When a process fitting each category is discovered, it is immediately acted upon (unless running in interactive mode). Processes must belong to the current user unless s/he is the super-user. Neither program will ever act on itself, but everything else is fair game.

Exit status is normally 0; if the user makes a mistake, 1 is returned. If a system error occurs, exit status is 2.

FILES
/vmunix    system name list
/dev/mem    physical memory
/dev/kmem    kernel virtual memory
/dev/drum    swap device
/proc    process file system
/dev    searched to map ttys into device numbers

SEE ALSO
kill(1), nice(1), priocntl(1), renice(1), ps(1),
kill(2), setpriority(2), signal(2), proc(4)

AUTHOR
Jeff Forys

CONTRIBUTORS
David Sharnoff    Greg Earle    Christos Zoulas
Gorodecki Tom    Mike Hibler    Ric Anderson

BUGS
Things change while these programs execute, occasionally processes will be missed (the `-w' flag displays these).

Command names may be truncated to a machine-dependent size.

On some operating systems, these programs are unable to investigate processes belonging to other users. While not a problem, this fact is reflected in the "(but N could not be checked)" notice, which follows the "no matching processes" message.