#7781 Don't start/enable nfs-idmap nor nfs-secure
Closed: fixed Opened by fcami.

As of Fedora 29 at least, trying to enable nfs-idmapd (rpc-idmapd) and nfs-secure (rpc-gssd) results in a systemctl error. These units are now static and are not meant to be enabled/started manually.

# ipa-client-automount --debug [--uninstall]

test runs show the following:

stderr=
Restart of nfs-idmap.service complete
Started rpcidmapd
Starting external process
args=['/bin/systemctl', 'enable', 'nfs-idmap.service']
Process finished, return code=0
stdout=
stderr=The unit files have no installation config (WantedBy, RequiredBy, Also, Alias
settings in the [Install] section, and DefaultInstance for template units).
This means they are not meant to be enabled using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
   .wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
   a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
   D-Bus, udev, scripted systemctl call, ...).
4) In case of template units, the unit is meant to be enabled with some
   instance name specified.
stderr=
Restart of nfs-secure.service complete
Started rpcgssd
Starting external process
args=['/bin/systemctl', 'enable', 'nfs-secure.service']
Process finished, return code=0
stdout=
stderr=The unit files have no installation config (WantedBy, RequiredBy, Also, Alias
settings in the [Install] section, and DefaultInstance for template units).
This means they are not meant to be enabled using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
   .wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
   a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
   D-Bus, udev, scripted systemctl call, ...).
4) In case of template units, the unit is meant to be enabled with some
   instance name specified.

Metadata Update from @fcami:
- Issue assigned to fcami

as nfs-client.target is a dependency of multi-user.target and remote-fs.target:

/etc/systemd/system/multi-user.target.wants/nfs-client.target -> /usr/lib/systemd/system/nfs-client.target
/etc/systemd/system/remote-fs.target.wants/nfs-client.target -> /usr/lib/systemd/system/nfs-client.target

and nfs-client correctly starts gssproxy and idmap:

[Unit]
Description=NFS client services
Before=remote-fs-pre.target
Wants=remote-fs-pre.target
# Note: we don't "Wants=rpc-statd.service" as "mount.nfs" will arrange to
# start that on demand if needed.
Wants=rpc-statd-notify.service
# GSS services dependencies and ordering
Wants=auth-rpcgss-module.service
After=rpc-gssd.service rpc-svcgssd.service gssproxy.service
[Install]
WantedBy=multi-user.target
WantedBy=remote-fs.target

Proposal: remove systemctl start/enable/disable/stop nfs-secure/nfs-idmap calls from ipa-client-automount.

Hello, @fcami
You don't believe.
Right now I'm fixing IPA Automount for my distro.
Here the same problem was, I merely removed all unneeded stuff like you mentioned and added nfs-client.target under the IPA control.

But I'm not familiar with all IPA supported distros so good.

@slev thanks for confirming!
Did you choose to restart nfs-client.target from ipa-client-automount?
Enabling it should not be necessary provided your multi-user.target "wants" nfs-client.target I guess.

For my configuration nfs-client.target is disabled by default:

systemctl show -p "Wants" multi-user.target | grep nfs

Out is nothing.
Therefore, it's needed to

nfsclient.restart()
nfsclient.enable()

Metadata Update from @fcami:
- Custom field on_review adjusted to https://github.com/freeipa/freeipa/pull/2657

Metadata Update from @fcami:
- Issue set to the milestone: FreeIPA 4.7.2

master:

  • 97f87513ef345908c74f27c71e7765c16d3abe8c Fix NFS unit names
  • 6a56aa6d4987bc4856997351a413c014e14abdd6 ipa-client-automount: use nfs-utils unit
  • 7c0b0f34716cabbdc48edf959935b37a21883238 ipatests: add a test for ipa-client-automount

Metadata Update from @fcami:
- Issue set to the milestone: FreeIPA 4.7.3 (was: FreeIPA 4.7.2)

ipa-4-7:

  • 65f6c8dc2585144b17ff89e63e4ba300971996dd Fix NFS unit names
  • 0687e4869995842a90d5d656749de42daceb2ad4 ipa-client-automount: use nfs-utils unit
  • dfd741d3cd9c9d695e7ad6f88dcd4432fb73c126 ipatests: add a test for ipa-client-automount

Metadata Update from @cheimes:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

Metadata