Skip to content

Send a SIGTERM signal to the process. Not implemented on Windows.

Usage

ps_terminate(p = ps_handle())

Arguments

p

Process handle or a list of process handles.

Details

Checks if the process is still running, to work around pid reuse.

Examples

px <- processx::process$new("sleep", "10")
p <- ps_handle(px$get_pid())
p
#> <ps::ps_handle> PID=7693, NAME=sleep, AT=2024-10-29 08:52:11.93
ps_terminate(p)
#> NULL
p
#> <ps::ps_handle> PID=7693, NAME=???, AT=2024-10-29 08:52:11.93
ps_is_running(p)
#> [1] FALSE
px$get_exit_status()
#> [1] -15