Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 4782 - autofs needs to depend on portmap.
Summary: autofs needs to depend on portmap.
Status: RESOLVED DUPLICATE of bug 4248
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-07-09 20:49 UTC by Terje Kvernes
Modified: 2005-07-17 13:06 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Terje Kvernes 2002-07-09 20:49:33 UTC
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.
Comment 1 SpanKY gentoo-dev 2002-07-11 12:07:04 UTC
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
Comment 2 Martin Schlemmer (RETIRED) gentoo-dev 2002-07-11 13:58:01 UTC
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.
Comment 3 SpanKY gentoo-dev 2002-07-11 14:38:37 UTC
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 ?
Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2002-07-11 15:17:04 UTC
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.
Comment 5 SpanKY gentoo-dev 2002-07-11 16:09:52 UTC
well shit learn somethin new everyday ;)
i guess there is the answer then, 'use net portmap'
Comment 6 Terje Kvernes 2002-07-12 00:57:56 UTC
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. 
Comment 7 Martin Schlemmer (RETIRED) gentoo-dev 2002-07-12 13:49:13 UTC
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.
Comment 8 SpanKY gentoo-dev 2002-07-12 23:56:26 UTC
is there support for the USE variable in init.d scripts ?
Comment 9 Brian Rozmierski 2002-07-13 00:46:19 UTC
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.
Comment 10 SpanKY gentoo-dev 2002-08-02 21:42:36 UTC
some suggestions exist at that bug report

*** This bug has been marked as a duplicate of 4248 ***