linux暂停进程_如何在Linux上暂停和恢复进程的执行?

linux暂停进程

How to pause the execution of a process on Linux so that the CPU can be freed? Later, if the node is idle again, how to resume the execution?

如何暂停Linux上进程的执行,以便可以释放CPU? 稍后,如果节点再次处于空闲状态,如何恢复执行?

There are 2 signals related to stopping (pausing) and continuing (resuming) processes:

有两个与停止(暂停)和继续(恢复)过程有关的信号

Stop
    Default action is to stop the process. 
Cont
    Default action is to continue the process 
    if it is currently stopped.

You may use kill to pause and resume a process in Linux by sending these signals to it.

您可以通过向Linux发送这些信号,使用kill来暂停和恢复Linux中的进程。

To stop a process with pid ${P}:

要使用pid ${P}停止进程:

kill -STOP ${P}

To continue a process with pid ${P}:

要使用pid ${P}继续执行过程:

kill -CONT ${P}

Note: be very careful to pass the correct signals to kill. If no signal is specified to kill, the TERM signal is sent. The TERM signal will kill the process if it does not catch the signal.

注意:要非常小心地传递正确的信号来kill 。 如果没有信号被指定为kill ,术语发送信号。 如果TERM信号没有捕获到该信号,它将终止该过程。

Answered by Eric Z Ma.
埃里克·马(Eric Z Ma)回答。

翻译自: https://www.systutorials.com/how-to-pause-and-resume-the-execution-of-a-process-on-linux/

linux暂停进程

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值