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:
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.
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
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
Created attachment 431974 [details] Patch - add dump maps option
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.
(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
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.
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.
hi Ian, do you have any reproducer for this bug? thanks.
(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.
(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
(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.
So, could we verify this bug? Because the function to dump maps is implemented.
(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.
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
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