[Bug 1558196] Re: ypbind not able to socket activate rpcbind under systemd, fails at boot unless something else starts rpcbind

Erik Kruus ejkruus at gmail.com
Fri Aug 19 14:02:29 UTC 2016


Jacques,

Ditto for rpcbind patch not being enough.  I have traced the issue via syslogs
to nis starting too early, before kernel has brought network interfaces up.
**If** the network interfaces get up "fast", then boot succeeds.  Otherwise
nfs fails and nameserver might never be there, and userids are unavailable, etc.
You may boot after the 5 min network timeout, but with drastically reduced
service.

What follows makes things work, but is UGLY and not the "right way".
--------------------------------------------------------------------
At our site IT recommends static ips set up with /etc/network/interfaces,
and the HACK I suggested involves overriding the default 'systemctl cat nis.service'
to put it after ifup at IFACE.service and before NetworkManager.service.
This works, but is not a correct solution, because nis is starting after ifup
starts but before kernel reports the interface as 'ready'.

I also aid the boot by putting into 'interfaces' a
"post-up systemctl restart nis", just in case, and help some of the other
packages a bit by supplying dns-nameserver clause, and finally attempted
to cover my a** with an additional
  system-ctl add-wants NetworkManager.service nis.service

Now system boots with nis maybe 6 times in a row, and without timeouts, and
all nis stuff available -- good enough for me, but not generic since ifup
may not be there at your place.

I have NOT tested whether putting nis after (or maybe "Also") with
NetworkManager.service works, and if that worked, it might be a more general
solution.

-----For example only:
kruus at snake10$ cat nis.service
# /run/systemd/generator.late/nis.service
# Generated by [on a default install]
#   systemctl cat nis.service > /etc/systemd/system/nis.service
# and some light editing.
#
# Also see the ifup dependency patched into
#   /etc/systemd/system/nis.service.d/ifup.conf
# that reflects the static nec-labs route you set up in
#   /etc/network/interfaces

[Unit]
Documentation=man:systemd-sysv-generator(8)
SourcePath=/etc/init.d/nis
Description=LSB: Start NIS client and server daemons.
Before=multi-user.target
Before=graphical.target
Before=NetworkManager.service
Before=remote-fs.target
After=rpcbind.target
After=network-pre.target
# NO! After=remote-fs.target
# NO! Wants=network-online.target

[Install]
WantedBy=NetworkManager.service
# NO! WantedBy=nss-user-lookup.target

[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
ExecStart=/etc/init.d/nis start
ExecStop=/etc/init.d/nis stop
ExecReload=/etc/init.d/nis reload

    /etc/systemd/system
kruus at snake10$ cat nis.service.d/ifup.conf
[Unit]
After=ifup at eno1.service
Wants=ifup at eno1.service
#          ^^^^ your main network interface HERE.

    /etc/systemd/system
kruus at snake10$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto enp14s0
iface enp14s0 inet static
  address 138.15.169.213
  <snip-snip -- boring snake08--snake10 point-to-point on second port>

auto eno1
iface eno1 inet static
  address 138.15.169.213
  netmask 255.255.255.0
  gateway 138.15.169.254
# below is not required for general use:
  metric 50
  #dns-search nec-labs.com
  #dns-nameservers 138.15.108.11 138.15.200.9
  #post-up systemctl restart nis && echo "ifup: NIS restarted" || echo "ifup: FAILED NIS restart"

Note that I have only a systemd patch working, and NONE of my earlier
/etc/network/interfaces helper hacks, such as
dns-search, or
dns-nameservers, or
post-up systemctl restart nis ...

Success measured by:
- no 5 minute timeouts in boot
- boot accepts NIS user login.
- syslog doesn't look too bad any more.
- badness:
  - depends on ifup and interface name
  - nis starts when ifup begins, not when ifup ends with kernel report 'device ready'

Comment:  Some difficulty from systemd using old init.d nis and networking scripts.
It would be nice to have an "net-interface-up.target" in systemd, somewhere between
network-pre.target and network-online(?) but this gets a bit more involved.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to rpcbind in Ubuntu.
https://bugs.launchpad.net/bugs/1558196

Title:
  ypbind not able to socket activate rpcbind under systemd, fails at
  boot unless something else starts rpcbind

Status in nis package in Ubuntu:
  Triaged
Status in rpcbind package in Ubuntu:
  Fix Released
Status in nis source package in Xenial:
  Confirmed
Status in rpcbind source package in Xenial:
  Confirmed
Status in nis package in Debian:
  Fix Released

Bug description:
  did apt-get update/upgrade  March 16, 2016 
  Description:    Ubuntu Xenial Xerus (development branch)
  Release:        16.04

  rpcbind does not start on boot, tried various systemd debugging steps
  with no clues. After boot systemctl start rpcbind works. There is  a
  /etc/init.d/rpcbind and a /lib/systemd/system/rpcbind.service config
  files which is confusing.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/nis/+bug/1558196/+subscriptions



More information about the foundations-bugs mailing list