How to drive a Linux process. Processes and task management How to drive a process into linux

Antipyretic remedies for children are prescribed by a pediatrician. But there are situations of indispensable help for fevers, if the child needs to give faces negligently. Then the fathers take on themselves the resuscitation and stop the antipyretic preparations. What can be given to infants? How can you lower the temperature in older children? What are the most safe faces?

The -9 (or KILL) argument to the kill command should not be beaten on POSIX-crazy systems as often as needed. Why? The KILL signal cannot be processed by the process. This means that after the completion of the process for help, kill -9 daughter processes will be forgotten and become "orphaned" (orphaned), file system will show up as timed files, memory segments that are fully checked out will be active, sockets will be hung, and the atexit(3) function will not be checked out. As a result, the risk is hindered by unsatisfactory and foldable problems.

Instead, change the default signal TERM , and KILL - just as less problematic signals appear to be ineffective:

$ kill 6738
$ kill -INT 6738
$ kill -HUP 6738
$ kill -KILL 6738

If you send a KILL signal, you cannot complete the process, which means that the process is more likely to hang during the input-output operation, or to be in another unfinished state. You may need to re-install or re-mount the buggy merging disk.

The kill -KILL abbreviation is allowed for an hour of work with a problematic addendum, for example, older versions of Netscape often ended with an additional KILL signal. However, the rіdkіsny vynyatok z rules: tag KILL for these other programs and only for them.

Problems that are blamed on the completion of processes

The subsequent strengthening of other signals may cause such problems: in the first place, the process may need seconds, or it may take tens of seconds to complete correctly. One product that I have had to wait for over 30 seconds to properly complete after the TERM signal was cancelled. Luckily, this particularity was revealed in the first hour of testing, for which particular script was written. On the other hand, sometimes the situation is, if the old process is completed, then the new process has taken its ID from between the TERM and KILL signals. Particularly this risk is caused by systems with advanced “plyness” processes, such as the kernel assigning PIDs to a specific order, for example, OpenBSD. Rechecking the name of the process or else PPID does not help, so that the new process can be a fork of the same father and mother of the same name, especially paranoid scripts can also recheck the hour of the process, or other metadata before editing the signal. Possibly, these situations are rarely blamed, but with them varto rahuvatisya, as if to bring the mother to the right with a critical process.

Process completion signal

Process completion signals can be given by name or sequence number: kill -1 and kill -HUP are equivalent. However, despite the name of the signal is safer, shards with the argument -1 can be easily printed, correcting the signal to another process or to send a group of processes. So always try to spell names in scripts, so that you can better understand what type of signal is sent to someone who reads your code.

The HUP signal "move" the shell, so garniy way clear the shell, which is stuck in the login window, or close the SSH session.

More detailed information about process completion signals is given in


Author: Damien
Publication date: 8 June 2013
Translation: A. Krivoshey
Translation date: April 2014

Independently, as the operating system you win, the skin sticks with us, if necessary, close the program, it hung. Linux (and Mac) has a "kill" command, which can be used to complete the primus robotic add-ons. I'll show you a sprat different waysїї vikoristannya.

Command and Signal Kill

If you defeat the "kill" command, then in fact you are sending a signal to the system to stop the addendum that you are behaving incorrectly. You can usually win up to 60 signals, but all you need to know is SIGTERM (15) and SIGKILL (9).

You can look through all the signals for additional commands:

SIGTERM - This signal feeds the probe to the robotic process. Vin can be ignored. The process is expected to take an hour to complete correctly. As soon as the program is completed correctly, then it will win over an hour for those who want to save their lives or work results and increase resources. In other words, її did not hesitate to zupinitsya.
SIGKILL - this signal stuns the process to pin the robot in a wrong way. The program cannot ignore the signal. Unsaving results will be wasted.

The syntax for the "kill" wiki is:

$ kill [signal or option] PID

Standard signal (as well as other jobs) - SIGTERM. Although wine does not help, for the primus completion of the process, you can win the following options:

$ kill SIGKILL PID $ kill -9 PID

de ensign "-9" signal SIGKILL is sent.

If you don't know the exact program PID, just run the command:

You will find information from the current running programs.

For example, to end Chrome, I'll enter the command:

So give respect to those who can complete a spate of processes with one team.

$ kill -9 PID1 PID2 PID 3

PKill

The pkill command allows you to beat extended patterns of regular viruses and other validation criteria. Change the PID you can end the program by entering the process name. For example, to complete Roboty Firefox just enter the command:

$ pkill firefox

So, as it follows the pattern of a regular pattern, you can enter it only often, for example:

In order to make sure that some programs are not finished, as needed, you can win the "pgrep -l" command to display a list of all the necessary processes.

Killall

Killall also takes over the PID process and completes all instances of the process with this name. For example, if you have launched a few instances of Firefox, you can end them with the following command:

$ killall firefox

With Gnome, you can restart Nautilus with the help of the following command:

$ killall nautilus

xkill

Xkill is the ultimate graphical way to complete add-ons. If you type "xkill" at the terminal, the cursor will look like a cross. All that you need, click on the cross at the end of the required program and it won't be completed. If you like this method, you can tweak hotkeys to activate xkill.

