pskill
Kill a process

Description

Destroys or sends a signal to a process, or changes the process priority.

Usage

pskill(pid, signal=SIGTERM)
psnice(pid=Sys.getpid(), value=NA_integer_)
SIGCHLD
SIGCONT
SIGHUP
SIGINT
SIGKILL
SIGQUIT
SIGSTOP
SIGTERM
SIGTSTP
SIGUSR1
SIGUSR2

Arguments

pid an integer giving the process ID of a process.
signal an integer giving the POSIX signal number to send to the process. If this is NA, no signal is sent.
value an integer specifying the new priority value to set. If value is NA, the priority is not changed, and the current priority value is returned.

Details

SIGKILL, SIGTERM, and other variables are set to the integer values for the corresponding signals. On Windows, all of these variables except SIGINT and SIGTERM have the value NA_integer_, so passing them to pskill does not send a signal.
On POSIX-compatible systems, priority values can be any integer from -20 (highest priority) to 19 (lowest priority). Windows has fewer priority levels, so psnice on Windows returns only a few values in the range from -20 to 19.
Value
pskillreturns TRUE if it successfully sends the signal. If the specified process does not exist, or if the signal cannot be sent, or if signal is NA, then it returns FALSE.
psnicereturns the current priority value (between -20 and 19) of the specified process. If the process does not exist, or if its priority cannot be accessed, then it returns NA_integer_.
See Also
Sys.getpid
Examples
tools::psnice()
## returns the priority of this engine process: normally 0L
Package tools version 6.1.1-7
Package Index