Bug 538408 - RFE: automounter to dump maps
Summary: RFE: automounter to dump maps
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: autofs
Version: 5.4
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Ian Kent
QA Contact: Jian Li
URL:
Whiteboard:
Depends On:
Blocks: 704416 732334
TreeView+ depends on / blocked
 
Reported: 2009-11-18 13:54 UTC by Ondrej Valousek
Modified: 2014-03-04 00:06 UTC (History)
6 users (show)

Fixed In Version: autofs-5.0.1-0.rc2.156.el5
Doc Type: Enhancement
Doc Text:
Clone Of:
: 704416 (view as bug list)
Environment:
Last Closed: 2011-07-21 08:42:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
proposed patch implementing the functionality (5.93 KB, patch)
2010-01-15 11:06 UTC, Ondrej Valousek
ondrejv: review?
Details | Diff
Patch - add dump maps option (9.19 KB, patch)
2010-07-15 06:08 UTC, Ian Kent
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1079 0 normal SHIPPED_LIVE autofs bug fix and enhancement update 2011-07-21 08:37:25 UTC

Description Ondrej Valousek 2009-11-18 13:54:39 UTC
Description of problem:
To help administrators using maps stored in LDAP repository, it would be good if  automounter could (when asked) dump all maps it is using. This could be achieved either via an extra switch (like --dumpmaps in v4) or a separate utility using autofs internals.

Version-Release number of selected component (if applicable):
all

How reproducible:
always

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Ian Kent 2009-11-25 02:31:00 UTC
At this stage I don't think I'll have time to do this
for RHEL-5.5, so I have to defer to 5.6.

Comment 2 Ondrej Valousek 2010-01-15 11:06:15 UTC
Created attachment 384571 [details]
proposed patch implementing the functionality

Attached a patch against autofs-5.0.1-0.rc2.131.el5_4.1 which implements the requested functionality.

Tested with file/nis/ldap maps (but should work with all map types).

It works fine, but a brief review is needed.

Ondrej

Comment 3 Ian Kent 2010-07-15 06:06:27 UTC
I've changed this patch a fair bit.
Can you try this build and let me know what you think
of it.

You can find it at:
http://people.redhat.com/~ikent/autofs-5.0.1-0.rc2.145.bz538408.1.el5

Comment 4 Ian Kent 2010-07-15 06:08:44 UTC
Created attachment 431974 [details]
Patch - add dump maps option

