[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trying to solve file lock problem with /etc/sudoers

From: Thomas Schwinge
Subject: Re: Trying to solve file lock problem with /etc/sudoers
Date: Tue, 11 Mar 2014 10:29:11 +0100
User-agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/23.4.1 (i486-pc-linux-gnu)


On Tue, 11 Mar 2014 02:44:36 -0500, Peter Baumgarten <me@peter-baumgarten.com> 
> I'm trying to be a hurd developer by jumping straight in and trying to
> tackle a bug.

So, welcome to the team!  :-)

> This may not be a hurd bug, but I only see it with the
> hurd version of sudo. I am trying to figure out why I get this message
> "visudo: /etc/sudoers busy, try again later" when I run visudo as root.

It's always a good idea to first look which issues already are known.
<http://www.gnu.org/software/hurd/contributing/web_pages.html>, *Working
on a Checkout of the Git Repository*, *Getting the Sources*:

    $ git clone git://git.savannah.gnu.org/hurd/web.git
    $ cd web/
    $ git grep -C3 sudoers
    open_issues/visudo.mdwn-is included in the section entitled [[GNU Free 
    open_issues/visudo.mdwn:[[!meta title="visudo: /etc/sudoers is busy, try 
again later"]]
    open_issues/visudo.mdwn-[[!tag open_issue_hurd]]
    open_issues/visudo.mdwn-visudo does not work:
    open_issues/visudo.mdwn:    /etc/sudoers is busy, try again later
    open_issues/visudo.mdwn-Apparently there is some locking that sudo does 
which does not
    open_issues/visudo.mdwn-work. Uninvestigated for now.
    open_issues/visudo.mdwn:One can just edit the /etc/sudoers file and take 
care of correctness by hand.

(Alternatively, use the seach box on the upper right of

So, the issue already is known,
<http://www.gnu.org/software/hurd/open_issues/visudo.html>.  ... but that
page doesn't tell what's going on.

> I suspect something has a file lock on /etc/sudoers. I would normally
> use lsof to see what processes have a lock on a file, but apparently
> lsof is not available for hurd. When I say not available I mean not
> installed by default on the debian hurd qemu image and not available in
> the debian hurd repos. Does anyone know what tools are available to me
> to see what has a lock on file or what processes are using a file on?

    $ git grep lsof
    hurd/debugging.mdwn:    <braunr> but something that would be reusable in 
    hurd/debugging.mdwn:      because you used lsof right ?
    hurd/debugging.mdwn:    <teythoon> ah, well, ok, but if we put it in the 
signal thread, then lsof
    hurd/translator/term.mdwn:    <braunr> (see why we need a global lsof :p)
    open_issues/lsof.mdwn:We don't have a `lsof` tool.  Perhaps we could cook 
something with having a
    open_issues/lsof.mdwn:    <braunr> basically, lsof
    open_issues/lsof.mdwn:    <braunr> lsof and pmap and two tools we really 
lack on the hurd

Indeed we don't have lsof.  If hitting such a (presumed) bug on a
Linux-based system, I probably first would use strace to figure out what
exactly visudo is doing.  Another web pages search, for strace, leads to
<http://www.gnu.org/software/hurd/hurd/debugging/rpctrace.html>, so
rpctrace is the tool to use on a Hurd system, in parallel with looking
into visudo's source code.  (As rpctrace will show RPCs, you'd have to
trace back which (glibc) library function calls these are being done for.
For some more context, see
<http://www.gnu.org/software/hurd/hurd/rpc.html> and, for example, the
text I recently wrote on
for how this works on a Hurd system.)

And yes, there indeed are issues with file (record) locking on Hurd, in
particular the lockf interface:

    $ git grep lockf\\\>
    community/gsoc/project_ideas/file_locking.mdwn:them. The biggest missing 
feature is record locking, i.e. the lockf variant,
    open_issues/file_locking.mdwn:    <youpi> (which is independant from lockf 
from the locking point of view,

So, if you can confirm that visudo is using lockf (or something else that
is not yet supported), you can already note that on the
open_issues/visudo page (either web interface, or send a patch;
<http://www.gnu.org/software/hurd/contributing/web_pages.html>), and then
it seems you'd have to work on completing the file locking interfaces.

You don't happen to be a student willing to do this as a Google Summer of
Code project?  :-)


Attachment: pgpmmXj8hc7ML.pgp
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]