Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm migrating from NISPLUS to LDAP (openldap) and from RHEL4 to RHEL5. The LDAP server is running on RHEL5u4 as are the clients. On RHEL5 variable expansion in auto.master never works, whether in files or LDAP.

NISPLUS/RHEL4 (works)

I used to have a whole load of tables in nisplus along the lines of auto_opt_Linux_2-6-18_x86_64 containing shares of programs for that particular arch/os combo.

EG. in auto_opt_Linux_2-6-18_x86_64 in NISPLUS:

vim-7.3        nfs:/export/apps/Linux/2.6.18/opt-i386/&
boost-1.4.0    nfs:/export/apps/Linux/2.6.18/opt-x86_64/&
etc

I then have in auto_master in NISPLUS:

/opt           auto_opt_${OSNAME}_${OSREL}_${ARCH}
/home          auto_home
/workgrp       auto_workgrp

In auto.master in /etc on the clients:

+auto_master

I then have UNDERSCORETODOT="1" in /etc/sysconfig/autofs and automount will happily pull everything out of NISPLUS.

LDAP/RHEL5 (almost works)

I tried to do the same in LDAP, the home and workgrp shares work fine but the /opt, not so much:

dn: ou=auto.master,dc=example,dc=com
objectClass: automountMap
objectClass: top
ou: auto.master

dn: cn=/opt,ou=auto.master,dc=example,dc=com
objectClass: automount
cn: /opt
automountInformation: auto.opt.$OSNAME.$OSREL.$ARCH

dc: ou=auto.opt.Linux.2.6.18-164.el5.x86_64,dc=example,dc=com
objectClass: automountMap
objectClass: top
ou: auto.opt.Linux.2.6.18-164.el5.x86_64

dc: cn=vim-7.3,ou=auto.opt.Linux.2.6.18-164.el5.x86_64,dc=example,dc=com
objectClass: automount
cn: vim-7.3
automountInformation: nfs:/export/apps/Linux/2.6.18/opt-i386/&

Running automount -fd says:

get_query_dn: lookup(ldap): query succeeded, no matches for (&(objectclass=nisMap)(nisMapName=auto.opt.$OSNAME.$OSREL.$OSARCH))
get_query_dn: lookup(ldap): query succeeded, no matches for (&(objectclass=automountMap)(ou=auto.opt.$OSNAME.$OSREL.$OSARCH))
get_query_dn: lookup(ldap): query succeeded, no matches for (&(objectclass=automountMap)(autoMountMapName=auto.opt.$OSNAME.$OSREL.$OSARCH))

By disabling encryption and watching the client in wireshark, I check actually what queries are being run and it is searching for auto.opt.$OSNAME.$OSREL.$ARCH without expanding the variables.

I've tried running automount -fd -D OSNAME=Linux and this had no effect. I've also tried putting all of this in flat files (not LDAP or nisplus but this didn't help).

What do work are mounts along the lines of:

boost-1.40.0       nfs:/export/apps/Linux/2.6.18/opt-${ARCH}/&

(in LDAP or flat files)

This would be fine except for when the same library or app works on multiple platforms, for example we don't particularly need a 64bit version of vim and I don't what to have a copy of vim-7.3 for every kernel as the RHEL4 one works on everything from 4u2 to 6u0!

man 5 autofs suggests that substitution should work in both the key and locations part of an automount map so I'm not imagining this ( http://www.squarebox.co.uk/cgi-squarebox/manServer/autofs.5 ).

Anyone got any ideas? Is autofs just broken on RHEL5?

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.