autofs is often used as a nice way to mount nfs shares without using any other nfs subsystem. this means that under gentoo portmap isn't started automatically for autofs. under depend, autofs should have net and portmap. the fix is rather trivial, but it is none the less a showstopper for people who don't know nfs very well.
the problem with this is that autofs can be used w/out portmap ... there are many people who do not use nfs, do not want nfs, and never want to see nfs utilities/daemons ;) a better solution might be a USE variable for NFS ... and a line like this in the autofs depend sections NFS? (depend portmap) or maybe just 2 lines in the depend section: # if you use/want nfs support with nfs, uncomment the following line #depend portmap
Well, the best way with how our rc-system works, would be: depend() { use portmap } Basically, *only* start portmap before the current (autofs) if portmap is added to the 'default', or boot runlevel. A user who then know he use nfs, will (seems logic this side) add portmap to his default runleve.
so with the current setup, you could say a script depends on something else, and if that something else doesnt exist, the script will still execute ? i thought it would fail ... not cause of having viewed the code, that just logically made sense to me ;) so in this case, autofs would still work even depending on portmap when portmap doesnt exist ?
That is the basic difference between "need" and "use" I guess. Run any rc-script without args for basic help. need: the dependency MUST be present, and started to start the service use: if the dependancy is in the boot or default runlevel, it must be started to start current, if present, but not in default/boot runlevels, the current service will be started without the dependancy in "use" line being started.
well shit learn somethin new everyday ;) i guess there is the answer then, 'use net portmap'
hm. I looked a bit at nfs-stuff under /etc/init.d on my Gentoo-boxes. I think we acutually want autofs to need (note: need) nfsmount. nfsmount will then start net and portmap (need depedencies) and start statd. which is nice to have around. as far as I can tell this would be the best solution given todays init.d-setup. the best would probably to seperate out stat.d so we wouldn't do the mount -ta coda,nfs,ncpfs,smbfs that netmount does.
Nooo, we cant have it to "need nfsmount". Not everybody even have the nfs stuff installed (me among others), and if it "need"ed it, it would never start with it missing.
is there support for the USE variable in init.d scripts ?
Ok, some personal observations... USE flags (i.e. X kde gnome etc....) in /etc/make.conf are used for BUILD/INSTALL-time dependencies. Those flags have no bearing ISFAIK on the init-scripts. The keywords 'need' and 'use' (mabye 'use' should be renamed for claity? donno..) in the contect of a 'depend() { ... }' section in an init-script (in /etc/init.d) deals with RUNTIME dependencies. There are essentially two questions that need to be answered... 1. Is there a compile-time (at emerge) difference that needs to be made in, for example, ./configure parameters to reflect the presense (or lack thereof) of NFS daemons, etc... If and only if yes, then a USE FLAG (/etc/make.conf) would be an appropriate thing to have. If not, this whole paragraph is moot. 2. Does the already-built autofs daemon NEED to have NFS daemons started before it? Seeing as it seems that it's possible (and some believe prefered) NOT to have NFS but still use autofs (eg smbfs etc..) there does not appear to be a NEED for the NFS daemons to start, BUT, if they are present they *should* be started before autofs. And that 2nd question basically defines 'need' and 'use' in the context of an init-script. If you define a dependency as 'need' and it does not exist, or fails to start, the daemon that 'need's it will not start at all (dependency failure). OTOH, if you mark it as 'use' the init-script tools will start the dependencies before the daemon, *if* they exist. If they don't exist, or fail to start, it's not the end of the world, the init-script will attempt to start the daemon anyway. Disclamer: I'm not a gentoo expert. My e-mail doesn't end in @gentoo... and I can't stand NFS :) These are just my (personal) observations, and will gladly stand corrected by a dev if I'm wrong.
some suggestions exist at that bug report *** This bug has been marked as a duplicate of 4248 ***