some questions about the configuration
I recently started to clean-up the mandriva autofs package a bit, and I have some questions about the default configuration handling.
First, it seems autofs-ldap-auto-master, which is installed in /usr/lib/autofs, and auto.{net,smb}, which are installed in /etc, have exactly the same purpose: to automatically produce a list of available mount points from a remote host. If I am right, why are them installed and named differently ? Apart the fact that the first one is native code, whereas the others are shell scripts, they could as well get installed as /usr/lib/autofs/auto.{ldap,smb,net}
Second, it's not clear why ldap and nis use are triggered from the content of /etc/nsswitch.conf, while smb and net (simple rpcinfo listing) use are triggered from content of /etc/auto.master. Shouldn't all those syntax be available from both locations?
Signature · 2 lines
Adultery is the application of democracy to love -- H.L. Mencken on Murphy n°2
Ian Kent
maintainerQuoted 10 lines · Guillaume Rousse
I recently started to clean-up the mandriva autofs package a bit, and I have some questions about the default configuration handling.
First, it seems autofs-ldap-auto-master, which is installed in
/usr/lib/autofs, and auto.{net,smb}, which are installed in /etc, have exactly the same purpose: to automatically produce a list of available mount points from a remote host. If I am right, why are them installed and named differently ? Apart the fact that the first one is native code, whereas the others are shell scripts, they could as well get installed as/usr/lib/autofs/auto.{ldap,smb,net}
the autofs-ldap-auto-master reads the master map from an ldap server. Only the master map.
All the things in /usr/lib/autofs are system things, internal, whereas things in the map directory, often /etc are the user maps. The example program maps auto.smb and auto.net are, well, examples. Given a key they return the entry for it. Neither returns master map entries.
The master map and the maps that are contained in the master map have a different syntax.
Quoted 5 lines
Second, it's not clear why ldap and nis use are triggered from the content of
/etc/nsswitch.conf, while smb and net (simple rpcinfo listing) use are triggered from content of/etc/auto.master. Shouldn't all those syntax be available from both locations?
Master vs client maps again.
Ian
Quoted 15 lines · Ian Kent
Quoted 10 lines · Guillaume Rousse
I recently started to clean-up the mandriva autofs package a bit, and I have some questions about the default configuration handling.
First, it seems autofs-ldap-auto-master, which is installed in
/usr/lib/autofs, and auto.{net,smb}, which are installed in /etc, have exactly the same purpose: to automatically produce a list of available mount points from a remote host. If I am right, why are them installed and named differently ? Apart the fact that the first one is native code, whereas the others are shell scripts, they could as well get installed as/usr/lib/autofs/auto.{ldap,smb,net}
Quoted 7 lines
the autofs-ldap-auto-master reads the master map from an ldap server. Only the master map.
All the things in
/usr/lib/autofsare system things, internal, whereas things in the map directory, often /etc are the user maps. The example program maps auto.smb and auto.net are, well, examples. Given a key they return the entry for it. Neither returns master map entries.
OK, I understand they have different nature, so they can't have the exact same naming scheme. But if auto.smb and auto.smb are exemple, they should not get installed, and especially not among configuration files whereas they are executables programs.
I'd rather have called ldap.master.map, smb.user.map and net.user.map, or something similar, and have them installed in the same place.
Quoted 11 lines
The master map and the maps that are contained in the master map have a different syntax.
Quoted 4 lines
Second, it's not clear why ldap and nis use are triggered from the content of
/etc/nsswitch.conf, while smb and net (simple rpcinfo listing) use are triggered from content of/etc/auto.master. Shouldn't all those syntax be available from both locations?Master vs client maps again.
According to my init script understanding, however, it seems you can't refer to LDAP user maps from /etc/auto.master, whereas you can refer to NIS user maps from there, using a syntax such as '+foobar', which is not documented in auto.master man page.
Signature · 2 lines
The more work you have to get done, the more likely it is to rain. -- Precipitation Precepts n°1
==> Regarding Re: [autofs] some questions about the configuration; Guillaume Rousse <[email protected]> adds:
Quoted 15 lines · Guillaume.Rousse> Ian Kent wrote:
Quoted 15 lines · Guillaume Rousse
Quoted 12 lines
I recently started to clean-up the mandriva autofs package a bit, and I have some questions about the default configuration handling.
First, it seems autofs-ldap-auto-master, which is installed in
/usr/lib/autofs, and auto.{net,smb}, which are installed in /etc, have exactly the same purpose: to automatically produce a list of available mount points from a remote host. If I am right, why are them installed and named differently ? Apart the fact that the first one is native code, whereas the others are shell scripts, they could as well get installed as/usr/lib/autofs/auto.{ldap,smb,net}
Quoted 7 lines
Quoted 7 lines
the autofs-ldap-auto-master reads the master map from an ldap server. Only the master map.
All the things in
/usr/lib/autofsare system things, internal, whereas things in the map directory, often /etc are the user maps. The example program maps auto.smb and auto.net are, well, examples. Given a key they return the entry for it. Neither returns master map entries.
Guillaume.Rousse> OK, I understand they have different nature, so they Guillaume.Rousse> can't have the exact same naming scheme. But if auto.smb Guillaume.Rousse> and auto.smb are exemple, they should not get installed, Guillaume.Rousse> and especially not among configuration files whereas they Guillaume.Rousse> are executables programs.
Guillaume.Rousse> I'd rather have called ldap.master.map, smb.user.map and Guillaume.Rousse> net.user.map, or something similar, and have them Guillaume.Rousse> installed in the same place.
You can modify auto.net or auto.smb to suit your needs. In that sense, they are user-configurable automounter maps, and belong with the other maps. I understand that autofs configuration is a bit overwhelming, and the documentation is lacking. Perhaps we should focus on improving the documentation.
Quoted 11 lines
Quoted 11 lines
The master map and the maps that are contained in the master map have a different syntax.
Quoted 4 lines
Second, it's not clear why ldap and nis use are triggered from the content of
/etc/nsswitch.conf, while smb and net (simple rpcinfo listing) use are triggered from content of/etc/auto.master. Shouldn't all those syntax be available from both locations?Master vs client maps again.
Guillaume.Rousse> According to my init script understanding, however, it Guillaume.Rousse> seems you can't refer to LDAP user maps from Guillaume.Rousse> /etc/auto.master, whereas you can refer to NIS user maps Guillaume.Rousse> from there, using a syntax such as '+foobar', which is Guillaume.Rousse> not documented in auto.master man page.
Your understanding is wholly incorrect. The following web sites are good references that I use frequently. I hope they are helpful to you.
http://docs.sun.com/app/docs/doc/805-3479/6j3agk1v5?q=autofs&a=view
http://docs.sun.com/app/docs/doc/816-0211/6m6nc66nc?a=view
http://www.ldapguru.com/modules/newbb/viewtopic.php?topic_id=2029&forum=6
Regards,
Jeff
Quoted 10 lines · Jeff Moyer
Guillaume.Rousse> OK, I understand they have different nature, so they Guillaume.Rousse> can't have the exact same naming scheme. But if auto.smb Guillaume.Rousse> and auto.smb are exemple, they should not get installed, Guillaume.Rousse> and especially not among configuration files whereas they Guillaume.Rousse> are executables programs.
Guillaume.Rousse> I'd rather have called ldap.master.map, smb.user.map and Guillaume.Rousse> net.user.map, or something similar, and have them Guillaume.Rousse> installed in the same place.
Quoted 5 lines
You can modify auto.net or auto.smb to suit your needs. In that sense, they are user-configurable automounter maps, and belong with the other maps. I understand that autofs configuration is a bit overwhelming, and the documentation is lacking. Perhaps we should focus on improving the documentation.
This does still look like a poor hack: if they are supposed to be adaptable to specific user needs, they should use a configuration file. And if the not flexible enough, be kept as exemples in congifuration, not installed by default (especially if not automatically used).
And yes, documentation could get improved :)
Quoted 19 lines
Quoted 5 lines
Quoted 5 lines
The master map and the maps that are contained in the master map have a different syntax.
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
Second, it's not clear why ldap and nis use are triggered from the content of
/etc/nsswitch.conf, while smb and net (simple rpcinfo listing) use are triggered from content of/etc/auto.master. Shouldn't all those syntax be available from both locations?Master vs client maps again.
Guillaume.Rousse> According to my init script understanding, however, it Guillaume.Rousse> seems you can't refer to LDAP user maps from Guillaume.Rousse>
/etc/auto.master, whereas you can refer to NIS user maps Guillaume.Rousse> from there, using a syntax such as '+foobar', which is Guillaume.Rousse> not documented in auto.master man page.
Quoted 6 lines
Your understanding is wholly incorrect. The following web sites are good references that I use frequently. I hope they are helpful to you.
http://docs.sun.com/app/docs/doc/805-3479/6j3agk1v5?q=autofs&a=view
http://docs.sun.com/app/docs/doc/816-0211/6m6nc66nc?a=view
http://www.ldapguru.com/modules/newbb/viewtopic.php?topic_id=2029&forum=6
Thanks for the explanation, I understand better. Let me rephrase:
- it is possible to refer to additional NIS master map from /etc/auto.master, using a syntax not described in auto.master man page.
- it is not possible to do the same with ldap
Is this more correct ?
BTW, the default init script is quite ugly, it calls catnismap with each additional NIS master map each time a line is found beginning with '+'.
I'd suggest instead something as:
if [ -f /etc/auto.master ] ; then
awk '/^[^#]/{print $0}' /etc/auto.master | (
while read line
do
if [[ "$line" == +* ]]; then
catnismap ${line:1}
else
echo $line
fi
done
)fi
It uses bash-specific constructs, but this is a bash script after all.
Signature · 2 lines
After assembly, it will always be observed that the gasket is on the bench -- Assembly General Shefields Corollaries n°4
==> Regarding Re: [autofs] some questions about the configuration; Guillaume Rousse <[email protected]> adds:
Guillaume.Rousse> Jeff Moyer wrote: OK, I understand they have different Guillaume.Rousse> nature, so they can't have the exact same naming Guillaume.Rousse> scheme. But if auto.smb and auto.smb are exemple, they Guillaume.Rousse> should not get installed, and especially not among Guillaume.Rousse> configuration files whereas they are executables Guillaume.Rousse> programs.
Quoted 1 line
Quoted 1 line
Guillaume.Rousse> I'd rather have called ldap.master.map, smb.user.map and Guillaume.Rousse> net.user.map, or something similar, and have them Guillaume.Rousse> installed in the same place.
Quoted 5 lines
Quoted 5 lines
You can modify auto.net or auto.smb to suit your needs. In that sense, they are user-configurable automounter maps, and belong with the other maps. I understand that autofs configuration is a bit overwhelming, and the documentation is lacking. Perhaps we should focus on improving the documentation.
Guillaume.Rousse> This does still look like a poor hack: if they are Guillaume.Rousse> supposed to be adaptable to specific user needs, they Guillaume.Rousse> should use a configuration file. And if the not flexible Guillaume.Rousse> enough, be kept as exemples in congifuration, not Guillaume.Rousse> installed by default (especially if not automatically Guillaume.Rousse> used).
This is an opinion that I do not share. /net is configured by default, and so the auto.net map is used by default. Additionally, supporting program maps makes the automounter quite a bit more flexible that it would otherwise be.
Guillaume.Rousse> And yes, documentation could get improved :)
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
The master map and the maps that are contained in the master map have a different syntax.
Quoted 5 lines
Second, it's not clear why ldap and nis use are triggered from the content of
/etc/nsswitch.conf, while smb and net (simple rpcinfo listing) use are triggered from content of/etc/auto.master. Shouldn't all those syntax be available from both locations?
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
Quoted 1 line
Master vs client maps again.
Guillaume.Rousse> According to my init script understanding, however, it Guillaume.Rousse> seems you can't refer to LDAP user maps from Guillaume.Rousse> /etc/auto.master, whereas you can refer to NIS user maps Guillaume.Rousse> from there, using a syntax such as '+foobar', which is Guillaume.Rousse> not documented in auto.master man page.
Quoted 6 lines
Quoted 6 lines
Your understanding is wholly incorrect. The following web sites are good references that I use frequently. I hope they are helpful to you.
http://docs.sun.com/app/docs/doc/805-3479/6j3agk1v5?q=autofs&a=view
http://docs.sun.com/app/docs/doc/816-0211/6m6nc66nc?a=view
http://www.ldapguru.com/modules/newbb/viewtopic.php?topic_id=2029&forum=6
Guillaume.Rousse> Thanks for the explanation, I understand better. Let me Guillaume.Rousse> rephrase: - it is possible to refer to additional NIS Guillaume.Rousse> master map from /etc/auto.master, using a syntax not Guillaume.Rousse> described in auto.master man page. - it is not possible Guillaume.Rousse> to do the same with ldap Is this more correct ?
Yes, this is correct. However, note that the way it is implemented (currently nis only) is incorrect. Any included map should be looked for in the locations as specified in /etc/nsswitch.conf. This is currently not honored. Again, we're working to address this limitation.
Guillaume.Rousse> BTW, the default init script is quite ugly, it calls Guillaume.Rousse> catnismap with each additional NIS master map each time a Guillaume.Rousse> line is found beginning with '+'.
Patches are welcome. Please use the -up options to diff.
-Jeff
Quoted 23 lines · Jeff Moyer
==> Regarding Re: [autofs] some questions about the configuration; Guillaume Rousse <[email protected]> adds:
Guillaume.Rousse> Jeff Moyer wrote: OK, I understand they have different Guillaume.Rousse> nature, so they can't have the exact same naming Guillaume.Rousse> scheme. But if auto.smb and auto.smb are exemple, they Guillaume.Rousse> should not get installed, and especially not among Guillaume.Rousse> configuration files whereas they are executables Guillaume.Rousse> programs.
Guillaume.Rousse> I'd rather have called ldap.master.map, smb.user.map and Guillaume.Rousse> net.user.map, or something similar, and have them Guillaume.Rousse> installed in the same place.Quoted 5 lines
Quoted 5 lines
You can modify auto.net or auto.smb to suit your needs. In that sense, they are user-configurable automounter maps, and belong with the other maps. I understand that autofs configuration is a bit overwhelming, and the documentation is lacking. Perhaps we should focus on improving the documentation.
Guillaume.Rousse> This does still look like a poor hack: if they are Guillaume.Rousse> supposed to be adaptable to specific user needs, they Guillaume.Rousse> should use a configuration file. And if the not flexible Guillaume.Rousse> enough, be kept as exemples in congifuration, not Guillaume.Rousse> installed by default (especially if not automatically Guillaume.Rousse> used).
Quoted 4 lines
This is an opinion that I do not share. /net is configured by default, and so the auto.net map is used by default. Additionally, supporting program maps makes the automounter quite a bit more flexible that it would otherwise be.
I never pretended the opposite. My point is that you can't label executable scripts as 'configuration' and put them under /etc, just because users could eventually modify them to suit their needs. This is not FHS compliant.
Either they work as they are (which seems the case from waht you say and from my own tests with auto.net), and they should get installed under program directory (/usr/lib/autofs), with eventually some aditional configuration file under /etc.
Either they are unfinished scripts, provided as exemples, that are meant to be customised by users, and finally installed as programs manually under local script directory (/usr/local/sbin).
[..]
Quoted 5 lines
Guillaume.Rousse> BTW, the default init script is quite ugly, it calls Guillaume.Rousse> catnismap with each additional NIS master map each time a Guillaume.Rousse> line is found beginning with '+'.
Patches are welcome. Please use the -up options to diff.
Here are two distinct patches, with a clearer syntax, less external process call, and correcting multiple call to catnismap from getfilemounts.
rc.autofs.in.new renamed from rc.autofs.in +5 -8
@@ -135,16 +135,13 @@ function catnismap() function getfilemounts() { if [ -f /etc/auto.master ] ; then - cat /etc/auto.master | awk '{print $0}' | sed -e '/^#/d' -e '/^$/d' | ( - while read auto_master_in + awk '/^[^#]/{print $0}' /etc/auto.master | ( + while read line do - if [ "`echo $auto_master_in | grep '^+'`" = "" ]; then - echo $auto_master_in + if [[ "$line" == +* ]]; then + catnismap ${line:1} else - for nismap in `cat /etc/auto.master | grep '^\+' | - sed -e '/^#/d' -e '/^$/d'`; do - catnismap `echo "$nismap" | sed -e 's/^\+//'` - done + echo $line fi done )
rc.autofs.in.new renamed from rc.autofs.in +6 -8
@@ -111,15 +111,13 @@ fi # function getschemes() { - SOURCES=`grep ^automount: /etc/nsswitch.conf | \ - sed -e 's/^.*://' -e 's/\[.*\]/ /g'` + SOURCES=`awk -F: '/^automount/{print $2}' /etc/nsswitch.conf` - if [ `echo $SOURCES | awk '{print NF}'` -gt 0 ] - then - echo ${SOURCES} - else - echo files - fi + if [ -n "${SOURCES// /}" ]; then + echo ${SOURCES} + else + echo files + fi } function catnismap()
_______________________________________________
autofs mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/autofs