Bug 1183992 - nfs-utils-1.3.1-5.0.fc21 systemd service files incorrectly require passive systemd targets, notably rpcbind.target
Summary: nfs-utils-1.3.1-5.0.fc21 systemd service files incorrectly require passive sy...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: nfs-utils
Version: rawhide
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Steve Dickson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-01-20 11:46 UTC by major
Modified: 2015-12-14 14:54 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-12-14 14:54:51 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description major 2015-01-20 11:46:33 UTC
Description of problem:
The nfs-utils-1.3.1-5.0.fc21 systemd service files in /usr/lib/systemd/system are incorrectly requiring rpcbind.target instead of rpcbind.service. As described in "man:systemd.special" the rpcbind.target is a "special passive system unit" and should only have an "After=rpcbind.target" line for services that "consume" the services of rpcbind. Having a "Requires=rpcbind.target" might be appropriate only in the file /usr/lib/systemd/system/rpcbind.service ("Wants=" is recommended instead of "Requires=" for the service that "pulls in" a passive target).

The nfs-utils systemd services that use RPC should have either "Requires=rpcbind.service" if RPC is mandatory or "Wants=rpcbind.service" if RPC is optional, and either "After=rpcbind.service" or "After=rpcbind.target". [R]pcbind.service currently does not "pull in" rpcbind.target as it should (see Bug 1183970) so "After=rpcbind.service" is preferable to "After=rpcbind.target" until that is fixed (and maybe even then).

The nfs-utils systemd services that use other passive targets (e.g. nss-lookup.target) have the same problem as with rpcbind.target. Terminal commands and output follow.

###############################################################################
[root@archer ~]# rpm -q nfs-utils rpcbind systemd
nfs-utils-1.3.1-5.0.fc21.x86_64
rpcbind-0.2.2-1.1.fc21.x86_64
systemd-216-14.fc21.x86_64
###############################################################################
[root@archer ~]# grep rpcbind $(rpm -ql nfs-utils | grep /usr/lib/systemd/system) | grep -v 'wants$'
/usr/lib/systemd/system/nfs-lock.service:Requires=nss-lookup.target rpcbind.target
/usr/lib/systemd/system/nfs-lock.service:After=network.target nss-lookup.target rpcbind.target
/usr/lib/systemd/system/nfs-server.service:Requires= network.target proc-fs-nfsd.mount rpcbind.target
/usr/lib/systemd/system/nfs-server.service:After= network.target proc-fs-nfsd.mount rpcbind.target nfs-mountd.service
/usr/lib/systemd/system/nfs.service:Requires= network.target proc-fs-nfsd.mount rpcbind.target
/usr/lib/systemd/system/nfs.service:After= network.target proc-fs-nfsd.mount rpcbind.target nfs-mountd.service
grep: /usr/lib/systemd/system/nfs.target.wants: Is a directory
/usr/lib/systemd/system/rpc-statd.service:Requires=nss-lookup.target rpcbind.target
/usr/lib/systemd/system/rpc-statd.service:After=network.target nss-lookup.target rpcbind.target
###############################################################################
[root@archer ~]# man -P cat systemd.special | grep -A4 'SPECIAL PASSIVE SYSTEM UNITS' | sed 's/^ *//'
SPECIAL PASSIVE SYSTEM UNITS
A number of special system targets are defined that can be used to properly order boot-up of optional services. These targets are generally not part of the initial boot transaction,
unless they are explicitly pulled in by one of the implementing services. Note specifically that these passive target units are generally not pulled in by the consumer of a service, but
by the provider of the service. This means: a consuming service should order itself after these targets (as appropriate), but not pull it in. A providing service should order itself
before these targets (as appropriate) and pull it in (via a Wants= type dependency).
###############################################################################
[root@archer ~]# man -P cat systemd.special | grep -C1 portmapper | sed 's/^ *//'
rpcbind.target
The portmapper/rpcbind pulls in this target and orders itself before it, to indicate its availability. systemd automatically adds dependencies of type After= for this target unit to
all SysV init script service units with an LSB header referring to the "$portmap" facility.

Comment 1 Terje Røsten 2015-03-09 19:52:57 UTC
Not sure why rpcbind.service was replace with rpcbind.target in nfs-server.service in Fedora 22.

Now "service nfs-server start" don't bring up nfs server, this worked fine
in Fedora 21.

Doing:

service rpcbind start
service nfs-server start

things starts to work in Fedora 22 too.

Comment 2 Steve Dickson 2015-03-22 15:37:43 UTC
I guess I don't see the problem here... Everything seems to be working for me.

Comment 3 Fedora End Of Life 2015-11-04 13:02:43 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '21'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 Fedora End Of Life 2015-12-02 07:40:36 UTC
Fedora 21 changed to end-of-life (EOL) status on 2015-12-01. Fedora 21 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 5 Steve Dickson 2015-12-14 14:54:51 UTC
(In reply to Terje Røsten from comment #1)
> Not sure why rpcbind.service was replace with rpcbind.target in
> nfs-server.service in Fedora 22.
> 
> Now "service nfs-server start" don't bring up nfs server, this worked fine
> in Fedora 21.
> 
> Doing:
> 
> service rpcbind start
> service nfs-server start
> 
> things starts to work in Fedora 22 too.
this was the fix to this problem.

commit 4fabfcd082069a16ea8769b9ea9344fc15011366
Author: Steve Dickson <steved>
Date:   Mon Nov 9 11:28:30 2015 -0500

    systemd: Decouple the starting and stopping of rpcbind/nfs-server
    
    Commit b98f2af15 introduced a regression that cause the
    starting and stop of rpcbind and the nfs-server to
    be depended on each other
    
    The starting of the NFS server should start rpcbind
    but bring rpcbind down should not bring the NFS
    server down.
    
    Signed-off-by: Steve Dickson <steved>


Note You need to log in before you can comment on or make changes to this bug.