Bug 472438

Summary: how to start gssd without having an nfs entry in /etc/fstab
Product: [openSUSE] openSUSE 11.1 Reporter: Werner Queck <queck>
Component: NetworkAssignee: Neil Brown <nfbrown>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P3 - Medium CC: ian.grant, kamil, taupemoi
Version: Final   
Target Milestone: ---   
Hardware: 32bit   
OS: openSUSE 11.1   
Whiteboard: maint:released:11.1:24255 maint:released:sle11:24254
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Werner Queck 2009-02-04 15:12:36 UTC
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.0.5) Gecko/2008121300 SUSE/3.0.5-1.1 Firefox/3.0.5

We need to start gssd, in general at boot time. The /etc/init.d/nfs script stops with "Not starting NFS client services - no NFS found in /etc/fstab:".
But the automounter gets its information from the corresponding maps such that no entry in /etc/fstab is necessary. 
As workaround I added a (dummy) entry to /etc/fstab to force /etc/init.d/nfs to start gssd.
Should I create a additional init-script to start gssd or is there another way to solve the problem?

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Comment 1 Gabriel Indurskis 2009-02-08 20:01:44 UTC
This also applies to the idmapd service on an nfs4 client: Whenever an nfs4 share is mounted manually (without using rcnfs start), idmapd is not automatically started and hence user mappings are incorrect. But using rcnfs only works if the share is entered in /etc/fstab without the noauto option - which is not desirable in some circumstances (e.g. with automount or manual mounts).

As a solution, I suggest creating a separate init script to start idmapd (or gssd as in the previous poster's situation).
Comment 2 Ian Grant 2009-02-11 14:30:51 UTC
This is design error. The existence of autofs and user-mountable NFS volumes means that one can't deduce anything about NFS requirements from the contents of /etc/fstab. I apply this patch to /etc/init.d/nfs but it starts everything including idmapd which we don't need for V3 nfs with sec=krb5, so it's not ideal:

--- nfs.orig    2009-02-11 14:17:10.000000000 +0000
+++ nfs 2009-02-11 14:22:53.000000000 +0000
@@ -38,7 +38,7 @@
 usr=""
 opt=""
 mnt=""
-nfs=no
+nfs=yes
 
 while read  what where type options rest  ; do
     case "$what" in
Comment 3 Chuan Ye Han 2009-03-04 09:07:26 UTC
Katarina,could you please help to have a look at this? I am not very sure whether it is right to assign it to you. Wait for your suggestion. Sorry for the inconvenience and thank you.
Comment 4 Kamil Kisiel 2009-03-04 21:46:04 UTC
I applied the change as Ian suggested above and that's working for right now. I'm not sure why all these elaborate checks are necessary. If I chkconfig my nfs service to on, I expect it will start. I can think of many use cases where it would be necessary to have it running but not have any filesystems defined in fstab.
Comment 5 Katarina Machalkova 2009-03-05 09:19:39 UTC
This is not quite about YaST nfs module, but about nfs init scripts rather than that. Looking at the changelog, nfs service is not started intentionally if there is nothing nfs-related in fstab:

* Mon Sep 22 2008 nfbrown@suse.de
- Change nfs.init to do nothing if NFS is not mentioend in /etc/fstab,
  and sure it is always enabled.  bnc#331667

Reassigning
Comment 6 Neil Brown 2009-03-05 11:03:39 UTC
SuSE has a policy that services should not be started unless they are known to be needed.  So we cannot start gssd etc just because they are installed.  We 
need to be sure they are wanted.

You can start the required daemons by hand with

  rcnfs force-start

Probably we should have a config option that can be set in
 /etc/sysconfig/nfs

which says "assume NFS is in use, so start any required daemons".

I'll look into it.
Comment 7 Kamil Kisiel 2009-03-05 17:40:24 UTC
That would be a good solution. At our site we manage all NFS mounts completely through the automounter, and I'm sure many larger sites do the same thing. fstab simply isn't flexible enough when you have mounts being added or changed regularly on dozens of machines.
Comment 8 Neil Brown 2009-03-20 03:56:20 UTC
I have changed the
  nfs=no
line to
  nfs=$NFS_START_SERVICES

and added

## Path:                Network/File systems/NFS server
## Description:         Always start NFS services
## Type:                yesno
## Default:             no
## ServiceRestart       nfs
#
# Always start NFS services (gssd, idmapd), not only if
# there are nfs mounts in /etc/fstab.  This is likely to be
# needed if you use an automounter for NFS.
#
NFS_START_SERVICES="no"

to the end of /etc/sysconfig/nfs.
This should allow you to set "Always start NFS services" to
"yes" and get the desired result.

Anja: I'd like to make this available as an update for OpenSUSE 11.1 and
SLES11.  Could I get a tracking number please?
Comment 9 Dirk Mueller 2009-03-24 13:54:51 UTC
Neil, thats not the normal way we do such things. the normal way would be to initialize to "" (empty string), and default to the default value if the string is empty. 

this way we can change the default at some point without having upgrade pains.
Comment 10 Swamp Workflow Management 2009-03-30 09:05:51 UTC
The SWAMPID for this issue is 23557.
Please submit the patch and patchinfo file using this ID.
(https://swamp.suse.de/webswamp/wf/23557)
Comment 11 Neil Brown 2009-04-03 01:24:58 UTC
(In reply to comment #9)
> Neil, thats not the normal way we do such things. the normal way would be to
> initialize to "" (empty string), and default to the default value if the string
> is empty. 
> 
> this way we can change the default at some point without having upgrade pains.

If I understand this correctly, it means putting

  nfs=${NFS_START_SERVICES:-no}

in nfs.init, and

  NFS_START_SERVICES=""

in /etc/sysconfig/nfs

Is that correct?

Thanks.
Comment 12 Dirk Mueller 2009-04-15 09:36:55 UTC
yep, that should work (haven't tested the bash magic, but looks ok on first sight)
Comment 13 Neil Brown 2009-04-23 22:23:20 UTC
OK, I have submitted patches for this for SLE11 and 11.1
Comment 14 Swamp Workflow Management 2009-06-06 13:28:28 UTC
Update released for: nfs-client, nfs-doc, nfs-kernel-server, nfs-utils, nfs-utils-debuginfo, nfs-utils-debugsource
Products:
openSUSE 11.1 (debug, i586, ppc, x86_64)
Comment 15 Swamp Workflow Management 2009-06-06 22:09:48 UTC
Update released for: nfs-client, nfs-doc, nfs-kernel-server, nfs-utils, nfs-utils-debuginfo, nfs-utils-debugsource
Products:
SLE-DEBUGINFO 11 (i386, ia64, ppc64, s390x, x86_64)
SLE-DESKTOP 11 (i386, x86_64)
SLE-SERVER 11 (i386, ia64, ppc64, s390x, x86_64)