Comment 5 Ondrej Valousek 2010-07-15 09:50:56 UTC
Looks good to me, but:
1. We should be able to run automount -m even if the regular automount daemon has already been launched. I guess this:
        if (is_automount_running() > 0 && !dumpmaps) {
                fprintf(stderr, "%s: program is already running.\n",
...
would handle it.
2. Key value (me->mapent) might be NULL:
           printf("  %s | %s\n", me->key, me->mapent);
   I know printf prints (null) in this case, but I guess we might handle it better way.

But otherwise it looks perfect.

Comment 6 Ian Kent 2010-07-15 11:30:04 UTC
(In reply to comment #5)
> Looks good to me, but:
> 1. We should be able to run automount -m even if the regular automount daemon
> has already been launched. I guess this:
>         if (is_automount_running() > 0 && !dumpmaps) {
>                 fprintf(stderr, "%s: program is already running.\n",
> ...
> would handle it.

Yeah, will fix.

> 2. Key value (me->mapent) might be NULL:
>            printf("  %s | %s\n", me->key, me->mapent);
>    I know printf prints (null) in this case, but I guess we might handle it
> better way.

Mmmm ... OK, I'll have to think about that one.

> 
> But otherwise it looks perfect.    

Great, sorry to take so long to get back to it.
Ian

Comment 8 RHEL Program Management 2010-08-09 18:28:58 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 10 RHEL Program Management 2011-01-11 20:43:41 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 11 RHEL Program Management 2011-01-11 22:16:28 UTC
This request was erroneously denied for the current release of
Red Hat Enterprise Linux.  The error has been fixed and this
request has been re-proposed for the current release.

Comment 12 yanfu,wang 2011-01-26 06:51:05 UTC
hi Ian,
do you have any reproducer for this bug? thanks.

Comment 13 Ian Kent 2011-01-26 15:23:04 UTC
(In reply to comment #12)
> hi Ian,
> do you have any reproducer for this bug? thanks.

This is a request for an enhancement, to be able to list the
maps automount sees to the screen, not a bug so there is
nothing to reproduce. The only thing we need to do is ensure
that the customer is happy with the output we produce, which
he is, and that it functions correctly.

Comment 15 Jian Li 2011-05-11 06:26:21 UTC
(In reply to comment #6)
Hi Ian, I tested this bug in autofs-5.0.1-0.rc2.155.el5, and found that:
 a) "-m" option could dump map infos(tested with files/ldap map), but
 b) the two problems listed in comment 5 remain. 

For the 2nd problem, test output is as follow:
==============================================
Mount point: /net

source(s):

  type: hosts

  hp-xw6400-02.lab.bos.redhat.com | (null)
==============================================

> (In reply to comment #5)
> > Looks good to me, but:
> > 1. We should be able to run automount -m even if the regular automount daemon
> > has already been launched. I guess this:
> >         if (is_automount_running() > 0 && !dumpmaps) {
> >                 fprintf(stderr, "%s: program is already running.\n",
> > ...
> > would handle it.
> 
> Yeah, will fix.
> 
> > 2. Key value (me->mapent) might be NULL:
> >            printf("  %s | %s\n", me->key, me->mapent);
> >    I know printf prints (null) in this case, but I guess we might handle it
> > better way.
> 
> Mmmm ... OK, I'll have to think about that one.
> 
> > 
> > But otherwise it looks perfect.    
> 
> Great, sorry to take so long to get back to it.
> Ian

Comment 16 Ian Kent 2011-05-11 12:43:18 UTC
(In reply to comment #15)
> (In reply to comment #6)
> Hi Ian, I tested this bug in autofs-5.0.1-0.rc2.155.el5, and found that:
>  a) "-m" option could dump map infos(tested with files/ldap map), but
>  b) the two problems listed in comment 5 remain. 

Oops!
Sorry about that.

Comment 17 Jian Li 2011-05-13 02:52:17 UTC
So, could we verify this bug? Because the function to dump maps is implemented.

Comment 18 Ian Kent 2011-05-13 04:02:01 UTC
(In reply to comment #5)
> Looks good to me, but:
> 1. We should be able to run automount -m even if the regular automount daemon
> has already been launched. I guess this:
>         if (is_automount_running() > 0 && !dumpmaps) {
>                 fprintf(stderr, "%s: program is already running.\n",
> ...

Umm ... yes, upstream handles this differently.

> would handle it.
> 2. Key value (me->mapent) might be NULL:
>            printf("  %s | %s\n", me->key, me->mapent);
>    I know printf prints (null) in this case, but I guess we might handle it
> better way.

Not sure about this, since it should be rare because these
maps are coming from the server not the cache that is currently
in use by the daemon. I'd rather leave it as it is for the moment.

Comment 19 Jian Li 2011-05-17 02:36:12 UTC
I tested this bug again, the result accord with comment 18.
Test output is as follows ( ldap, direct, net, and generic map are covered ):

[root@amd-ma78gm-03 ~]# rpm -q autofs
autofs-5.0.1-0.rc2.156.el5
[root@amd-ma78gm-03 ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 5.7 Beta (Tikanga)
[root@amd-ma78gm-03 ~]# service autofs status
automount (pid 6951) is running...
[root@amd-ma78gm-03 ~]# automount -m

autofs dump map information
===========================

global options: none configured

Mount point: /misc

source(s):

  instance type(s): file 
  map: /etc/auto.misc

  cd | -fstype=iso9660,ro,nosuid,nodev	:/dev/cdrom


Mount point: /net

source(s):

  type: hosts

  amd-ma78gm-03.rhts.eng.bos.redhat.com | (null)
============snip

Mount point: /test

source(s):

  type: ldap
  map: ldap:ou=auto.home,dc=my-domain,dc=com

  no keys found in map


Mount point: /-

source(s):

  instance type(s): file 
  map: /etc/auto.other
============snip

Comment 20 errata-xmlrpc 2011-07-21 08:42:57 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-1079.html

Comment 21 errata-xmlrpc 2011-07-21 12:31:05 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-1079.html


Note You need to log in before you can comment on or make changes to this bug.