packages/net/nfs-kernel-server/files/nfsd.init
breakings cb56ef7422
nfs-kernel-server: update to 2.5.4 (#462)
* nfs-kernel-server: update to 2.5.4

Signed-off-by: Rosen Penev <rosenp@gmail.com>

* nfs-kernel-server: reload when exported mountpoints show

Use newly introduced procd_add_reload_mount_trigger to reload nfsd
when a mountpoint covering an exported filesystem is added by blockd.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>

* nfs-kernel-server: move hardcoded /run to /tmp/run

statd currently fails to start due to missing /run which doesn't exist
on OpenWrt.

Add a patch moving /run to /tmp/run as the path is hardcoded in several
places and cannot be configured neither at buildtime nor at runtime.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>

* nfs-kernel-server: fix build on macos arm64

1. prctl() check is not required for host-compile on any OS due to prctl
is not used in rpcgen which is only one is compiled during host-compile
phase. prctl() check is disabled via HOST_CONFIGURE_VARS in OpenWrt makefile

2. __DARWIN_ONLY_64_BIT_INO_T is true on macos arm64 so struct stat64
and stat64() are not available. This patch defines stat64 as stat if
__DARWIN_ONLY_64_BIT_INO_T is true

Signed-off-by: Sergey V. Lobanov <sergey@lobanov.in>

* treewide: remove rpath-link

Most usages seem to be outdated and fixed a long time ago.

Signed-off-by: Rosen Penev <rosenp@gmail.com>

* nfs-kernel-server: disable IPv6 for host

Some issue with static libtirpc

Signed-off-by: Rosen Penev <rosenp@gmail.com>

Co-authored-by: Rosen Penev <rosenp@gmail.com>
Co-authored-by: Daniel Golle <daniel@makrotopia.org>
Co-authored-by: Sergey V. Lobanov <sergey@lobanov.in>
2022-06-06 00:40:53 +08:00

50 lines
1.0 KiB
Bash

#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=99
STOP=60
USE_PROCD=1
NFS_D=/var/lib/nfs
RECOVERY_D=$NFS_D/v4recovery
LOCK_D=/var/lib/nfs/sm
VAR_NFS=/var/lib/nfs
start_service() {
grep -q /proc/fs/nfsd /proc/mounts || \
mount -t nfsd nfsd /proc/fs/nfsd
mkdir -p $NFS_D
mkdir -p $RECOVERY_D
mkdir -p $LOCK_D
touch $NFS_D/rmtab
mkdir -p $VAR_NFS
chown nfs:nfs $VAR_NFS
sysctl -w fs.nfs.nlm_tcpport=32777 fs.nfs.nlm_udpport=32777 > /dev/null
procd_open_instance
procd_set_param command /usr/sbin/rpc.statd -p 32778 -o 32779 -F
procd_close_instance
/usr/sbin/exportfs -r
/usr/sbin/rpc.nfsd --grace-time 10
procd_open_instance
procd_set_param command /usr/sbin/rpc.mountd -p 32780 -F
procd_close_instance
}
stop_service() {
rpc.nfsd 0 2> /dev/null
/usr/sbin/exportfs -au
grep -q /proc/fs/nfsd /proc/mounts && \
umount /proc/fs/nfsd
}
service_triggers() {
local export_dirs="$(while read mp _r ; do echo -n "$mp " ; done < /etc/exports)"
procd_add_reload_mount_trigger $export_dirs
}