[Ruby] How to delete process ID (PID) that cannot be deleted! (Handling inoperability with Vim and Vi)

2 minute read

**Because I was very embarrassed because I could not enter the command of $ sudo visudo, I will describe the solution! **

For some reason, if it is forcibly terminated from the state of .ssh % or [[email protected]] $, command input in the terminal may not be possible.

I also had a similar experience in the past, maybe the ** process ID ** was not cut off normally, so when I logged in to ec2-user , I could not enter $ sudo visudo I predicted. The error that occurred is below

error statement

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

I spent a lot of time passing this issue, so I wrote about general erasing method of process ID (PID) and erasing method when process ID (PID) grows indefinitely. I think that I want to do it.

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

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

Terminal initial screen state

[email protected] ~% (example)

Enter 2.ps

root directory

[email protected] ~ %ps


[email protected] ~ .ssh %ps


[[email protected] ~]$ ps

3. Confirm that PID (Process ID) is displayed

If you type ps, you will see a screen like the one below. Screenshots 2020-06-30 1.07.29.png

4. Delete PID (process ID) with killorkill -9 (I have an error in the ec2-user state, so I will write an example in the ec2-user state)

[[email protected] ~]$ kill PID number or kill -9 PID number
[Example of input ~] $ kill *** or kill -9 *** (*** = PID)

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

5.If the PID (process ID) can be erased, operation is possible without problems

**In my case, I couldn’t erase PID (Process ID) by this procedure. The problem that was actually occurring was that the PID (process ID) was erased indefinitely even if it was deleted. **

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

Here is the main issue! It’s an endless 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. Or, set to .ssh % state or [[email protected]]$. **


[[email protected] ~]$ (example)

I happened within ec2-user, so I’ll continue with the above state.

2.Enter ps l


[[email protected] ~]$ ps l

3. Check the execution status of each process You should see a screen like the one below Screenshots 2020-06-30 0.29.24.png

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

Put a detailed screen Screenshots 2020-06-30 0.29.35.png

kill way

[[email protected] ~]$ kill PID number or kill -9 PID number
[Example of input ~] $ kill *** or kill -9 *** (*** = PID)

**5. Since the process ID (PID) that proliferates infinitely has been deleted, it is possible to input it safely! **


The types of ps commands are described in the ps command collection below. If you are interested please check it out! ps command collection


With the above, I would like to finish the explanation of the method of erasing the process ID (PID) that cannot be erased (process ID infinite proliferation). If you have any mistakes, please point me out.

Thank you for visiting our website.