Ypbind service fails to start on system bootup [race condition]

Bug #1658653 reported by Jakub
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
nis (Ubuntu)
Fix Released
Medium
David Britton

Bug Description

Ypbind service does not start after system bootup.
The systemctl command reports that the nis is running, but there is no ypbind process on the system.

When I switch the ypbind to debug mode, I get following logs:

Jan 23 09:21:15 gklab-81-069 nis[743]: 796: parsing config file
Jan 23 09:21:15 gklab-81-069 nis[743]: 796: Trying entry: domain nis.igk.intel.com server 172.28.168.43
Jan 23 09:21:15 gklab-81-069 nis[743]: 796: parsed domain 'nis.igk.intel.com' server '172.28.168.43'
Jan 23 09:21:15 gklab-81-069 nis[743]: 796: add_server() domain: nis.igk.intel.com, host: 172.28.168.43, slot: 0
Jan 23 09:21:15 gklab-81-069 nis[743]: 796: Trying entry: domain nis.igk.intel.com server 172.28.168.170
Jan 23 09:21:15 gklab-81-069 nis[743]: 796: parsed domain 'nis.igk.intel.com' server '172.28.168.170'
Jan 23 09:21:15 gklab-81-069 nis[743]: 796: add_server() domain: nis.igk.intel.com, host: 172.28.168.170, slot: 1
Jan 23 09:21:15 gklab-81-069 nis[743]: 796: [Welcome to ypbind-mt, version 1.20.1]
Jan 23 09:21:15 gklab-81-069 nis[743]: 796: ping interval is 20 seconds
Jan 23 09:21:15 gklab-81-069 nis[743]: Cannot register service: RPC: Unable to receive; errno = Connection refused
Jan 23 09:21:15 gklab-81-069 nis[743]: 796: Unable to register (YPBINDPROG, YPBINDVERS, udp).

The system logs show that the nis tries to start before the rpcbind is initialized:

Jan 23 09:09:21 gklab-81-069 systemd[1]: Listening on RPCbind Server Activation Socket.
Jan 23 09:09:21 gklab-81-069 systemd[1]: Starting LSB: Start NIS client and server daemons....
Jan 23 09:09:21 gklab-81-069 systemd[1]: Starting RPC bind portmap service...
Jan 23 09:09:21 gklab-81-069 systemd[1]: Started RPC bind portmap service.
Jan 23 09:09:21 gklab-81-069 systemd[1]: Reached target RPC Port Mapper.
Jan 23 09:09:32 gklab-81-069 systemd[1]: Started LSB: Start NIS client and server daemons..

Adding the dependency to the nis systemd unit config solves the problem:
[Unit]
Wants=rpcbind.target

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: nis 3.17-34ubuntu3 [modified: etc/yp.conf etc/init.d/nis]
ProcVersionSignature: Ubuntu 4.4.0-59.80-generic 4.4.35
Uname: Linux 4.4.0-59-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.5
Architecture: amd64
Date: Mon Jan 23 12:08:29 2017
ProcEnviron:
 TERM=xterm-256color
 SHELL=/bin/bash
 PATH=(custom, no user)
 LANG=en_US
 LANGUAGE=en_US:
SourcePackage: nis
UpgradeStatus: No upgrade log present (probably fresh install)
modified.conffile..etc.init.d.nis: [modified]
modified.conffile..etc.yp.conf: [modified]
mtime.conffile..etc.init.d.nis: 2017-01-23T09:31:48.928646
mtime.conffile..etc.yp.conf: 2017-01-20T09:44:39.706641

Revision history for this message
Jakub (jakub-d) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in nis (Ubuntu):
status: New → Confirmed
Changed in nis (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Nish Aravamudan (nacc) wrote :

Hello and thank you for filing this bug report! The ordering you mention does seem to be a real issue and I will add this to the server team backlog.

tags: added: bitesize
David Britton (dpb)
Changed in nis (Ubuntu):
assignee: nobody → David Britton (davidpbritton)
Revision history for this message
David Britton (dpb) wrote :

Hello there -- I checked on the latest dev release, booted it multiple times and didn't see any race, I then looked at the service, which already contains this fix:

# systemctl cat nis.service |grep rpc
After=rpcbind.target
#

I dug into the systemd.unit(5) which states in the 'Requires=' tag description (Requires= is a stronger version of Wants=) that 'After=' is what should be used when ordering is necessary. In fact, Requires= and Wants= will start services at the same time.

Since After= is already in the dev release, marking this issue fixed.

Changed in nis (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.