Linux command to stop a process

taaz
taaz used Ask the Experts™
on
I had this question after viewing Unix / Linux grid computing.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Gerwin Jansen, EE MVETopic Advisor
Most Valuable Expert 2016
Commented:
What is the question?

To stop a process, you use the kill command. Give the process ID as parameter.
Yes, use kill (or kill -9) aka SIGTERM or SIGKILL

Just to add:

https://major.io/2010/03/18/sigterm-vs-sigkill/

Author

Commented:
So we can not stop the process and then restart ?
The only option we have is to kill the process?

How we can start the same process if we kill it?

Author

Commented:
The thing is I want to temporary stop the process and then restart
Gerwin Jansen, EE MVETopic Advisor
Most Valuable Expert 2016

Commented:
What process is this? You want to pause a process, not stop a process right?

Author

Commented:
Right
To pause and then start
Topic Advisor
Most Valuable Expert 2016
Commented:
To do that you can try SIGSTOP and SIGCONT signals:

SIGCONT - To make processes continue executing after being paused by the SIGTSTP or SIGSTOP signal, send the SIGCONT signal to the paused process. This is the CONTinue SIGnal. This signal is beneficial to Unix job control (executing background tasks).

So:

kill -SIGSTOP <process ID>

and:

kill - SIGCONT <process ID>

Author

Commented:
Thank you!!!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial