]> Frank Brehm's Git Trees - config/bruni/etc.git/commitdiff
committing changes in /etc after emerge run
authorfrank <frank@bruni.home.brehm-online.com>
Mon, 16 Jan 2012 19:51:40 +0000 (20:51 +0100)
committerFrank Brehm <root@bruni.home.brehm-online.com>
Mon, 16 Jan 2012 19:51:40 +0000 (20:51 +0100)
Package changes:
+net-fs/nfs-utils-1.2.3-r1

.etckeeper
conf.d/nfs [new file with mode: 0644]
exports [new file with mode: 0644]
init.d/nfs [new file with mode: 0755]
init.d/nfsmount [new file with mode: 0755]
init.d/rpc.gssd [new file with mode: 0755]
init.d/rpc.idmapd [new file with mode: 0755]
init.d/rpc.pipefs [new file with mode: 0755]
init.d/rpc.statd [new file with mode: 0755]
init.d/rpc.svcgssd [new file with mode: 0755]

index bf032019aad9c8d9a44c89ef2a0073f83420a3df..39dbd3ba1c8c0e28439e2b8b10f9978df3065c8d 100755 (executable)
@@ -193,6 +193,7 @@ maybe chmod 0644 './conf.d/mysql'
 maybe chmod 0644 './conf.d/nas'
 maybe chmod 0644 './conf.d/net'
 maybe chmod 0644 './conf.d/network'
+maybe chmod 0644 './conf.d/nfs'
 maybe chmod 0644 './conf.d/ntp-client'
 maybe chmod 0644 './conf.d/ntpd'
 maybe chmod 0644 './conf.d/openvpn'
@@ -457,6 +458,7 @@ maybe chmod 0755 './etckeeper/update-ignore.d/01update-ignore'
 maybe chmod 0644 './etckeeper/update-ignore.d/README'
 maybe chmod 0755 './etckeeper/vcs.d'
 maybe chmod 0755 './etckeeper/vcs.d/50vcs-cmd'
+maybe chmod 0644 './exports'
 maybe chmod 0644 './filesystems'
 maybe chmod 0755 './fonts'
 maybe chmod 0755 './fonts/conf.avail'
@@ -669,6 +671,8 @@ maybe chmod 0755 './init.d/nas'
 maybe chmod 0755 './init.d/net.lo'
 maybe chmod 0755 './init.d/netmount'
 maybe chmod 0755 './init.d/network'
+maybe chmod 0755 './init.d/nfs'
+maybe chmod 0755 './init.d/nfsmount'
 maybe chmod 0755 './init.d/nscd'
 maybe chmod 0755 './init.d/ntp-client'
 maybe chmod 0755 './init.d/ntpd'
@@ -683,6 +687,11 @@ maybe chmod 0755 './init.d/pydoc-3.1'
 maybe chmod 0755 './init.d/radvd'
 maybe chmod 0755 './init.d/reboot.sh'
 maybe chmod 0755 './init.d/root'
+maybe chmod 0755 './init.d/rpc.gssd'
+maybe chmod 0755 './init.d/rpc.idmapd'
+maybe chmod 0755 './init.d/rpc.pipefs'
+maybe chmod 0755 './init.d/rpc.statd'
+maybe chmod 0755 './init.d/rpc.svcgssd'
 maybe chmod 0755 './init.d/rpcbind'
 maybe chmod 0755 './init.d/rsyncd'
 maybe chmod 0755 './init.d/samba'
diff --git a/conf.d/nfs b/conf.d/nfs
new file mode 100644 (file)
index 0000000..60ed5d8
--- /dev/null
@@ -0,0 +1,38 @@
+# /etc/conf.d/nfs
+
+# If you wish to set the port numbers for lockd,
+# please see /etc/sysctl.conf
+
+# Optional services to include in default `/etc/init.d/nfs start`
+# For NFSv4 users, you'll want to add "rpc.idmapd" here.
+NFS_NEEDED_SERVICES="rpc.idmapd"
+
+# Number of servers to be started up by default
+OPTS_RPC_NFSD="8"
+
+# Options to pass to rpc.mountd
+# ex. OPTS_RPC_MOUNTD="-p 32767"
+OPTS_RPC_MOUNTD=""
+
+# Options to pass to rpc.statd
+# ex. OPTS_RPC_STATD="-p 32765 -o 32766"
+OPTS_RPC_STATD=""
+
+# Options to pass to rpc.idmapd
+OPTS_RPC_IDMAPD=""
+
+# Options to pass to rpc.gssd
+OPTS_RPC_GSSD=""
+
+# Options to pass to rpc.svcgssd
+OPTS_RPC_SVCGSSD=""
+
+# Options to pass to rpc.rquotad (requires sys-fs/quota)
+OPTS_RPC_RQUOTAD=""
+
+# Timeout (in seconds) for exportfs
+EXPORTFS_TIMEOUT=30
+
+# Options to set in the nfsd filesystem (/proc/fs/nfsd/).
+# Format is <option>=<value>.  Multiple options are allowed.
+#OPTS_NFSD="nfsv4leasetime=30 max_block_size=4096"
diff --git a/exports b/exports
new file mode 100644 (file)
index 0000000..5102ef2
--- /dev/null
+++ b/exports
@@ -0,0 +1 @@
+# /etc/exports: NFS file systems being exported.  See exports(5).
diff --git a/init.d/nfs b/init.d/nfs
new file mode 100755 (executable)
index 0000000..c99a1bf
--- /dev/null
@@ -0,0 +1,165 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-fs/nfs-utils/files/nfs.initd,v 1.26 2011/09/18 01:51:51 vapier Exp $
+
+extra_started_commands="reload"
+
+# This variable is used for controlling whether or not to run exportfs -ua;
+# see stop() for more information
+restarting=no
+
+# The binary locations
+exportfs=/usr/sbin/exportfs
+  mountd=/usr/sbin/rpc.mountd
+    nfsd=/usr/sbin/rpc.nfsd
+smnotify=/usr/sbin/sm-notify
+
+depend() {
+       local myneed=""
+       if [ -e /etc/exports ] ; then
+               # XXX: no way to detect NFSv4 is desired and so need rpc.idmapd
+               myneed="${myneed} $(
+                       awk '!/^[[:space:]]*#/ {
+                               # clear the path to avoid spurious matches
+                               $1 = "";
+                               if ($0 ~ /[(][^)]*sec=(krb|spkm)[^)]*[)]/) {
+                                       print "rpc.svcgssd"
+                                       exit 0
+                               }
+                               }' /etc/exports
+                       )"
+       fi
+       config /etc/exports
+       need portmap rpc.statd ${myneed} ${NFS_NEEDED_SERVICES}
+       use ypbind net dns rpc.rquotad rpc.idmapd rpc.svcgssd
+       after quota
+}
+
+mkdir_nfsdirs() {
+       local d
+       for d in rpc_pipefs v4recovery v4root ; do
+               d="/var/lib/nfs/${d}"
+               [ ! -d "${d}" ] && mkdir -p "${d}"
+       done
+}
+
+waitfor_exportfs() {
+       local pid=$1
+       ( sleep ${EXPORTFS_TIMEOUT:-30}; kill -9 $pid 2>/dev/null ) &
+       wait $1
+}
+
+mount_nfsd() {
+       if [ -e /proc/modules ] ; then
+               # Make sure nfs support is loaded in the kernel #64709
+               if ! grep -qs nfsd /proc/filesystems ; then
+                       modprobe -q nfsd
+               fi
+               # Restart idmapd if needed #220747
+               if grep -qs nfsd /proc/modules ; then
+                       killall -q -HUP rpc.idmapd
+               fi
+       fi
+
+       # This is the new "kernel 2.6 way" to handle the exports file
+       if grep -qs nfsd /proc/filesystems ; then
+               if ! grep -qs "nfsd /proc/fs/nfsd" /proc/mounts ; then
+                       ebegin "Mounting nfsd filesystem in /proc"
+                       mount -t nfsd -o nodev,noexec,nosuid nfsd /proc/fs/nfsd
+                       eend $?
+               fi
+
+               local o
+               for o in ${OPTS_NFSD} ; do
+                       echo "${o#*=}" > "/proc/fs/nfsd/${o%%=*}"
+               done
+       fi
+}
+
+start_it() {
+       ebegin "Starting NFS $1"
+       shift
+       "$@"
+       eend $?
+       ret=$((ret + $?))
+}
+start() {
+       mount_nfsd
+       mkdir_nfsdirs
+
+       # Exportfs likes to hang if networking isn't working.
+       # If that's the case, then try to kill it so the
+       # bootup process can continue.
+       if grep -qs '^[[:space:]]*/' /etc/exports ; then
+               ebegin "Exporting NFS directories"
+               ${exportfs} -r &
+               waitfor_exportfs $!
+               eend $?
+       fi
+
+       local ret=0
+       start_it mountd ${mountd} ${OPTS_RPC_MOUNTD}
+       start_it daemon ${nfsd} ${OPTS_RPC_NFSD}
+       [ -x "${smnotify}" ] && start_it smnotify ${smnotify} ${OPTS_SMNOTIFY}
+       return ${ret}
+}
+
+stop() {
+       local ret=0
+
+       ebegin "Stopping NFS mountd"
+       start-stop-daemon --stop --exec ${mountd}
+       eend $?
+       ret=$((ret + $?))
+
+       # nfsd sets its process name to [nfsd] so don't look for $nfsd
+       ebegin "Stopping NFS daemon"
+       start-stop-daemon --stop --name nfsd --user root --signal 2
+       eend $?
+       ret=$((ret + $?))
+       # in case things don't work out ... #228127
+       rpc.nfsd 0
+
+       # When restarting the NFS server, running "exportfs -ua" probably
+       # isn't what the user wants.  Running it causes all entries listed
+       # in xtab to be removed from the kernel export tables, and the
+       # xtab file is cleared. This effectively shuts down all NFS
+       # activity, leaving all clients holding stale NFS filehandles,
+       # *even* when the NFS server has restarted.
+       #
+       # That's what you would want if you were shutting down the NFS
+       # server for good, or for a long period of time, but not when the
+       # NFS server will be running again in short order.  In this case,
+       # then "exportfs -r" will reread the xtab, and all the current
+       # clients will be able to resume NFS activity, *without* needing
+       # to umount/(re)mount the filesystem.
+       if [ "${restarting}" = no -o "${RC_CMD}" = "restart" ] ; then
+               ebegin "Unexporting NFS directories"
+               # Exportfs likes to hang if networking isn't working.
+               # If that's the case, then try to kill it so the
+               # shutdown process can continue.
+               ${exportfs} -ua &
+               waitfor_exportfs $!
+               eend $?
+       fi
+
+       return ${ret}
+}
+
+reload() {
+       # Exportfs likes to hang if networking isn't working.
+       # If that's the case, then try to kill it so the
+       # bootup process can continue.
+       ebegin "Reloading /etc/exports"
+       ${exportfs} -r 1>&2 &
+       waitfor_exportfs $!
+       eend $?
+}
+
+restart() {
+       # See long comment in stop() regarding "restarting" and exportfs -ua
+       restarting=yes
+       svc_stop
+       svc_start
+}
diff --git a/init.d/nfsmount b/init.d/nfsmount
new file mode 100755 (executable)
index 0000000..62bf028
--- /dev/null
@@ -0,0 +1,48 @@
+#!/sbin/runscript
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-fs/nfs-utils/files/nfsmount.initd,v 1.14 2010/06/28 21:03:11 vapier Exp $
+
+[ -e /etc/conf.d/nfs ] && . /etc/conf.d/nfs
+
+depend() {
+       local myneed=""
+       if [ -e /etc/fstab ] ; then
+               myneed="${myneed} $(
+                       awk '!/^[[:space:]]*#/ && ($3 == "nfs" || $3 == "nfs4") {
+                                       if ($3 == "nfs4")
+                                               idmapd = "rpc.idmapd"
+                                       if ($4 ~ /sec=(krb|spkm)/)
+                                               gssd = "rpc.gssd"
+                               }
+                               END { print idmapd " " gssd }
+                               ' /etc/fstab
+                       )"
+       fi
+       config /etc/fstab
+       need net portmap rpc.statd ${myneed}
+       use ypbind dns rpc.idmapd rpc.gssd
+}
+
+start() {
+       if [ -x /usr/sbin/sm-notify ] ; then
+               ebegin "Starting NFS sm-notify"
+               /usr/sbin/sm-notify ${OPTS_SMNOTIFY}
+               eend $?
+       fi
+
+       # Make sure nfs support is loaded in the kernel #64709
+       if [ -e /proc/modules ] && ! grep -qs 'nfs$' /proc/filesystems ; then
+               modprobe -q nfs
+       fi
+
+       ebegin "Mounting NFS filesystems"
+       mount -a -t nfs,nfs4
+       eend $?
+}
+
+stop() {
+       ebegin "Unmounting NFS filesystems"
+       umount -a -t nfs,nfs4
+       eend $?
+}
diff --git a/init.d/rpc.gssd b/init.d/rpc.gssd
new file mode 100755 (executable)
index 0000000..f1b8f87
--- /dev/null
@@ -0,0 +1,24 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-fs/nfs-utils/files/rpc.gssd.initd,v 1.11 2008/10/26 09:02:47 vapier Exp $
+
+[ -e /etc/conf.d/nfs ] && . /etc/conf.d/nfs
+
+depend() {
+       use ypbind net
+       need portmap rpc.pipefs
+       after quota
+}
+
+start() {
+       ebegin "Starting gssd"
+       start-stop-daemon --start --exec /usr/sbin/rpc.gssd -- ${OPTS_RPC_GSSD}
+       eend $?
+}
+
+stop() {
+       ebegin "Stopping gssd"
+       start-stop-daemon --stop --exec /usr/sbin/rpc.gssd
+       eend $?
+}
diff --git a/init.d/rpc.idmapd b/init.d/rpc.idmapd
new file mode 100755 (executable)
index 0000000..52838b5
--- /dev/null
@@ -0,0 +1,26 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-fs/nfs-utils/files/rpc.idmapd.initd,v 1.8 2009/03/14 18:43:18 vapier Exp $
+
+[ -e /etc/conf.d/nfs ] && . /etc/conf.d/nfs
+
+rpc_bin=/usr/sbin/rpc.idmapd
+
+depend() {
+       use ypbind net
+       need portmap rpc.pipefs
+       after quota
+}
+
+start() {
+       ebegin "Starting idmapd"
+       ${rpc_bin} ${OPTS_RPC_IDMAPD}
+       eend $? "make sure DNOTIFY support is enabled ..."
+}
+
+stop() {
+       ebegin "Stopping idmapd"
+       start-stop-daemon --stop --exec ${rpc_bin}
+       eend $?
+}
diff --git a/init.d/rpc.pipefs b/init.d/rpc.pipefs
new file mode 100755 (executable)
index 0000000..08467ee
--- /dev/null
@@ -0,0 +1,25 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-fs/nfs-utils/files/rpc.pipefs.initd,v 1.2 2011/06/19 23:04:36 vapier Exp $
+
+mount_pipefs() {
+       local fstype=rpc_pipefs mntpoint=/var/lib/nfs/rpc_pipefs
+
+       # if things are already mounted, nothing to do
+       mountinfo -q ${mntpoint} && return 0
+
+       # if rpc_pipefs is not available, try to load sunrpc for it #219566
+       grep -qs ${fstype} /proc/filesystems || modprobe -q sunrpc
+       # if still not available, the `mount` will issue an error for the user
+
+       # now just do it for kicks
+       mkdir -p ${mntpoint}
+       mount -t ${fstype} ${fstype} ${mntpoint}
+}
+
+start() {
+       ebegin "Setting up RPC pipefs"
+       mount_pipefs
+       eend $? "make sure you have NFS/SUNRPC enabled in your kernel"
+}
diff --git a/init.d/rpc.statd b/init.d/rpc.statd
new file mode 100755 (executable)
index 0000000..14f8b34
--- /dev/null
@@ -0,0 +1,33 @@
+#!/sbin/runscript
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-fs/nfs-utils/files/rpc.statd.initd,v 1.7 2009/01/31 22:16:11 vapier Exp $
+
+[ -e /etc/conf.d/nfs ] && . /etc/conf.d/nfs
+
+rpc_bin=/sbin/rpc.statd
+rpc_pid=/var/run/rpc.statd.pid
+
+depend() {
+       use ypbind net
+       need portmap
+       after quota
+}
+
+start() {
+       # Don't start rpc.statd if already started by someone else ...
+       # Don't try and kill it if it's already dead ...
+       if killall -q -0 ${rpc_bin} ; then
+               return 0
+       fi
+
+       ebegin "Starting NFS statd"
+       start-stop-daemon --start --exec ${rpc_bin} -- --no-notify ${OPTS_RPC_STATD}
+       eend $?
+}
+
+stop() {
+       ebegin "Stopping NFS statd"
+       start-stop-daemon --stop --exec ${rpc_bin} --pidfile /var/run/rpc.statd.pid
+       eend $?
+}
diff --git a/init.d/rpc.svcgssd b/init.d/rpc.svcgssd
new file mode 100755 (executable)
index 0000000..74383e2
--- /dev/null
@@ -0,0 +1,24 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-fs/nfs-utils/files/rpc.svcgssd.initd,v 1.5 2008/10/26 09:02:47 vapier Exp $
+
+[ -e /etc/conf.d/nfs ] && . /etc/conf.d/nfs
+
+depend() {
+       use ypbind net
+       need portmap rpc.pipefs
+       after quota
+}
+
+start() {
+       ebegin "Starting svcgssd"
+       start-stop-daemon --start --exec /usr/sbin/rpc.svcgssd -- ${OPTS_RPC_SVCGSSD}
+       eend $?
+}
+
+stop() {
+       ebegin "Stopping svcgssd"
+       start-stop-daemon --stop --exec /usr/sbin/rpc.svcgssd
+       eend $?
+}