New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

[solved] How to pass parameters to kernel (for NFS lockd)

Got problems with your B2 or B3? Share and get helped!
Post Reply
ingens
Posts: 4
Joined: 05 Jan 2010, 23:37

[solved] How to pass parameters to kernel (for NFS lockd)

Post by ingens »

Hello all.

On my Bubba 2, I would like to run NFS (starting with a simple setup, using NFSv3). At the same time, I would like to use a tight firewall (default deny, only specified ports opened). Therefore the rpc.* daemons need to be informed about the ports that are to be used. The settings can be checked "rpcinfo -p":

Code: Select all

   program vers proto   port
    100000    2   tcp    111  portmapper
    100000    2   udp    111  portmapper
    100024    1   udp  15000  status
    100024    1   tcp  15000  status
    100021    1   udp  59036  nlockmgr
    100021    3   udp  59036  nlockmgr
    100021    4   udp  59036  nlockmgr
    100021    1   tcp  60598  nlockmgr
    100021    3   tcp  60598  nlockmgr
    100021    4   tcp  60598  nlockmgr
    100003    2   tcp   2049  nfs
    100003    3   tcp   2049  nfs
    100003    2   udp   2049  nfs
    100003    3   udp   2049  nfs
    100005    1   udp  15002  mountd
    100005    1   tcp  15002  mountd
    100005    2   udp  15002  mountd
    100005    2   tcp  15002  mountd
    100005    3   udp  15002  mountd
    100005    3   tcp  15002  mountd
In here, rpc.mountd uses port 15002, rpc.statd uses port 15000. But how do I tell rpc.lockd (=> nlockmgr) which port to use? According to the NFS howto on the net (nfs.sourceforge.net): "lockd is started by the kernel when it is needed." Using either module parameters if loaded as module; or using kernel boot parameters if compiled into the kernel. On my B2 it is compiled into the kernel ("CONFIG_LOCKD=y" in /proc/config.gz).

So, how can I give according parameters (lockd.udpport=15004 lockd.tcpport=15004) to the kernel booted on my B2?

Thank you & Best regards
Manfred
Last edited by ingens on 16 Jun 2012, 10:57, edited 1 time in total.
ingens
Posts: 4
Joined: 05 Jan 2010, 23:37

Re: How to pass parameters to kernel (for NFS lockd port)

Post by ingens »

update:

After more reading on the net, I found another solution to my problem. The parameters of the lockd module (which is compiled into the Bubba2 kernel) can be set at runtime: "echo 15003 > /proc/sys/fs/nfs/nlm_udpport", and "nlm_tcpport" accordingly.

Afterwards, the service nfs-kernel-server needs to be restarted.

Remark: the same information is accessible from files in /sys/module/lockd/parameters, but they cannot be changed there: the shell error is "echo: write error: Invalid argument".
Post Reply