How to erase the process ID (PID) that cannot be erased! (Handling inoperability with Vim and Vi)

** $ sudo visudo command can no longer be entered and I am in great trouble, so I will describe the solution! ** **

For some reason, if you are forcibly terminated from the state of .ssh% or from [[email protected]] $, you may not be able to enter commands in the terminal.

I had a similar experience in the past, and maybe because the ** process ID ** wasn't cut successfully, when I logged in to ʻec2-user, I couldn't enter $ sudo visudo` I predicted. ** The error that occurred is below **

Error statement

visudo: /etc/sudoers are busy. Please try again later

I've spent so much time passing this issue that I've described ** general erasure methods for process IDs (PIDs) ** and ** erasure methods when process IDs (PIDs) grow indefinitely ** I think that I want to do it.

1. How to erase the basic process ID (PID)!

** 1. Change to the root directory in the terminal. Alternatively, set it to the state of .ssh% or [[email protected]] $. ** **

Terminal initial screen state

[email protected] ~ % (Is an example)

** 2. Enter ps **

Root directory

[email protected] ~ % ps

.ssh

[email protected] ~ .ssh % ps

ec2-use

[[email protected] ~]$ ps

** 3. Confirm that the PID (process ID) is displayed **

Enter ps and you should see a screen like the one below. スクリーンショット 2020-06-30 1.07.29.png

** 4. Delete the PID (process ID) with killʻorkill -9` ** (Since an error occurred in the ec2-user state, I will describe a description example in the ec2-user state)

[[email protected] ~]$kill PID number or kill-9 PID number
[Input example~] $ kill *** or kill -9 *** (*** = PID)

You can kill it by typing kill -9 (PID number).

** 5. If the PID (process ID) can be deleted, it can operate without problems **

** In my case, this procedure did not clear the PID (process ID). The problem that actually occurred was that even if the PID (process ID) was erased, it would be played indefinitely. ** **

2. How to eliminate infinite proliferation of PID (process ID)!

Here is the main issue! The infinite proliferation of PIDs (process IDs) that plagued me. If you know how to erase it, you can fix it very easily!

** 1. Change to the root directory in the terminal. Alternatively, set it to the state of .ssh% or [[email protected]] $. ** **

ec2-use

[[email protected] ~]$(Example)

I happened inside ec2-user, so I'll continue with the above state.

** 2. Enter ps l **

ec2-use

[[email protected] ~]$ ps l

** 3. Check the execution status of each process ** You should see a screen like the one below スクリーンショット 2020-06-30 0.29.24.png

** 4. Delete the PID (process ID) of wait_w in the column of WCHAN with kill **

I will post the details screen スクリーンショット 2020-06-30 0.29.35.png

kill method

[[email protected] ~]$kill PID number or kill-9 PID number
[Input example~] $ kill *** or kill -9 *** (*** = PID)

** 5. Since the process ID (PID) that proliferates infinitely can be deleted, it can be entered safely! ** **

Reference material

The types of ps commands are listed in the ps command collection below. If you are interested, please have a look! ** ps command collection **

Finally

This concludes the explanation of the process ID (PID) erasure method (process ID infinite proliferation) that cannot be erased. I would appreciate it if you could point out any mistakes.

Thank you for watching until the end.

Recommended Posts

How to erase the process ID (PID) that cannot be erased! (Handling inoperability with Vim and Vi)
How to solve the problem that notification cannot be requested on iOS14
[Rails] How to introduce kaminari with Slim and change the design
The operator that was born to be born, instanceof (Java) ~ How to use the instanceof operator ~
How to interact with a server that does not crash the app
[Rails 6] cocoon_ Add id and data attributes to the form to be added
767 JSON :: ParserError occurs and the problem that the local server cannot be started