View previous topic :: View next topic |
Author |
Message |
pablocool n00b
Joined: 27 Jul 2017 Posts: 58
|
Posted: Sat Dec 29, 2018 5:47 pm Post subject: nfsd ignoring config file |
|
|
Hello
Today I was struggling whole day with making uboot load software via NFS. As it turned out it was Gentoo issue. Uboot uses NFSv2 over UDP so I added appropriate settings to config file
Code: | /etc/init.d/nfs
OPTS_RPC_NFSD="8 -V 2 -V 3 -V 4 -V 4.1 -u"
RPCNFSDARGS="8 -V 2 -V 3 -V 4 -V 4.1 -u"
|
I am using systemd so following gentoo wiki RPCNFSDARGS should be enough. However uboot was still displaying timeout message. Turned out nfs server is still runnning only vers 3 and 4 over TCP:
Code: | root@serwer /etc # rpcinfo -p
program vers proto port service
100000 4 tcp 111 portmapper
100000 3 tcp 111 portmapper
100000 2 tcp 111 portmapper
100000 4 udp 111 portmapper
100000 3 udp 111 portmapper
100000 2 udp 111 portmapper
100024 1 udp 47950 status
100024 1 tcp 37547 status
100005 1 udp 41994 mountd
100005 1 tcp 50039 mountd
100005 2 udp 46054 mountd
100005 2 tcp 56253 mountd
100005 3 udp 43955 mountd
100005 3 tcp 35697 mountd
100003 3 tcp 2049 nfs <------------------------------------
100003 4 tcp 2049 nfs <------------------------------------
100021 1 udp 46222 nlockmgr
100021 3 udp 46222 nlockmgr
100021 4 udp 46222 nlockmgr
100021 1 tcp 34331 nlockmgr
100021 3 tcp 34331 nlockmgr
100021 4 tcp 34331 nlockmgr
|
Manual update of service solved issue:
Code: | root@serwer /etc # cat /lib/systemd/system/nfs-server.service
[Unit]
Description=NFS server and services
DefaultDependencies=no
Requires= network.target proc-fs-nfsd.mount
Requires= nfs-mountd.service
Wants=rpcbind.socket network-online.target
Wants=rpc-statd.service nfs-idmapd.service
Wants=rpc-statd-notify.service
After= network-online.target local-fs.target
After= proc-fs-nfsd.mount rpcbind.socket nfs-mountd.service
After= nfs-idmapd.service rpc-statd.service
Before= rpc-statd-notify.service
# GSS services dependencies and ordering
Wants=auth-rpcgss-module.service
After=rpc-gssd.service gssproxy.service rpc-svcgssd.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStartPre=/usr/sbin/exportfs -r
ExecStart=/usr/sbin/rpc.nfsd 8 -V 2 -V 3 -V 4 -V 4.1 -u <------------------------------------
ExecStop=/usr/sbin/rpc.nfsd 0
ExecStopPost=/usr/sbin/exportfs -au
ExecStopPost=/usr/sbin/exportfs -f
ExecReload=/usr/sbin/exportfs -r
[Install]
WantedBy=multi-user.target |
Code: | root@serwer /etc # rpcinfo -p
program vers proto port service
100000 4 tcp 111 portmapper
100000 3 tcp 111 portmapper
100000 2 tcp 111 portmapper
100000 4 udp 111 portmapper
100000 3 udp 111 portmapper
100000 2 udp 111 portmapper
100024 1 udp 47950 status
100024 1 tcp 37547 status
100005 1 udp 56841 mountd
100005 1 tcp 53467 mountd
100005 2 udp 34414 mountd
100005 2 tcp 47925 mountd
100005 3 udp 50871 mountd
100005 3 tcp 37279 mountd
100003 2 tcp 2049 nfs <------------------------------------
100003 3 tcp 2049 nfs <------------------------------------
100003 4 tcp 2049 nfs <------------------------------------
100003 2 udp 2049 nfs <------------------------------------
100003 3 udp 2049 nfs <------------------------------------
100021 1 udp 45752 nlockmgr
100021 3 udp 45752 nlockmgr
100021 4 udp 45752 nlockmgr
100021 1 tcp 34153 nlockmgr
100021 3 tcp 34153 nlockmgr
100021 4 tcp 34153 nlockmgr |
I also tried something better but didnt work:
Code: | root@serwer /etc # cat /lib/systemd/system/nfs-server.service
[Unit]
Description=NFS server and services
DefaultDependencies=no
Requires= network.target proc-fs-nfsd.mount
Requires= nfs-mountd.service
Wants=rpcbind.socket network-online.target
Wants=rpc-statd.service nfs-idmapd.service
Wants=rpc-statd-notify.service
After= network-online.target local-fs.target
After= proc-fs-nfsd.mount rpcbind.socket nfs-mountd.service
After= nfs-idmapd.service rpc-statd.service
Before= rpc-statd-notify.service
# GSS services dependencies and ordering
Wants=auth-rpcgss-module.service
After=rpc-gssd.service gssproxy.service rpc-svcgssd.service
[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=/etc/conf.d/nfs <------------------------------------
ExecStartPre=/usr/sbin/exportfs -r
ExecStart=/usr/sbin/rpc.nfsd ${OPTS_RPC_NFSD} <------------------------------------
ExecStop=/usr/sbin/rpc.nfsd 0
ExecStopPost=/usr/sbin/exportfs -au
ExecStopPost=/usr/sbin/exportfs -f
ExecReload=/usr/sbin/exportfs -r
[Install]
WantedBy=multi-user.target |
Anyway I think nfs-utils package need fix. Isnt it? |
|
Back to top |
|
|
mike155 Advocate
Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
Posted: Sat Dec 29, 2018 6:14 pm Post subject: |
|
|
pablocool,
there's no need to change init scripts or Systemd configuration files. You can configure NFS server parameters in /etc/nfs.conf:
man nfsd wrote: | Many of the options that can be set on the command line can also be controlled through values set in the [nfsd] section of the /etc/nfs.conf configuration file. |
man nfs.conf wrote: | nfsd: Recognized values: threads, host, port, grace-time, lease-time, udp, tcp, vers2, vers3, vers4, vers4.0, vers4.1, vers4.2, rdma.
|
Mike |
|
Back to top |
|
|
pablocool n00b
Joined: 27 Jul 2017 Posts: 58
|
Posted: Sat Dec 29, 2018 10:48 pm Post subject: |
|
|
Ajjj I missed that reading manual. Thanks for pointing that! I will try it
Maybe it would be good to update --> https://wiki.gentoo.org/wiki/Nfs-utils |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|