visudo: /usr/local/etc/sudoers busy, try again later

I have several hosts running FreeBSD 7.0-RELEASE-p6. security/sudo was installed when installing FreeBSD using sysinstall.

When I run visudo as root, it works on some hosts and on some I get:

Code:
visudo: /usr/local/etc/sudoers busy, try again later

The visudo(8) manpage says about this error: "Someone else is currently editing the sudoers file." But I am absoluteley sure that nobody else is currently editing this file. I also know that I used visudo successfully on one of this hosts.

I tried to re-install sudo ( pkg_deinstall sudo + portinstall sudo) but this won't change anything.

Does anybody have a clue what could be the reason for the mentioned error?

Thanks in advance
--Markus
 
Last edited by a moderator:
If you're absolutely sure no others are running try rm /usr/local/etc/sudoers.tmp.
 
Thanks for answering, ale.

/var/tmp/vi.recover/ is empty...
 
Last edited by a moderator:
It shows:
Code:
USER     CMD          PID   FD MOUNT      INUM MODE         SZ|DV R/W NAME

Nothing more ...
 
Sheesh. Well then, the lock file should be there somewhere.

Run:
# /etc/periodic/weekly/310.locate

Followed by:
# locate sudoers

See the lock (.tmp) file now? If so, delete it.

If not, you'll need to trace visudo as suggested...
 
Last edited by a moderator:
Thanks anomie, but I still can't see the sudoers.tmp.

I'll look into using ktrace and see what I can find out ...
 
Some other "thing": I look at this and wonder
Code:
ls -al /usr/local/sbin/visudo
-rwxr-xr-x 1 root  wheel  180768 22 Jul 16:39 /usr/local/sbin/visud

That it is world-readable and world-executable.
 
Some other "thing": I look at this and wonder
Code:
ls -al /usr/local/sbin/visudo
-rwxr-xr-x 1 root  wheel  180768 22 Jul 16:39 /usr/local/sbin/visud

that it is world-readable and world-executable.

That's not anything unusual, those are the standard permission on any executable that is meant to be run by any user on the system. Access to sudo(8) is controlled by /usr/local/etc/sudoers file and visudo(8) just calls sudoedit(8) on the sudoers file for editing it. There is no loophole to get around the restrictions in sudoers even if visudo binary is world readable/executable.
 
Back
Top