2013年12月12日 星期四

How to PAUSE and CONTINUE a Linux process

Use kill command to send -STOP signal to pause a process and -CONT signal to continue it.

Example on CentOS6 Desktop:
1. Open a Terminal (name as T1) on Desktop and send "ps -aux | grep bash" to see how much bash in there.

2. Open another Terminal (name as T2) on Desktop and on T1 send "ps -aux | grep bash" to see process id of new created bash (T2)

3. On T1, send "kill -STOP " to pause T2
>T2 is hang

4. On T1, send "kill -CONT " to continue T2
>T2 is back to work
This is useful if a script is running on T2 and you want to pause it and continue it later

Reference:
http://tombuntu.com/index.php/2007/11/23/how-to-pause-a-linux-process/

沒有留言:

張貼留言