ypwhich: can't get local yp domain: Local domain name not set

Hello,

I am trying to get NIS authentication working on fresh install of tumbleweed (version 20181122). Configuration is done through YAST -> NIS Client without any problem, but after restart ypwhich returns error:

# ypwhich
ypwhich: can't get local yp domain: Local domain name not set
# systemctl status ypbind.service
● ypbind.service - NIS/YP Clients to NIS Domain Binder
   Loaded: loaded (/usr/lib/systemd/system/ypbind.service; enabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:ypbind(8)

nov 26 03:14:46 localhost systemd[1]: Dependency failed for NIS/YP Clients to NIS Domain Binder.
nov 26 03:14:46 localhost systemd[1]: ypbind.service: Job ypbind.service/start failed with result 'dependency'.

After restarting ypbind service, everything is OK:

# systemctl restart ypbind.service
# ypwhich
192.168.10.254
# systemctl status ypbind.service
● ypbind.service - NIS/YP Clients to NIS Domain Binder
   Loaded: loaded (/usr/lib/systemd/system/ypbind.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2018-11-26 03:19:09 CET; 6s ago
     Docs: man:ypbind(8)
  Process: 1820 ExecStartPost=/usr/lib/ypbind/ypbind-systemd-post (code=exited, status=0/SUCCESS)
  Process: 1814 ExecStartPre=/usr/lib/ypbind/ypbind-systemd-pre (code=exited, status=0/SUCCESS)
 Main PID: 1817 (ypbind)
   Status: "Processing requests..."
    Tasks: 3 (limit: 1157)
   Memory: 1.6M
   CGroup: /system.slice/ypbind.service
           └─1817 /usr/sbin/ypbind -n -local-only

nov 26 03:19:09 opensuse-test systemd[1]: Starting NIS/YP Clients to NIS Domain Binder...
nov 26 03:19:09 opensuse-test ypbind-systemd-pre[1814]: MYDOMAIN

nov 26 03:19:09 opensuse-test Started NIS/YP Clients to NIS Domain Binder.

I already tried to set nis domain through /etc/sysconfig/network/config (NETCONFIG_NIS_STATIC_DOMAIN) and /etc/sysconfig/ypbind (NISDOMAIN), but without success.

Is there something I forgot to set?

Hi,
I’ve had the same problem for a couple of months and I believe it’s a bug…

Try this report back if it solves the problem for you as well, if it does then I will file a bug report.

Edit /usr/lib/systemd/system/rpcbind.service and add the “After=network.target part” like this:

Requires=rpcbind.socket
Wants=rpcbind.target
After=network.target

I’m new to systemd so I’m not sure that is the correct way but it did solve ypbind failing to start after boot for me.

Thomas

Thanks to your answer it comes to my mind how I solved this on another computer:

# cat /etc/systemd/system/rpcbind.service.d/override.conf 
[Unit]
Wants=systemd-tmpfiles-setup.service
After=systemd-tmpfiles-setup.service

# systemctl daemon-reload

This solution is very close to yours, filling bug report is probably good idea.