Visnovok

If the program behaves incorrectly and the system hangs up, it may be necessary to reset the computer and start the session again. For the help of these "kill" commands, you can terminate the program that is stuck, without harm to the robotic system. It's especially bad for servers, if you don't want to, the program, which hung, brought the entire server to the bottom.

Today we'll talk about those, like ubuntu linux deal with processes like you're stuck and you can't finish them. The stench devours system resources, zavantazhyuchi system, vіdzhirayuchi decent part. operational memory, which causes such problems as galvanization of a robotic computer or a frequent system freeze for a short hour. Situations are different, it’s dependent on the working style, it’s an addition to the dependency, sometimes the sharpening of the working table freezes, most of these situations we can find out how to do without re-adjusting the system and not simulating the computer with the button on system block computer so that's not good decisions.

Sometimes you need to drive the process into Ubuntu Linux, as it is right to viconate and not nashkodit, we can discuss the console options and through the graphical interface.

Today we will talk about how to deal with processes in Ubuntu Linux, if they are stuck and you cannot complete them. The stench devours system resources, zavantazhuyuchi system, vіdzhirayuchi decent part of the operational memory, chim create such problems like a hack in a robotic computer or a frequent system freeze for a short time. Situations are different, it’s dependent on the working style, it’s an addition to the dependency, sometimes the working table is hung up, most of these situations we can’t quit, how to get by without restarting the system and don’t switch off the computer with the button on system block of the computer so as not to є good decisions.

When working with Ubuntu Linux, you probably already blamed the power:

How to assign a PID to a remote drive in a process / addendum

If you don't want to run the command top or a larger, more strained її analogue htop, give yourself a turbulence with whispers go to that chi іnshoy go to the process, є more simple way out / solution to know PID The process can vikoristovuvat command " pidof"abo" PS".

It is permissible for us to recognize the ID process of the program Google Chrome To work in this situation, open the terminal Ctrl+Alt+T and run the following command in the terminal:

Pidof chrome

otrimuemo vysnovok:

9497 9183 9123 8815 8788 6042 6033 5938 5916 5911 5908 5900 5892 5836 5831 5819

Mayzhe is ready, we have assigned the PID, about those how to kill the process, read below.

How to kill a Linux process by PID

We assigned some PID as an addendum, which we want to drive in, from the described above, you bachite, that I have a lot of tabs running at the same time in the browser and plus a browser process, as a result 16 ID, to kill them all, we will run the command:

Sudo kill 9497 9183 9123 8815 8788 6042 6033 5938 5916 5911 5908 5900 5892 5836 5831 5819

so you can see all active processes in the system by running the command:

sudo ps axu

so, so easy. Deputy Chrome can be another program, skype or else.

You can also type in an addendum command to display the ID of the program process, whatever you want to enter:

Ps-A | grep -i name-app

replace name-app by writing the name of the program, do not enter the name again manually, select auto-assignment for the help keys " TAB". As a result, the team found an hour of work of the necessary process and PID, whichever you can beat, to kill, let's check the robot command in the terminal:

Ps-A | grep -i skype

we accept the result:

9257? skype 00:00:57

everything we need is like in the valley, let's go like this Danish process already practicing.

How to win the Kill command on Linux

About those, how to take the PID identifier, I described it earlier, gave us less time to beat the PID together with the kill lower mi process, which is objectionable to us, marveling at the details a little lower.

Idі otrimali and now we can kill the program:

Sudo kill 9257

axis i all, addendum of murders.

How to drive a process in Linux on im'ya

To kill the process on im'ya, you can beat the killall command, first of all, understand that the command is given to drive in all processes, as if they could be one and the same im'ya. This is more convenient, because in this situation we do not need to check the PID of the necessary process, for example, we want to close skype addendum, We can run the following command in the terminal:

sudo killall skype

so just an option:

sudo killall -s 9 skype

Tієї well mitі program pripinyaє your robot, the axis can so easily drive in processes that you do not like.

Team of death, scho not varto win at the terminal

I have previously written material about shkidlivy, such as commands not to warp in the terminal, so as not to kill the system, but the list is not perfect and you can add more commands, one of which you will know below.

I will direct the butt of the death command:

Sudo kill -9 -1

This command is all running at the moment of the process. Chi is not happy to be її vikonuvaty so as a result can be untransferred and more likely to restart the system without a graphical interface. A graphical interface is promptly launched, or the terminal is opened for additional commands CTRL+ALT+F1, the skin is newer than ever, follows the same analogy, just change F1 from now to F2 and so on.

You can check the finalization of the commands, which were more successful, you can use the following commands through the terminal:

Man ps man grep man pidof man kill man killall

On why our short material is over, if you don’t understand it, feed it in the comments to the material below.

Yak bi was not there, but deyaki dodatki in linux sometimes hang up. Whenever there are situations, if the supplements are not taken into account, otherwise it is so correct that it is impossible to complete the work correctly. In order to quickly get out of the situation, you can “drive in” the whole process. For whom the teams are victorious killі killall. At a time, we'll figure out how to hack the commands, know the PID of the process and send the SIGKILL signal.

