Jeremy Fitzhardinge wrote:

On Sat, 2003-08-16 at 02:46, Ian Kent wrote:


This is on my list. I believe that it can be addressed by bringing the parsing of the master map into the daemon. This will enable a much more
generic init script to be written.



The approach I was thinking about was to factor all the init scripts into two parts: one set of functions for doing autofs specific things (parsing maps, starting and stopping daemons, etc), and a set of per-distro scripts which use the autofs functions to do their work. The per-distro scripts should have very little real code in them, just whatever the distro needs an init script to do.

Why would moving the map parsing into the C code make things more
generic?



Because future development of browsing capabilities and true direct mount support make maintaining C code in the daemon and shell scripts redundent and error prone.

Browsing capabilities require iteration of maps. So does proper handling of direct mounts. Direct mount parsing alone from shell scripts can quickly become tedious as you need to handle proper escaping, variables and multimounts.

If you can move all logic for doing keyed lookups and map iteration for all the name services into the daemon, then you can scrap all the shell script parsing in the initscript and re-use the components in the daemon that are known to be good.

Also, another reason for doing this is so that you can finally once and for all support /etc/nsswitch.conf logic, something that is not understood at all by any daemon/patchset that I've seen, and that is currently handled in an awkward fashion by per-distribution initscripts.

Lastly, include logic is also almost non-existent in any tarball/patchset that I've seen. Why do you want to handle this in *both* the initscript via shell scripting as well as in the daemon for map parsing in C? Include logic has different rules for mapname lookup, and should also be dependent on the nsswitch.conf settings.

These two semantical descrepencies alone cause many hardships among system administrators who wish to integrate Linux systems into a Solaris autofs domain.

Putting daemon logic directly in the initscript is a kludgy thing to do imho. Initscripts are primarily meant for 'start'ing, 'stop'ing and 'restart'ing services, not for handling daemon logic that is absent in the daemon itself.

Mike Waychison

_______________________________________________
autofs mailing list
[EMAIL PROTECTED]
http://linux.kernel.org/mailman/listinfo/autofs

Reply via email to