** $ 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 [ec2-user@ip-xx-x-x-xxx] $
, 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. Change to the root directory in the terminal. Alternatively, set it to the state of .ssh%
or [ec2-user@ip-xx-x-x-xxx] $
. ** **
Terminal initial screen state
xxxxxxxxx@xxxxxxxxxxMacBook-xxx ~ % (Is an example)
** 2. Enter ps **
Root directory
xxxxxxxxx@xxxxxxxxxxMacBook-xxx ~ % ps
.ssh
xxxxxxxxx@xxxxxxxxxxMacBook-xxx ~ .ssh % ps
ec2-use
[ec2-user@ip-xx-xx-xx-xxx ~]$ ps
** 3. Confirm that the PID (process ID) is displayed **
Enter
ps
and you should see a screen like the one below.
** 4. Delete the PID (process ID) with killʻor
kill -9` **
(Since an error occurred in the ec2-user state, I will describe a description example in the ec2-user state)
[ec2-user@ip-xx-xx-xx-xxx ~]$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. ** **
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 [ec2-user@ip-xx-x-x-xxx] $
. ** **
ec2-use
[ec2-user@ip-xx-xx-xx-xxx ~]$(Example)
I happened inside ec2-user, so I'll continue with the above state.
** 2. Enter ps l
**
ec2-use
[ec2-user@ip-xx-xx-xx-xxx ~]$ ps l
** 3. Check the execution status of each process ** You should see a screen like the one below
** 4. Delete the PID (process ID) of wait_w
in the column of WCHAN
with kill
**
I will post the details screen
kill method
[ec2-user@ip-xx-xx-xx-xxx ~]$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! ** **
The types of ps commands are listed in the ps command collection
below.
If you are interested, please have a look!
** ps command collection **
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