File Locked
I was trying to modify my hosts file and lost my connection. Since regaining my connection I am getting an edit: error: the file is already locked by another user//hosts root /dev/ttyp51
I've never encountered this before and wanted to know what command would clear this.. Thanks! Smight |
I think a reboot could help :)
|
Does the problem happen when you try to edit the file? What editor are you using?
|
Vi
I am using VI..
vi hosts edit: error: the file etc.. etc.. Hope this helps.. I would assume there would be a simple command to release this. A reboot sounds painful.. Thanks Smight |
If you lost your connection, I think the machine still "thinks" you are still logged in.
Maybe there is a timeout or something when it understands you aren't logged in anymore. I think thats the problem. |
what does 'ps aux' report?
Try killing the other vi. Show no mercy with that process. |
Solution
Terminating that remote terminal fixed the issue.. Thanks for the help..
Smight |
If there is a vi process already running, try killing that. Also you could try removing the *.swp file that vi creates when you are editing a file.
|
Just for future reference where is that .swp file contained and by what process ( command ) would I remove it?
|
alrighty.. Apparently that did not work.. I am still unable to unlock this file and edit it. I can view it but it is read only, which does me absolutely no good..
#vi hosts New file: hosts edit: error: the file is already locked by another user //hosts root /dev/ttyp51 04/24/06,09:24:34 ps -aux root shows no VI process running there is vhand however and it has an unassigned ttyp Would it be safe to assume if the connection is lost and the ttyp is cleared that this pid I am searching for will most likely not have an associated ttyp number? Thanks!! Smight |
In vi, you can write to a file even if its read only by using w!. Have you tried using a different editor?
|
All times are GMT -5. The time now is 03:54 AM. |