[minipost] How to pause a running process on Linux

Ever wanted to pause some background running process without killing it? I have needed this suddenly when I and a group of friends wanted to do a dedicated server pause for our coop game (ArmA2 if anyone interested). To do this on linux, you can simply find the process running  ID using the “ps” command and send STOP signal to it as shown below. Also you can recover this by sending CONT signal to the kernel when needed.

NOTE: The “ps” command is main tool to display running processes on unix like systems. Try to filter what you are looking for using pipe |. Example from when we were looking for arma server: “ps -ef | grep arma“.

To pause any process, you can send a “STOP” signal to the kernel with the process ID using the kill tool.

kill -STOP {pid}

NOTE: Try to have a look on the CPU consumption using “top” tool to confirm that the process you now paused because there will be no other indication that something happened only that the process stopped using cpu resource and his CPU utilization should be 0%.

To recover the process back from this “freezed” state, you can again send a “CONT” signal to the kernel to un-pause the process back to the original value.

kill -CONT {pid}

In summary these two commands are neat to know. I assume this will not be used very often by anyone, but it helped us to have this available in our particular situation.

---
Peter Havrila , published on