How to forestall procedure the use of the sigstop sign in Linux
When a program or an software makes the total processor halt, we attempt to terminate that program to get again the machine to its customary situation. At this quick of time, we’ve got two choices, both to terminate that program the use of the “KILL” command or forestall the method of this system the use of the “-SIGSTOP” sign with the KILL command.
The -SIGSTOP possibility is used with the KILL command, to forestall the method, we will be able to speak about it intimately on this write-up.
How to forestall a procedure the use of the SIGSTOP sign in Linux
In Linux, the method is a working program or software which helps to keep the machine busy for a while while an software/program is the executable recordsdata which are saved at the machine. If an software is open, its procedure may also be controlled by means of the use of the KILL command; the KILL command has other indicators like SIGSTOP, SIGCONT, SIGQUIT, and SIGTRAP to control the processes. By default, if we use the KILL command, it’s going to believe the SIGTERM sign and can terminate the working program and alertness. To know it, we will be able to open the Mozilla Firefox software in Linux, to have the PIDs in addition to to verify the working standing of Firefox we will be able to use the command:
If Firefox isn’t working, it’s going to display no output; the airing of PIDs within the output has showed that Firefox is working. First, for the figuring out, we will be able to use the KILL command with none sign the use of Firefox:
In the above command, Firefox has been terminated as we mentioned prior to by means of default the kill command makes use of the SIGTERM sign, to verify this we once more use the PID command to test PIDs of Firefox:
Nothing is displayed within the output that implies this system has been terminated, to only forestall the method, we will be able to execute the command the use of the SIGSTOP sign after working Firefox once more:
$ kill -SIGSTOP $(pidof firefox)
The output displays that this system has been placed on dangle for a while, as an alternative of terminating it. To make this system customary once more, execute the command:
$ kill -SIGCONT $(pidof firefox)
The SIGCONT sign continues the method from the time the place it was once made held forestall, we will additionally use the PID to forestall the method, for this we will be able to write a script and show its PID the use of the “&”:
$ (sleep 60; echo “Hello! Linux Hint”) &
The above command will first sleep the terminal for 60 seconds after which will print “Hello! Linux Hint” however prior to it prints, we will be able to dangle the method the use of the “SIGSTOP” sign:
The strategy of printing the script has been stopped, now to proceed the method, use the “SIGCONT” sign:
The output has been displayed.
Conclusion
The sigstop is a sign which is used with the KILL command to forestall the method for a while as an alternative of terminating it completely; the method may also be resumed by means of the use of the sigcont command. This sign could be very useful, particularly when some processes are making the machine gradual, we will forestall those processes the use of the sigstop command. In this write-up, we’ve got mentioned the sigstop sign utilization intimately with the assistance of examples. We stopped the processes with a sigstop sign the use of this system identify in addition to its PID for higher figuring out.