committing changes in /etc made by "apt-get install nfs-kernel-server"

Package changes:
+nfs-kernel-server 1:1.3.4-2.5+deb10u1 armhf
This commit is contained in:
2021-03-18 20:54:14 +01:00
committed by root
parent 3b6b1dbf08
commit f8ce852e2e
12 changed files with 269 additions and 0 deletions

View File

@@ -170,6 +170,7 @@ maybe chmod 0644 'default/keyboard'
maybe chmod 0644 'default/locale' maybe chmod 0644 'default/locale'
maybe chmod 0644 'default/networking' maybe chmod 0644 'default/networking'
maybe chmod 0644 'default/nfs-common' maybe chmod 0644 'default/nfs-common'
maybe chmod 0644 'default/nfs-kernel-server'
maybe chmod 0644 'default/nss' maybe chmod 0644 'default/nss'
maybe chmod 0644 'default/raspberrypi-kernel' maybe chmod 0644 'default/raspberrypi-kernel'
maybe chmod 0644 'default/rng-tools' maybe chmod 0644 'default/rng-tools'
@@ -250,6 +251,7 @@ maybe chmod 0755 'etckeeper/update-ignore.d/01update-ignore'
maybe chmod 0644 'etckeeper/update-ignore.d/README' maybe chmod 0644 'etckeeper/update-ignore.d/README'
maybe chmod 0755 'etckeeper/vcs.d' maybe chmod 0755 'etckeeper/vcs.d'
maybe chmod 0755 'etckeeper/vcs.d/50vcs-cmd' maybe chmod 0755 'etckeeper/vcs.d/50vcs-cmd'
maybe chmod 0644 'exports'
maybe chmod 0644 'fb.modes' maybe chmod 0644 'fb.modes'
maybe chmod 0644 'fstab' maybe chmod 0644 'fstab'
maybe chmod 0644 'fuse.conf' maybe chmod 0644 'fuse.conf'
@@ -291,6 +293,7 @@ maybe chmod 0755 'init.d/keyboard-setup.sh'
maybe chmod 0755 'init.d/kmod' maybe chmod 0755 'init.d/kmod'
maybe chmod 0755 'init.d/networking' maybe chmod 0755 'init.d/networking'
maybe chmod 0755 'init.d/nfs-common' maybe chmod 0755 'init.d/nfs-common'
maybe chmod 0755 'init.d/nfs-kernel-server'
maybe chmod 0755 'init.d/paxctld' maybe chmod 0755 'init.d/paxctld'
maybe chmod 0755 'init.d/procps' maybe chmod 0755 'init.d/procps'
maybe chmod 0755 'init.d/raspi-config' maybe chmod 0755 'init.d/raspi-config'

19
default/nfs-kernel-server Normal file
View File

@@ -0,0 +1,19 @@
# Number of servers to start up
RPCNFSDCOUNT=8
# Runtime priority of server (see nice(1))
RPCNFSDPRIORITY=0
# Options for rpc.mountd.
# If you have a port-based firewall, you might want to set up
# a fixed port here using the --port option. For more information,
# see rpc.mountd(8) or http://wiki.debian.org/SecuringNFS
# To disable NFSv4 on the server, specify '--no-nfs-version 4' here
RPCMOUNTDOPTS="--manage-gids"
# Do you want to start the svcgssd daemon? It is only required for Kerberos
# exports. Valid alternatives are "yes" and "no"; the default is "no".
NEED_SVCGSSD=""
# Options for rpc.svcgssd.
RPCSVCGSSDOPTS=""

10
exports Normal file
View File

@@ -0,0 +1,10 @@
# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)
#

229
init.d/nfs-kernel-server Executable file
View File

