LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-10-2012, 07:50 AM   #1
siickboii
Member
 
Registered: May 2012
Posts: 63

Rep: Reputation: Disabled
Unhappy 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?

Last edited by siickboii; 10-10-2012 at 07:51 AM. Reason: forgot to name copy of linux
 
Old 10-10-2012, 08:08 AM   #2
segmentation_fault
Member
 
Registered: Sep 2008
Location: Ioannina, Greece
Distribution: Gentoo
Posts: 332

Rep: Reputation: 55
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.
 
Old 10-10-2012, 08:18 AM   #3
Snark1994
Senior Member
 
Registered: Sep 2010
Location: Wales, UK
Distribution: Arch
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 345Reputation: 345Reputation: 345Reputation: 345
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,
 
Old 10-10-2012, 01:32 PM   #4
siickboii
Member
 
Registered: May 2012
Posts: 63

Original Poster
Rep: Reputation: Disabled
what are the commands to delete the swap file?
 
Old 10-10-2012, 04:02 PM   #5
segmentation_fault
Member
 
Registered: Sep 2008
Location: Ioannina, Greece
Distribution: Gentoo
Posts: 332

Rep: Reputation: 55
Code:
$ man rm
 
Old 10-10-2012, 05:00 PM   #6
siickboii
Member
 
Registered: May 2012
Posts: 63

Original Poster
Rep: Reputation: Disabled
man rm /ect/.sudoers.tmp.swp
Is that correct?
 
Old 10-10-2012, 05:11 PM   #7
segmentation_fault
Member
 
Registered: Sep 2008
Location: Ioannina, Greece
Distribution: Gentoo
Posts: 332

Rep: Reputation: 55
Code:
man rm
will give you info about rm command. In your case it would be
Code:
$ rm /ect/.sudoers.tmp.swp
but also take a look at the man page.
 
Old 10-10-2012, 05:37 PM   #8
siickboii
Member
 
Registered: May 2012
Posts: 63

Original Poster
Rep: Reputation: Disabled
[timmytim@laptopredhat ~]$ rm /ect/.sudoers.tmp.swp
rm: cannot remove `/ect/.sudoers.tmp.swp': No such file or directory
 
Old 10-10-2012, 05:42 PM   #9
segmentation_fault
Member
 
Registered: Sep 2008
Location: Ioannina, Greece
Distribution: Gentoo
Posts: 332

Rep: Reputation: 55
How about /etc/sudoers.tmp ?
 
Old 10-10-2012, 06:25 PM   #10
siickboii
Member
 
Registered: May 2012
Posts: 63

Original Poster
Rep: Reputation: Disabled
rm -f /etc/.sudoers.tmp.swp was the ticket all is well now
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: The Ultimate Sudo FAQ To Sudo Or Not To Sudo? LXer Syndicated Linux News 13 04-13-2013 02:36 AM
[SOLVED] "sudo: Can't mkdir /var/run/sudo/%user%: File exists" CNBarnes Linux - Server 7 01-10-2011 05:11 PM
Modifying the sudo file kaplan71 Linux - General 3 01-28-2010 07:32 PM
not in the sudo file harbey altai Linux - Newbie 2 05-23-2008 11:45 PM
sudo file simeandrews Linux - General 1 06-24-2005 06:14 PM


All times are GMT -5. The time now is 12:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration