sudo file
I was exploring the sudo file (fedora16) in visudo and accidently deleted a couple of lines. Now I get this when I open visudo;
E325: ATTENTION Found a swap file by the name "/etc/.sudoers.tmp.swp" owned by: root dated: Tue Oct 9 20:49:35 2012 file name: /etc/sudoers.tmp modified: YES user name: root host name: laptopredhat process ID: 11679 While opening file "/etc/sudoers.tmp" dated: Tue Nov 30 06:13:58 2010 (1) Another program may be editing the same file. If this is the case, be careful not to end up with two different instances of the same file when making changes. Quit, or continue with caution. (2) An edit session for this file crashed. If this is the case, use ":recover" or "vim -r /etc/sudoers.tmp" to recover the changes (see ":help recovery"). If you did this already, delete the swap file "/etc/.sudoers.tmp.swp" to avoid this message. "/etc/sudoers.tmp" 97L, 3338C Press ENTER or type command to continue... Any ideas how i reslove this? |
Well, the error is quite explaining the situation. Either you are editing the sudoers file with two editors, or a visudo session didn't complete sucessfully. If you are absolutely confident that your sudoers file is ok, you could delete the .tmp.swp file. If you think you should recover, do as suggested.
|
It sounds like visudo crashed. I believe that /etc/sudoers.tmp is a lockfile that is also used as a temporary file to ensure the contents you enter are valid (before copying them to /etc/sudoers). I think it is safe to delete. I would first make a backup of both /etc/sudoers and /etc/sudoers.tmp (just in case), then delete /etc/sudoers.tmp and /etc/.sudoers.tmp.swp and then try running visudo again.
Hope this helps, |
what are the commands to delete the swap file?
|
Code:
$ man rm |
man rm /ect/.sudoers.tmp.swp
Is that correct? |
Code:
man rm Code:
$ rm /ect/.sudoers.tmp.swp |
[timmytim@laptopredhat ~]$ rm /ect/.sudoers.tmp.swp
rm: cannot remove `/ect/.sudoers.tmp.swp': No such file or directory |
How about /etc/sudoers.tmp ?
|
rm -f /etc/.sudoers.tmp.swp was the ticket all is well now
|
All times are GMT -5. The time now is 05:29 AM. |