In order to get rid of the swindlers, we will start the program under the process of understanding. For example, as you have launched sprat vikon Mozilla browser Firefox means there are three processes running.

Assign the PID to a process - pidof command

PID- Unique process identifier in the system linux. Sob correctly vikonati zupinku process, cob varto viznachiti yogo PID. For which the ps and grep commands are used. Into your hell ps command recognized for displaying the list of active processes in the system and information about them. grep command Runs once per hour with ps (at the channel) and waits for the results of the ps command to wait. You can enter a list of successful processes by typing in command line:

Understanding, PID can be determined through top. But in most cases, the number of processes is too large (and changes dynamically in top), so it is not so easy to quickly and correctly assign PID. The grep command is the one that wins. For example, to complete the process Google browser Chrome needs to type the following command:

ps axu | grep chrome

$ ps axu | grep chrome
itechf2 20474 2.7 1.5 938416 120136 tty2 Sl+ 11:07 0:00 /opt/google/chrome/chrome

Our paddock has 20474 PID noises. The easiest way is to win a team pidof When it is necessary to tell the name of the process. For example:

$pidofchrome
20728 20706 20668 20647 20586 20574 20553 20508 20474

Kill process on Linux - kill and killall commands

End the process at operating system linux if you know yoga PID, you can use the command kill. Be aware that the kill command is recognized for sending a signal to a process. After closing, as we do not indicate any signal of overstrength, the SIGTERM signal is overpowered (like the word termination - completion). SIGTERM points to those that need to terminate. Leather signal maє vlasny number. SIGTERM may be number 15. List of signals (those numbers) that can send the kill command, you can enter, after kill -l . To send a SIGKILL signal (vin mai number 9) to process 2811, type in the command line:

With this SIGTERM signal, the process may not be interrupted (for example, if the signal is overridden or blocked), SIGKILL kills the process, so it cannot be overridden or ignored.

killall command in Linux it is recognized for "driving in" all processes that can be done by the same name. This is handy, because we do not need to know the PID of the process. For example, we want to close all processes with chrome name. Sign off at the terminal:

The killall command, like kill, sends a SIGTERM signal behind the lock. To send another signal, you need to speed up the option -s . For example:

The -9 (or KILL) argument to the kill command should not be beaten on POSIX-crazy systems as often as needed. Why? The KILL signal cannot be processed by the process. This means that after the process is completed for help, kill -9 child processes will be left in memory and become "orphaned" (orphaned), the file system will appear to be obscured by time files, the memory segments that are fully victorious are active, the sockets are dependent , and the function atexit(3 ) will not be checked. As a result, the risk is hindered by unsatisfactory and foldable problems.

Instead, change the default signal TERM , and KILL - just as less problematic signals appear to be ineffective:

$ kill 6738
$ kill -INT 6738
$ kill -HUP 6738
$ kill -KILL 6738

If you send a KILL signal, you cannot complete the process, which means that the process is more likely to hang during the input-output operation, or to be in another unfinished state. You may need to re-install or re-mount the buggy merging disk.

The kill -KILL abbreviation is allowed for an hour of work with a problematic addendum, for example, older versions of Netscape often ended with an additional KILL signal. However, a final culprit from the rule: win KILL for these other programs and only for them.

Problems that are blamed on the completion of processes

The subsequent strengthening of other signals may cause such problems: in the first place, the process may need seconds, or it may take tens of seconds to complete correctly. One product that I have had to wait for over 30 seconds to properly complete after the TERM signal was cancelled. Luckily, this particularity was revealed in the first hour of testing, for which particular script was written. On the other hand, sometimes the situation is, if the old process is completed, then the new process has taken its ID from between the TERM and KILL signals. Particularly this risk is caused by systems with advanced “plyness” processes, such as the kernel assigning PIDs to a specific order, for example, OpenBSD. Rechecking the name of the process or else PPID does not help, so that the new process can be a fork of the same father and mother of the same name, especially paranoid scripts can also recheck the hour of the process, or other metadata before editing the signal. Possibly, these situations are rarely blamed, but with them varto rahuvatisya, as if to bring the mother to the right with a critical process.

Process completion signal

Process completion signals can be given by name or sequence number: kill -1 and kill -HUP are equivalent. However, despite the name of the signal is safer, shards with the argument -1 can be easily printed, correcting the signal to another process or to send a group of processes. So always try to spell names in scripts, so that you can better understand what type of signal is sent to someone who reads your code.

The HUP signal "suspends" the shell, so it's a good way to clear the shell, which is stuck in the sanitized entry or close the SSH session.

More detailed information about process completion signals is given in

Support the project - share your efforts, darling!
Read also
Firmware for a mobile modem pid usi simki Chi can be flashed mts router Firmware for a mobile modem pid usi simki Chi can be flashed mts router Android firmware for the help of the FastBoot utility Android firmware for the help of the FastBoot utility Easy Ways to Root on Attachments with MTK65XX Processor Easy Ways to Root on Attachments with MTK65XX Processor