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

ps_terminate(p)

Arguments

p

Process handle.

Details

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

See also

Examples

px <- processx::process$new("sleep", "10") p <- ps_handle(px$get_pid()) p
#> <ps::ps_handle> PID=17457, NAME=sleep, AT=2020-02-16 11:38:37
ps_terminate(p)
#> NULL
p
#> <ps::ps_handle> PID=17457, NAME=???, AT=2020-02-16 11:38:37
#> [1] FALSE
px$get_exit_status()
#> [1] -15