@@ -0,0 +1,229 @@
#!/bin/bash
### BEGIN INIT INFO
# Provides: nfs-kernel-server
# Required-Start: $remote_fs nfs-common $portmap $time
# Required-Stop: $remote_fs nfs-common $portmap $time
# Should-Start: $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Kernel NFS server support
# Description: NFS is a popular protocol for file sharing across
# TCP/IP networks. This service provides NFS server
# functionality, which is configured via the
# /etc/exports file.
### END INIT INFO
# What is this?
DESC="NFS kernel daemon"
PREFIX=/usr
# Exit if required binaries are missing.
[ -x $PREFIX/sbin/rpc.nfsd ] || exit 0
[ -x $PREFIX/sbin/rpc.mountd ] || exit 0
[ -x $PREFIX/sbin/exportfs ] || exit 0
# Read config
DEFAULTFILE=/etc/default/nfs-kernel-server
RPCNFSDCOUNT=8
RPCNFSDPRIORITY=0
RPCMOUNTDOPTS=
NEED_SVCGSSD=no
RPCSVCGSSDOPTS=
PROCNFSD_MOUNTPOINT=/proc/fs/nfsd
if [ -f $DEFAULTFILE ]; then
. $DEFAULTFILE
fi
. /lib/lsb/init-functions
do_modprobe() {
if [ -x /sbin/modprobe -a -f /proc/modules ]
then
modprobe -q "$1" || true
fi
}
do_mount() {
if ! grep -E -qs "$1\$" /proc/filesystems
then
return 1
fi
if ! mountpoint -q "$2"
then
mount -t "$1" "$1" "$2"
return
fi
return 0
}
# See how we were called.
case "$1" in
start)
export_files="/etc/exports"
for file in /etc/exports.d/*.exports ; do
if [ -f "$file" ]; then
export_files="$export_files $file"
fi
done
if [ -f /etc/exports ] && grep -q '^[[:space:]]*[^#]*/' $export_files
then
do_modprobe nfsd
# See if our running kernel supports the NFS kernel server
if ! grep -E -qs "[[:space:]]nfsd\$" /proc/filesystems; then
log_warning_msg "Not starting $DESC: no support in current kernel."
exit 0
fi
do_mount nfsd $PROCNFSD_MOUNTPOINT || NEED_SVCGSSD=no
log_begin_msg "Exporting directories for $DESC..."
$PREFIX/sbin/exportfs -r
RET=$?
if [ $RET != 0 ]; then
log_end_msg $RET
exit $RET
fi
log_end_msg 0
log_daemon_msg "Starting $DESC"
log_progress_msg "nfsd"
# See if rpcbind is running
$PREFIX/sbin/rpcinfo -p >/dev/null 2>&1
RET=$?
if [ $RET != 0 ]; then
echo
log_warning_msg "Not starting: portmapper is not running"
exit 0
fi
start-stop-daemon --start --oknodo --quiet \
--nicelevel $RPCNFSDPRIORITY \
--exec $PREFIX/sbin/rpc.nfsd -- $RPCNFSDCOUNT
RET=$?
if [ $RET != 0 ]; then
log_end_msg $RET
exit $RET
fi
# make sure 127.0.0.1 is a valid source for requests
ClearAddr=
if [ -f /proc/net/rpc/auth.unix.ip/channel ]
then
fgrep -qs 127.0.0.1 /proc/net/rpc/auth.unix.ip/content || {
echo "nfsd 127.0.0.1 2147483647 localhost" >/proc/net/rpc/auth.unix.ip/channel
ClearAddr=yes
}
fi
[ -z "$ClearAddr" ] || echo "nfsd 127.0.0.1 1" >/proc/net/rpc/auth.unix.ip/channel
if [ "$NEED_SVCGSSD" = "yes" ]; then
do_modprobe rpcsec_gss_krb5
log_progress_msg "svcgssd"
start-stop-daemon --start --oknodo --quiet \
--exec $PREFIX/sbin/rpc.svcgssd -- $RPCSVCGSSDOPTS
RET=$?
if [ $RET != 0 ]; then
log_end_msg $RET
exit $RET
fi
fi
log_progress_msg "mountd"
start-stop-daemon --start --oknodo --quiet \
--exec $PREFIX/sbin/rpc.mountd -- $RPCMOUNTDOPTS
RET=$?
if [ $RET != 0 ]; then
log_end_msg $RET
exit $RET
fi
log_end_msg 0
else
log_warning_msg "Not starting $DESC: no exports."
fi
;;
stop)
log_daemon_msg "Stopping $DESC"
log_progress_msg "mountd"
start-stop-daemon --stop --oknodo --quiet \
--name rpc.mountd --user 0
RET=$?
if [ $RET != 0 ]; then
log_end_msg $RET
exit $RET
fi
if [ "$NEED_SVCGSSD" = "yes" ]; then
log_progress_msg "svcgssd"
start-stop-daemon --stop --oknodo --quiet \
--name rpc.svcgssd --user 0
RET=$?
if [ $RET != 0 ]; then
log_end_msg $RET
exit $RET
fi
fi
log_progress_msg "nfsd"
start-stop-daemon --stop --oknodo --quiet \
--name nfsd --user 0 --signal 2
RET=$?
if [ $RET != 0 ]; then
log_end_msg $RET
exit $RET
fi
log_end_msg 0
log_begin_msg "Unexporting directories for $DESC..."
$PREFIX/sbin/exportfs -au
RET=$?
if [ $RET != 0 ]; then
log_end_msg $RET
exit $RET
fi
log_end_msg 0
if mountpoint -q $PROCNFSD_MOUNTPOINT
then
$PREFIX/sbin/exportfs -f
fi
;;
status)
if pidof nfsd >/dev/null
then
echo "nfsd running"
exit 0
else
echo "nfsd not running"
exit 3
fi
;;
reload | force-reload)
log_begin_msg "Re-exporting directories for $DESC..."
$PREFIX/sbin/exportfs -r
RET=$?
log_end_msg $RET
exit $RET
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
log_success_msg "Usage: nfs-kernel-server {start|stop|status|reload|force-reload|restart}"
exit 1
;;
esac
exit 0

1
rc0.d/K01nfs-kernel-server Symbolic link
View File

@@ -0,0 +1 @@
../init.d/nfs-kernel-server

1
rc1.d/K01nfs-kernel-server Symbolic link
View File

@@ -0,0 +1 @@
../init.d/nfs-kernel-server

1
rc2.d/S01nfs-kernel-server Symbolic link
View File

@@ -0,0 +1 @@
../init.d/nfs-kernel-server

1
rc3.d/S01nfs-kernel-server Symbolic link
View File

@@ -0,0 +1 @@
../init.d/nfs-kernel-server

1
rc4.d/S01nfs-kernel-server Symbolic link
View File

@@ -0,0 +1 @@
../init.d/nfs-kernel-server

1
rc5.d/S01nfs-kernel-server Symbolic link
View File

@@ -0,0 +1 @@
../init.d/nfs-kernel-server

1
rc6.d/K01nfs-kernel-server Symbolic link
View File

@@ -0,0 +1 @@
../init.d/nfs-kernel-server

View File

@@ -0,0 +1 @@
/lib/systemd/system/nfs-server.service