Pages

Thursday, April 4, 2013

Pause and Continue a Process


In Linux There is a Way to Pause a Process. As a App Server Admin , during a Process of Sync the data on the disk to another as a process For DR we need to use these options for pausing a Process until the Data Sync is completed.

Linux Contains Kill Command which can do some thing with a process. For pausing a process we can pass a specific Signal to the Process.

As to kill a process we send a SIGKILL to a process which kills a process . In the same way we can send a SIGSTOP to pause a Process like,

kill -SIGSTOP 19564

At this point when you check the Process State it moves to T1.I Paused a Tomcat process and tried to access the manager console which could not be loaded.

When SIGSTOP is sent to a process, the usual behavior is to pause that process in its current state. The process will only resume execution if it is sent the SIGCONT signal. SIGSTOP and SIGCONT are used for job control in the Unix shell, among other purposes. SIGSTOP cannot be caught or ignored.

In order to get the process back from pause we can issue the

kill -SIGCONT 19564

In short, SIGSTOP tells a process to “hold on” and SIGCONT tells a process to “pick up where you left off”.

Happy learning :-)