This commit is contained in:
parent
78917d4e0d
commit
f284600b48
137
gssd.init
137
gssd.init
@ -1,137 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
# Copyright (c) 1996 - 2005 SuSE GmbH Nuernberg, Germany. All rights reserved.
|
|
||||||
#
|
|
||||||
# Author: Florian La Roche <florian@suse.de>, 1996
|
|
||||||
# Werner Fink <werner@suse.de>, 1996,98
|
|
||||||
# Burchard Steinbild <bs@suse.de>, 1997
|
|
||||||
# Thorsten Kukuk <kukuk@suse.de>, 2000,01
|
|
||||||
#
|
|
||||||
# /etc/init.d/gssd
|
|
||||||
#
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: gssd
|
|
||||||
# Required-Start: $network $remote_fs $named portmap
|
|
||||||
# Required-Stop: $network portmap
|
|
||||||
# Should-Start: ypbind krb5kdc
|
|
||||||
# Should-Stop:
|
|
||||||
# Default-Start: 3 5
|
|
||||||
# Default-Stop: 0 1 2 6
|
|
||||||
# Description: Start the RPC GSS security daemon
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
. /etc/sysconfig/nfs
|
|
||||||
|
|
||||||
# Shell functions sourced from /etc/rc.status:
|
|
||||||
# rc_check check and set local and overall rc status
|
|
||||||
# rc_status check and set local and overall rc status
|
|
||||||
# rc_status -v ditto but be verbose in local rc status
|
|
||||||
# rc_status -v -r ditto and clear the local rc status
|
|
||||||
# rc_failed set local and overall rc status to failed
|
|
||||||
# rc_failed <num> set local and overall rc status to <num><num>
|
|
||||||
# rc_reset clear local rc status (overall remains)
|
|
||||||
# rc_exit exit appropriate to overall rc status
|
|
||||||
. /etc/rc.status
|
|
||||||
|
|
||||||
# First reset status of this service
|
|
||||||
rc_reset
|
|
||||||
|
|
||||||
# Return values acc. to LSB for all commands but status:
|
|
||||||
# 0 - success
|
|
||||||
# 1 - generic or unspecified error
|
|
||||||
# 2 - invalid or excess argument(s)
|
|
||||||
# 3 - unimplemented feature (e.g. "reload")
|
|
||||||
# 4 - insufficient privilege
|
|
||||||
# 5 - program is not installed
|
|
||||||
# 6 - program is not configured
|
|
||||||
# 7 - program is not running
|
|
||||||
#
|
|
||||||
# Note that starting an already running service, stopping
|
|
||||||
# or restarting a not-running service as well as the restart
|
|
||||||
# with force-reload (in case signalling is not supported) are
|
|
||||||
# considered a success.
|
|
||||||
|
|
||||||
function mount_rpc_pipefs {
|
|
||||||
|
|
||||||
# See if the file system is there yet
|
|
||||||
case `stat -c "%t" -f /var/lib/nfs/rpc_pipefs` in
|
|
||||||
*67596969*)
|
|
||||||
return 0;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
echo -n " (mounting rpc_pipefs)"
|
|
||||||
mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs
|
|
||||||
}
|
|
||||||
|
|
||||||
case $NFS_SECURITY_GSS in
|
|
||||||
[Nn]*) flavors="";;
|
|
||||||
[Yy]*) flavors=krb5;;
|
|
||||||
*) flavors="$NFS_SECURITY_GSS";;
|
|
||||||
esac
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
start)
|
|
||||||
echo -n "Starting RPC GSS security daemon"
|
|
||||||
if [ -n "$flavors" ]; then
|
|
||||||
echo -n " ($flavors)"
|
|
||||||
for flavor in $flavors; do
|
|
||||||
/sbin/modprobe rpcsec_gss_$flavor
|
|
||||||
done
|
|
||||||
|
|
||||||
mount_rpc_pipefs
|
|
||||||
/usr/sbin/rpc.gssd
|
|
||||||
rc_status -v
|
|
||||||
else
|
|
||||||
rc_status -u
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
if checkproc /usr/sbin/rpc.gssd; then
|
|
||||||
echo -n "Shutting down RPC GSS security daemon"
|
|
||||||
killproc -TERM /usr/sbin/rpc.gssd
|
|
||||||
rc_status -v
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
try-restart)
|
|
||||||
## Stop the service and if this succeeds (i.e. the
|
|
||||||
## service was running before), start it again.
|
|
||||||
$0 status >/dev/null && $0 restart
|
|
||||||
|
|
||||||
# Remember status and be quiet
|
|
||||||
rc_status
|
|
||||||
;;
|
|
||||||
restart)
|
|
||||||
## Stop the service and regardless of whether it was
|
|
||||||
## running or not, start it again.
|
|
||||||
$0 stop
|
|
||||||
$0 start
|
|
||||||
|
|
||||||
# Remember status and be quiet
|
|
||||||
rc_status
|
|
||||||
;;
|
|
||||||
reload|force-reload)
|
|
||||||
if checkproc /usr/sbin/rpc.gssd; then
|
|
||||||
$0 restart
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
status)
|
|
||||||
echo -n "Checking for RPC GSS security daemon: "
|
|
||||||
## Check status with checkproc(8), if process is running
|
|
||||||
## checkproc will return with exit status 0.
|
|
||||||
|
|
||||||
# Status has a slightly different for the status command:
|
|
||||||
# 0 - service running
|
|
||||||
# 1 - service dead, but /var/run/ pid file exists
|
|
||||||
# 2 - service dead, but /var/lock/ lock file exists
|
|
||||||
# 3 - service not running
|
|
||||||
|
|
||||||
# NOTE: checkproc returns LSB compliant status values.
|
|
||||||
checkproc /usr/sbin/rpc.gssd
|
|
||||||
rc_status -v
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
rc_exit
|
|
144
idmapd.init
144
idmapd.init
@ -1,144 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
# Copyright (c) 1996 - 2005 SuSE GmbH Nuernberg, Germany. All rights reserved.
|
|
||||||
#
|
|
||||||
# Author: Florian La Roche <florian@suse.de>, 1996
|
|
||||||
# Werner Fink <werner@suse.de>, 1996,98
|
|
||||||
# Burchard Steinbild <bs@suse.de>, 1997
|
|
||||||
# Thorsten Kukuk <kukuk@suse.de>, 2000,01
|
|
||||||
#
|
|
||||||
# /etc/init.d/idmapd
|
|
||||||
#
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: idmapd
|
|
||||||
# Required-Start: $network $remote_fs $named portmap
|
|
||||||
# Required-Stop: $network portmap
|
|
||||||
# Should-Start: ypbind krb5kdc
|
|
||||||
# Should-Stop:
|
|
||||||
# Default-Start: 3 5
|
|
||||||
# Default-Stop: 0 1 2 6
|
|
||||||
# Description: Start the NFSv4 ID mapping daemon
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
. /etc/sysconfig/nfs
|
|
||||||
|
|
||||||
# Shell functions sourced from /etc/rc.status:
|
|
||||||
# rc_check check and set local and overall rc status
|
|
||||||
# rc_status check and set local and overall rc status
|
|
||||||
# rc_status -v ditto but be verbose in local rc status
|
|
||||||
# rc_status -v -r ditto and clear the local rc status
|
|
||||||
# rc_failed set local and overall rc status to failed
|
|
||||||
# rc_failed <num> set local and overall rc status to <num><num>
|
|
||||||
# rc_reset clear local rc status (overall remains)
|
|
||||||
# rc_exit exit appropriate to overall rc status
|
|
||||||
. /etc/rc.status
|
|
||||||
|
|
||||||
# First reset status of this service
|
|
||||||
rc_reset
|
|
||||||
|
|
||||||
# Return values acc. to LSB for all commands but status:
|
|
||||||
# 0 - success
|
|
||||||
# 1 - generic or unspecified error
|
|
||||||
# 2 - invalid or excess argument(s)
|
|
||||||
# 3 - unimplemented feature (e.g. "reload")
|
|
||||||
# 4 - insufficient privilege
|
|
||||||
# 5 - program is not installed
|
|
||||||
# 6 - program is not configured
|
|
||||||
# 7 - program is not running
|
|
||||||
#
|
|
||||||
# Note that starting an already running service, stopping
|
|
||||||
# or restarting a not-running service as well as the restart
|
|
||||||
# with force-reload (in case signalling is not supported) are
|
|
||||||
# considered a success.
|
|
||||||
|
|
||||||
function mount_rpc_pipefs {
|
|
||||||
|
|
||||||
# See if the file system is there yet
|
|
||||||
case `stat -c "%t" -f /var/lib/nfs/rpc_pipefs` in
|
|
||||||
*67596969*)
|
|
||||||
return 0;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
echo -n " (mounting rpc_pipefs)"
|
|
||||||
mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs
|
|
||||||
}
|
|
||||||
|
|
||||||
function umount_rpc_pipefs {
|
|
||||||
|
|
||||||
case `stat -c "%t" -f /var/lib/nfs/rpc_pipefs` in
|
|
||||||
*67596969*)
|
|
||||||
umount /var/lib/nfs/rpc_pipefs;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
start)
|
|
||||||
echo -n "Starting NFSv4 ID mapping daemon"
|
|
||||||
if [ "$NFS4_SUPPORT" = "yes" ]; then
|
|
||||||
mount_rpc_pipefs
|
|
||||||
/usr/sbin/rpc.idmapd
|
|
||||||
rc_status -v
|
|
||||||
else
|
|
||||||
rc_status -u
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
if [ "$NFS4_SUPPORT" = "yes" ]; then
|
|
||||||
echo -n "Shutting down NFSv4 ID mapping daemon"
|
|
||||||
killproc -TERM /usr/sbin/rpc.idmapd
|
|
||||||
rc_status
|
|
||||||
umount_rpc_pipefs
|
|
||||||
rc_status -v
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
try-restart)
|
|
||||||
## Stop the service and if this succeeds (i.e. the
|
|
||||||
## service was running before), start it again.
|
|
||||||
$0 status >/dev/null && $0 restart
|
|
||||||
|
|
||||||
# Remember status and be quiet
|
|
||||||
rc_status
|
|
||||||
;;
|
|
||||||
restart)
|
|
||||||
## Stop the service and regardless of whether it was
|
|
||||||
## running or not, start it again.
|
|
||||||
$0 stop
|
|
||||||
$0 start
|
|
||||||
|
|
||||||
# Remember status and be quiet
|
|
||||||
rc_status
|
|
||||||
;;
|
|
||||||
reload|force-reload)
|
|
||||||
echo -n "Reload NFSv4 ID mapping daemon"
|
|
||||||
if [ "$NFS4_SUPPORT" = "yes" ]; then
|
|
||||||
killproc -HUP /usr/sbin/rpc.idmapd
|
|
||||||
rc_status -v
|
|
||||||
else
|
|
||||||
rc_status -u
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
status)
|
|
||||||
echo -n "Checking for NFSv4 ID mapping daemon: "
|
|
||||||
## Check status with checkproc(8), if process is running
|
|
||||||
## checkproc will return with exit status 0.
|
|
||||||
|
|
||||||
# Status has a slightly different for the status command:
|
|
||||||
# 0 - service running
|
|
||||||
# 1 - service dead, but /var/run/ pid file exists
|
|
||||||
# 2 - service dead, but /var/lock/ lock file exists
|
|
||||||
# 3 - service not running
|
|
||||||
|
|
||||||
# NOTE: checkproc returns LSB compliant status values.
|
|
||||||
if [ "$NFS4_SUPPORT" = "yes" ]; then
|
|
||||||
checkproc /usr/sbin/rpc.idmapd
|
|
||||||
else
|
|
||||||
rc_failed 3
|
|
||||||
fi
|
|
||||||
rc_status -v
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
rc_exit
|
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:899844fd86f8b5b2a1a606be3adbc4645d2118e2d56a390028eef6272f0dcc4c
|
|
||||||
size 548247
|
|
3
nfs-utils-1.1.0.tar.bz2
Normal file
3
nfs-utils-1.1.0.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:a5465ac4fac37888b25ddc12ab6c223641562c13042ad327fdb73e79e8bcc32a
|
||||||
|
size 558403
|
@ -1,11 +0,0 @@
|
|||||||
--- nfs-utils-1.0.12/utils/gssd/krb5_util.c
|
|
||||||
+++ nfs-utils-1.0.12/utils/gssd/krb5_util.c
|
|
||||||
@@ -191,7 +191,7 @@
|
|
||||||
namelist[i]->d_name);
|
|
||||||
snprintf(statname, sizeof(statname),
|
|
||||||
"%s/%s", ccachedir, namelist[i]->d_name);
|
|
||||||
- if (stat(statname, &tmp_stat)) {
|
|
||||||
+ if (lstat(statname, &tmp_stat)) {
|
|
||||||
printerr(0, "Error doing stat on file '%s'\n",
|
|
||||||
statname);
|
|
||||||
free(namelist[i]);
|
|
@ -1,17 +0,0 @@
|
|||||||
--- aclocal/kerberos5.m4
|
|
||||||
+++ aclocal/kerberos5.m4
|
|
||||||
@@ -34,9 +34,12 @@
|
|
||||||
KRBLIBS=`$K5CONFIG --libs gssapi`
|
|
||||||
K5VERS=`$K5CONFIG --version | head -n 1 | awk '{split($(4),v,"."); if (v@<:@"3"@:>@ == "") v@<:@"3"@:>@ = "0"; print v@<:@"1"@:>@v@<:@"2"@:>@v@<:@"3"@:>@ }'`
|
|
||||||
AC_DEFINE_UNQUOTED(KRB5_VERSION, $K5VERS, [Define this as the Kerberos version number])
|
|
||||||
- if test -f $dir/include/gssapi/gssapi_krb5.h -a \
|
|
||||||
+ if test \( -f $dir/include/gssapi/gssapi_krb5.h -o \
|
|
||||||
+ -f /usr/include/gssapi/gssapi_krb5.h \) -a \
|
|
||||||
\( -f $dir/lib/libgssapi_krb5.a -o \
|
|
||||||
- -f $dir/lib/libgssapi_krb5.so \) ; then
|
|
||||||
+ -f $dir/lib/libgssapi_krb5.so -o \
|
|
||||||
+ -f /usr/lib/libgssapi_krb5.so -o \
|
|
||||||
+ -f /usr/lib64/libgssapi_krb5.so \) ; then
|
|
||||||
AC_DEFINE(HAVE_KRB5, 1, [Define this if you have MIT Kerberos libraries])
|
|
||||||
KRBDIR="$dir"
|
|
||||||
dnl If we are using MIT K5 1.3.1 and before, we *MUST* use the
|
|
@ -1,22 +0,0 @@
|
|||||||
--- Makefile.am
|
|
||||||
+++ Makefile.am 2006/08/08 21:55:21
|
|
||||||
@@ -47,7 +47,7 @@
|
|
||||||
mkdir -p $(DESTDIR)$(statedir)/sm $(DESTDIR)$(statedir)/sm.bak
|
|
||||||
touch $(DESTDIR)$(statedir)/state
|
|
||||||
chmod go-rwx $(DESTDIR)$(statedir)/sm $(DESTDIR)$(statedir)/sm.bak $(DESTDIR)$(statedir)/state
|
|
||||||
- chown $(statduser) $(DESTDIR)$(statedir)/sm $(DESTDIR)$(statedir)/sm.bak $(DESTDIR)$(statedir)/state
|
|
||||||
+ -chown $(statduser) $(DESTDIR)$(statedir)/sm $(DESTDIR)$(statedir)/sm.bak $(DESTDIR)$(statedir)/state
|
|
||||||
|
|
||||||
uninstall-hook:
|
|
||||||
rm $(DESTDIR)$(statedir)/xtab
|
|
||||||
--- Makefile.in
|
|
||||||
+++ Makefile.in 2006/08/08 21:55:30
|
|
||||||
@@ -691,7 +691,7 @@
|
|
||||||
mkdir -p $(DESTDIR)$(statedir)/sm $(DESTDIR)$(statedir)/sm.bak
|
|
||||||
touch $(DESTDIR)$(statedir)/state
|
|
||||||
chmod go-rwx $(DESTDIR)$(statedir)/sm $(DESTDIR)$(statedir)/sm.bak $(DESTDIR)$(statedir)/state
|
|
||||||
- chown $(statduser) $(DESTDIR)$(statedir)/sm $(DESTDIR)$(statedir)/sm.bak $(DESTDIR)$(statedir)/state
|
|
||||||
+ -chown $(statduser) $(DESTDIR)$(statedir)/sm $(DESTDIR)$(statedir)/sm.bak $(DESTDIR)$(statedir)/state
|
|
||||||
|
|
||||||
uninstall-hook:
|
|
||||||
rm $(DESTDIR)$(statedir)/xtab
|
|
@ -1,43 +0,0 @@
|
|||||||
--- utils/statd/monitor.c
|
|
||||||
+++ utils/statd/monitor.c 2002/08/01 14:38:29
|
|
||||||
@@ -233,7 +233,18 @@
|
|
||||||
dprintf(L_DEBUG, "UNMONITORING %s for %s",
|
|
||||||
mon_name, my_name);
|
|
||||||
nlist_free(&rtnl, clnt);
|
|
||||||
+ /* Do not unlink the monitor file. There are
|
|
||||||
+ * cases when a lock is cleared locally on the
|
|
||||||
+ * NFS client, but not on the server. We
|
|
||||||
+ * need to make sure these get freed at least
|
|
||||||
+ * on the next boot.
|
|
||||||
+ * We might also want to make an attempt in
|
|
||||||
+ * the kernel to do a NLM_FREE_ALL call the next time
|
|
||||||
+ * we mount something from this host.
|
|
||||||
+ */
|
|
||||||
+#if 0
|
|
||||||
xunlink(SM_DIR, mon_name, 1);
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
return (&result);
|
|
||||||
} else
|
|
||||||
--- utils/statd/state.c
|
|
||||||
+++ utils/statd/state.c 2002/08/01 14:38:29
|
|
||||||
@@ -59,6 +59,7 @@
|
|
||||||
if (MY_NAME == NULL) {
|
|
||||||
char fullhost[SM_MAXSTRLEN + 1];
|
|
||||||
struct hostent *hostinfo;
|
|
||||||
+ char *dot;
|
|
||||||
|
|
||||||
if (gethostname (fullhost, SM_MAXSTRLEN) == -1)
|
|
||||||
die ("gethostname: %s", strerror (errno));
|
|
||||||
@@ -69,6 +70,11 @@
|
|
||||||
strncpy (fullhost, hostinfo->h_name, sizeof (fullhost) - 1);
|
|
||||||
fullhost[sizeof (fullhost) - 1] = '\0';
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ /* SuSE hack: strip off .local domain; the server will surely
|
|
||||||
+ * be unable to resolve the name */
|
|
||||||
+ if ((dot = strrchr(fullhost, '.')) && !strcasecmp(dot, ".local"))
|
|
||||||
+ *dot = '\0';
|
|
||||||
|
|
||||||
MY_NAME = xstrdup (fullhost);
|
|
||||||
}
|
|
@ -1,3 +1,20 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Jun 5 16:15:58 CEST 2007 - mkoenig@suse.de
|
||||||
|
|
||||||
|
- update to version 1.1.0:
|
||||||
|
- package mount.nfs, umount.nfs to replace dropped nfs code
|
||||||
|
from util-linux mount.
|
||||||
|
- removed patches:
|
||||||
|
nfs-utils-noroot.patch
|
||||||
|
nfs-utils-gssd-select-ccache.patch
|
||||||
|
nfs-utils-krb5.patch
|
||||||
|
- Package split: nfs-common, nfs-server and nfs-doc
|
||||||
|
- adjust init scripts
|
||||||
|
- remove old Obsoletes/Provides:
|
||||||
|
nfsutils (last used 2001)
|
||||||
|
knfsd (last used 2000)
|
||||||
|
linuxnfs (last used 1999)
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Feb 27 08:52:29 CET 2007 - ro@suse.de
|
Tue Feb 27 08:52:29 CET 2007 - ro@suse.de
|
||||||
|
|
||||||
|
256
nfs-utils.spec
256
nfs-utils.spec
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# spec file for package nfs-utils (Version 1.0.12)
|
# spec file for package nfs-utils (Version 1.1.0)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||||
# This file and all modifications and additions to the pristine
|
# This file and all modifications and additions to the pristine
|
||||||
@ -14,32 +14,24 @@ Name: nfs-utils
|
|||||||
BuildRequires: e2fsprogs-devel gcc-c++ krb5-devel libevent librpcsecgss nfsidmap openldap2-devel pkgconfig tcpd-devel
|
BuildRequires: e2fsprogs-devel gcc-c++ krb5-devel libevent librpcsecgss nfsidmap openldap2-devel pkgconfig tcpd-devel
|
||||||
URL: http://nfs.sourceforge.net
|
URL: http://nfs.sourceforge.net
|
||||||
Summary: Support Utilities for Kernel nfsd
|
Summary: Support Utilities for Kernel nfsd
|
||||||
Version: 1.0.12
|
Version: 1.1.0
|
||||||
Release: 1
|
Release: 1
|
||||||
Group: Productivity/Networking/NFS
|
Group: Productivity/Networking/NFS
|
||||||
Obsoletes: knfsd linuxnfs nfsutils
|
Obsoletes: nfs-utils <= 1.1.0
|
||||||
Provides: knfsd linuxnfs nfsutils
|
Provides: nfs-utils = %{version}
|
||||||
License: GNU General Public License (GPL)
|
License: GNU General Public License (GPL)
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
Requires: portmap
|
|
||||||
Conflicts: nfs-server
|
|
||||||
PreReq: %fillup_prereq %insserv_prereq
|
PreReq: %fillup_prereq %insserv_prereq
|
||||||
Autoreqprov: on
|
Autoreqprov: on
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
Source0: ftp://ftp.sourceforge.net/pub/sourceforge/n/nf/nfs/nfs-utils-%{version}.tar.bz2
|
Source0: ftp://ftp.sourceforge.net/pub/sourceforge/n/nf/nfs/nfs-utils-%{version}.tar.bz2
|
||||||
Source1: ftp://nfs.sourceforge.net/pub/nfs/nfs.doc.tar.bz2
|
Source1: ftp://nfs.sourceforge.net/pub/nfs/nfs.doc.tar.bz2
|
||||||
Source10: nfsserver.init
|
Source2: nfs.init
|
||||||
Source12: sysconfig.nfs-nfs-utils
|
Source3: nfsserver.init
|
||||||
Source13: idmapd.init
|
Source4: sysconfig.nfs-nfs-utils
|
||||||
Source14: gssd.init
|
Source5: nfs-kernel-server.xml
|
||||||
Source15: svcgssd.init
|
Patch0: nfs-utils-largefiles.patch
|
||||||
Source16: nfsserver.xml
|
Patch1: nfs-utils-1.0.7-bind-syntax.patch
|
||||||
Patch1: nfs-utils-nsm.patch
|
|
||||||
Patch2: nfs-utils-largefiles.patch
|
|
||||||
Patch4: nfs-utils-noroot.patch
|
|
||||||
Patch5: nfs-utils-gssd-select-ccache.patch
|
|
||||||
Patch6: nfs-utils-krb5.patch
|
|
||||||
Patch7: nfs-utils-1.0.7-bind-syntax.patch
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
This package contains the NFS utilities. You can tune the number of
|
This package contains the NFS utilities. You can tune the number of
|
||||||
@ -48,19 +40,68 @@ quota over NFS support, install the quota package.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Authors:
|
||||||
|
--------
|
||||||
|
Olaf Kirch <okir@monad.swb.de>
|
||||||
|
H.J. Lu <hjl@valinux.com>
|
||||||
|
|
||||||
|
%package -n nfs-client
|
||||||
|
Group: Productivity/Networking/NFS
|
||||||
|
Summary: Support Utilities for Kernel nfsd
|
||||||
|
Conflicts: nfs-server
|
||||||
|
Requires: portmap
|
||||||
|
|
||||||
|
%description -n nfs-client
|
||||||
|
This package contains the NFS utilities. You can tune the number of
|
||||||
|
server threads via the sysconfig variable USE_KERNEL_NFSD_NUMBER. For
|
||||||
|
quota over NFS support, install the quota package.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Authors:
|
||||||
|
--------
|
||||||
|
Olaf Kirch <okir@monad.swb.de>
|
||||||
|
H.J. Lu <hjl@valinux.com>
|
||||||
|
|
||||||
|
%package -n nfs-kernel-server
|
||||||
|
Group: Productivity/Networking/NFS
|
||||||
|
Summary: Support Utilities for Kernel nfsd
|
||||||
|
Provides: nfs-utils = %{version}
|
||||||
|
Conflicts: nfs-server
|
||||||
|
Requires: nfs-client = %{version} portmap
|
||||||
|
|
||||||
|
%description -n nfs-kernel-server
|
||||||
|
This package contains the NFS utilities. You can tune the number of
|
||||||
|
server threads via the sysconfig variable USE_KERNEL_NFSD_NUMBER. For
|
||||||
|
quota over NFS support, install the quota package.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Authors:
|
||||||
|
--------
|
||||||
|
Olaf Kirch <okir@monad.swb.de>
|
||||||
|
H.J. Lu <hjl@valinux.com>
|
||||||
|
|
||||||
|
%package -n nfs-doc
|
||||||
|
Group: Productivity/Networking/NFS
|
||||||
|
Summary: Support Utilities for Kernel nfsd
|
||||||
|
|
||||||
|
%description -n nfs-doc
|
||||||
|
This package contains the NFS utilities. You can tune the number of
|
||||||
|
server threads via the sysconfig variable USE_KERNEL_NFSD_NUMBER. For
|
||||||
|
quota over NFS support, install the quota package.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Authors:
|
Authors:
|
||||||
--------
|
--------
|
||||||
Olaf Kirch <okir@monad.swb.de>
|
Olaf Kirch <okir@monad.swb.de>
|
||||||
H.J. Lu <hjl@valinux.com>
|
H.J. Lu <hjl@valinux.com>
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -a 1
|
%setup -q -n nfs-utils-%{version} -a 1
|
||||||
%patch1
|
%patch0 -p1
|
||||||
%patch2 -p1
|
%patch1 -p1
|
||||||
%patch4
|
|
||||||
%patch5 -p1
|
|
||||||
%patch6
|
|
||||||
%patch7 -p1
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%{?suse_update_config:%{suse_update_config -f }}
|
%{?suse_update_config:%{suse_update_config -f }}
|
||||||
@ -70,119 +111,140 @@ CFLAGS="$RPM_OPT_FLAGS -fPIE -fno-strict-aliasing" LDFLAGS="-pie" ./configure \
|
|||||||
--disable-rquotad \
|
--disable-rquotad \
|
||||||
--enable-nfsv4 \
|
--enable-nfsv4 \
|
||||||
--enable-gss \
|
--enable-gss \
|
||||||
|
--enable-mount \
|
||||||
--with-krb5=/usr/lib/mit
|
--with-krb5=/usr/lib/mit
|
||||||
make
|
make
|
||||||
|
|
||||||
%install
|
%install
|
||||||
make install DESTDIR=$RPM_BUILD_ROOT
|
make install DESTDIR=$RPM_BUILD_ROOT
|
||||||
# we do not need this anymore
|
|
||||||
rm -fv $RPM_BUILD_ROOT/usr/sbin/rpc.statd
|
|
||||||
rm -fv $RPM_BUILD_ROOT/%{_mandir}/man8/statd.8*
|
|
||||||
rm -fv $RPM_BUILD_ROOT/%{_mandir}/man8/rpc.statd.8*
|
|
||||||
# move lockd to /sbin
|
|
||||||
install -d $RPM_BUILD_ROOT/sbin
|
|
||||||
mv $RPM_BUILD_ROOT/usr/sbin/rpc.lockd $RPM_BUILD_ROOT/sbin
|
|
||||||
# rc-script
|
# rc-script
|
||||||
install -d $RPM_BUILD_ROOT/etc/init.d
|
install -d $RPM_BUILD_ROOT/etc/init.d
|
||||||
install -m 744 %{SOURCE10} $RPM_BUILD_ROOT/etc/init.d/nfsserver
|
install -m 744 %{SOURCE3} $RPM_BUILD_ROOT/etc/init.d/nfsserver
|
||||||
|
install -m 744 %{SOURCE2} $RPM_BUILD_ROOT/etc/init.d/nfs
|
||||||
ln -sf ../../etc/init.d/nfsserver $RPM_BUILD_ROOT/usr/sbin/rcnfsserver
|
ln -sf ../../etc/init.d/nfsserver $RPM_BUILD_ROOT/usr/sbin/rcnfsserver
|
||||||
|
ln -sf ../../etc/init.d/nfs $RPM_BUILD_ROOT/usr/sbin/rcnfs
|
||||||
# sysconfig-data
|
# sysconfig-data
|
||||||
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
|
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
|
||||||
install -m 644 %{SOURCE12} $RPM_BUILD_ROOT/var/adm/fillup-templates
|
install -m 644 %{SOURCE4} $RPM_BUILD_ROOT/var/adm/fillup-templates
|
||||||
# remove file provided by util-linux
|
|
||||||
rm -f $RPM_BUILD_ROOT/var/lib/nfs/state
|
|
||||||
# idmapd setup
|
# idmapd setup
|
||||||
install -m 644 utils/idmapd/idmapd.conf $RPM_BUILD_ROOT/etc/idmapd.conf
|
install -m 644 utils/idmapd/idmapd.conf $RPM_BUILD_ROOT/etc/idmapd.conf
|
||||||
install -m 755 %{SOURCE13} $RPM_BUILD_ROOT/etc/init.d/idmapd
|
|
||||||
ln -sf ../../etc/init.d/idmapd $RPM_BUILD_ROOT/usr/sbin/rcidmapd
|
|
||||||
#
|
|
||||||
install -m 755 %{SOURCE14} $RPM_BUILD_ROOT/etc/init.d/gssd
|
|
||||||
ln -sf ../../etc/init.d/gssd $RPM_BUILD_ROOT/usr/sbin/rcgssd
|
|
||||||
install -m 755 %{SOURCE15} $RPM_BUILD_ROOT/etc/init.d/svcgssd
|
|
||||||
ln -sf ../../etc/init.d/svcgssd $RPM_BUILD_ROOT/usr/sbin/rcsvcgssd
|
|
||||||
mkdir -p -m 755 $RPM_BUILD_ROOT/var/lib/nfs/rpc_pipefs
|
mkdir -p -m 755 $RPM_BUILD_ROOT/var/lib/nfs/rpc_pipefs
|
||||||
mkdir -p -m 755 $RPM_BUILD_ROOT/var/lib/nfs/v4recovery
|
mkdir -p -m 755 $RPM_BUILD_ROOT/var/lib/nfs/v4recovery
|
||||||
mkdir -p -m 755 $RPM_BUILD_ROOT/usr/share/omc/srvinfo.d
|
mkdir -p -m 755 $RPM_BUILD_ROOT/usr/share/omc/srvinfo.d
|
||||||
install -m 644 %{SOURCE16} $RPM_BUILD_ROOT/usr/share/omc/srvinfo.d
|
install -m 644 %{SOURCE5} $RPM_BUILD_ROOT/usr/share/omc/srvinfo.d
|
||||||
|
# sm-notify state
|
||||||
|
mkdir -p -m 755 $RPM_BUILD_ROOT/var/lib/nfs/sm
|
||||||
|
mkdir -p -m 755 $RPM_BUILD_ROOT/var/lib/nfs/sm.bak
|
||||||
|
touch $RPM_BUILD_ROOT/var/lib/nfs/state
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
%preun
|
%post -n nfs-client
|
||||||
%stop_on_removal nfsserver
|
|
||||||
%stop_on_removal idmapd
|
|
||||||
%stop_on_removal gssd
|
|
||||||
%stop_on_removal svcgssd
|
|
||||||
|
|
||||||
%post
|
|
||||||
%{fillup_and_insserv -s nfsserver NFS_SERVER}
|
|
||||||
%{fillup_only -an nfs}
|
%{fillup_only -an nfs}
|
||||||
%{fillup_only -an idmapd}
|
|
||||||
%{fillup_only -an gssd}
|
|
||||||
%{fillup_only -an svcgssd}
|
|
||||||
|
|
||||||
%postun
|
%preun -n nfs-client
|
||||||
%restart_on_update nfsserver
|
%stop_on_removal nfs
|
||||||
%restart_on_update idmapd
|
|
||||||
%restart_on_update gssd
|
%postun -n nfs-client
|
||||||
%restart_on_update svcgssd
|
%restart_on_update nfs
|
||||||
%insserv_cleanup
|
%insserv_cleanup
|
||||||
|
|
||||||
%files
|
%preun -n nfs-kernel-server
|
||||||
|
%stop_on_removal nfsserver
|
||||||
|
|
||||||
|
%post -n nfs-kernel-server
|
||||||
|
%{fillup_and_insserv -s nfsserver NFS_SERVER}
|
||||||
|
|
||||||
|
%postun -n nfs-kernel-server
|
||||||
|
%restart_on_update nfsserver
|
||||||
|
%insserv_cleanup
|
||||||
|
|
||||||
|
%files -n nfs-client
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%doc nfs/*.html nfs/*.ps linux-nfs/*
|
%config /etc/init.d/nfs
|
||||||
/var/adm/fillup-templates/sysconfig.nfs-nfs-utils
|
%config /etc/idmapd.conf
|
||||||
%dir /var/lib/nfs
|
%attr(0755,root,root) /sbin/mount.nfs
|
||||||
%config(noreplace) /var/lib/nfs/xtab
|
/sbin/mount.nfs4
|
||||||
%config(noreplace) /var/lib/nfs/etab
|
%attr(0755,root,root) /sbin/umount.nfs
|
||||||
%config(noreplace) /var/lib/nfs/rmtab
|
/sbin/umount.nfs4
|
||||||
%dir /var/lib/nfs/rpc_pipefs
|
|
||||||
%dir /var/lib/nfs/v4recovery
|
|
||||||
/usr/sbin/exportfs
|
|
||||||
/usr/sbin/gss_clnt_send_err
|
/usr/sbin/gss_clnt_send_err
|
||||||
/usr/sbin/gss_destroy_creds
|
/usr/sbin/gss_destroy_creds
|
||||||
/usr/sbin/nfsstat
|
/usr/sbin/nfsstat
|
||||||
/usr/sbin/showmount
|
/usr/sbin/rcnfs
|
||||||
/usr/sbin/rcnfsserver
|
|
||||||
/usr/sbin/rcidmapd
|
|
||||||
/usr/sbin/rcgssd
|
|
||||||
/usr/sbin/rcsvcgssd
|
|
||||||
/usr/sbin/rpc.mountd
|
|
||||||
/usr/sbin/rpc.nfsd
|
|
||||||
/usr/sbin/rpc.gssd
|
/usr/sbin/rpc.gssd
|
||||||
/usr/sbin/rpc.idmapd
|
/usr/sbin/rpc.idmapd
|
||||||
/usr/sbin/rpc.svcgssd
|
/usr/sbin/rpc.statd
|
||||||
/usr/sbin/rpcdebug
|
/usr/sbin/rpcdebug
|
||||||
/sbin/rpc.lockd
|
/usr/sbin/showmount
|
||||||
%config /etc/init.d/nfsserver
|
/usr/sbin/sm-notify
|
||||||
%config /etc/init.d/idmapd
|
/usr/sbin/start-statd
|
||||||
%config /etc/init.d/gssd
|
|
||||||
%config /etc/init.d/svcgssd
|
|
||||||
%config /etc/idmapd.conf
|
|
||||||
%dir /usr/share/omc
|
|
||||||
%dir /usr/share/omc/srvinfo.d
|
|
||||||
/usr/share/omc/srvinfo.d/nfsserver.xml
|
|
||||||
%{_mandir}/man5/exports.5.gz
|
|
||||||
%{_mandir}/man5/idmapd.conf.5.gz
|
%{_mandir}/man5/idmapd.conf.5.gz
|
||||||
%{_mandir}/man7/nfsd.7.gz
|
%{_mandir}/man5/nfs.5.gz
|
||||||
%{_mandir}/man8/exportfs.8.gz
|
%{_mandir}/man8/mount.nfs.8.gz
|
||||||
%{_mandir}/man8/nfsstat.8.gz
|
%{_mandir}/man8/nfsstat.8.gz
|
||||||
|
%{_mandir}/man8/rpc.sm-notify.8.gz
|
||||||
%{_mandir}/man8/showmount.8.gz
|
%{_mandir}/man8/showmount.8.gz
|
||||||
%{_mandir}/man8/mountd.8.gz
|
%{_mandir}/man8/sm-notify.8.gz
|
||||||
|
%{_mandir}/man8/umount.nfs.8.gz
|
||||||
%{_mandir}/man8/rpc.gssd.8.gz
|
%{_mandir}/man8/rpc.gssd.8.gz
|
||||||
%{_mandir}/man8/rpc.idmapd.8.gz
|
%{_mandir}/man8/rpc.idmapd.8.gz
|
||||||
%{_mandir}/man8/rpc.mountd.8.gz
|
|
||||||
%{_mandir}/man8/rpc.lockd.8.gz
|
|
||||||
%{_mandir}/man8/nfsd.8.gz
|
|
||||||
%{_mandir}/man8/rpc.nfsd.8.gz
|
|
||||||
%{_mandir}/man8/lockd.8.gz
|
|
||||||
%{_mandir}/man8/gssd.8.gz
|
%{_mandir}/man8/gssd.8.gz
|
||||||
%{_mandir}/man8/idmapd.8.gz
|
%{_mandir}/man8/idmapd.8.gz
|
||||||
%{_mandir}/man8/svcgssd.8.gz
|
%{_mandir}/man8/svcgssd.8.gz
|
||||||
%{_mandir}/man8/rpc.svcgssd.8.gz
|
%{_mandir}/man8/rpc.statd.8.gz
|
||||||
%{_mandir}/man8/rpcdebug.8.gz
|
%{_mandir}/man8/rpcdebug.8.gz
|
||||||
|
%{_mandir}/man8/statd.8.gz
|
||||||
|
/var/adm/fillup-templates/sysconfig.nfs-nfs-utils
|
||||||
|
%dir /var/lib/nfs
|
||||||
|
%dir /var/lib/nfs/rpc_pipefs
|
||||||
|
%dir /var/lib/nfs/v4recovery
|
||||||
|
%dir /var/lib/nfs/sm
|
||||||
|
%dir /var/lib/nfs/sm.bak
|
||||||
|
%ghost /var/lib/nfs/state
|
||||||
|
|
||||||
|
%files -n nfs-kernel-server
|
||||||
|
%defattr(-,root,root)
|
||||||
|
%config /etc/init.d/nfsserver
|
||||||
|
/usr/sbin/exportfs
|
||||||
|
/usr/sbin/rcnfsserver
|
||||||
|
/usr/sbin/rpc.mountd
|
||||||
|
/usr/sbin/rpc.nfsd
|
||||||
|
/usr/sbin/rpc.svcgssd
|
||||||
|
%{_mandir}/man5/exports.5.gz
|
||||||
|
%{_mandir}/man7/nfsd.7.gz
|
||||||
|
%{_mandir}/man8/exportfs.8.gz
|
||||||
|
%{_mandir}/man8/mountd.8.gz
|
||||||
|
%{_mandir}/man8/nfsd.8.gz
|
||||||
|
%{_mandir}/man8/rpc.mountd.8.gz
|
||||||
|
%{_mandir}/man8/rpc.nfsd.8.gz
|
||||||
|
%{_mandir}/man8/rpc.svcgssd.8.gz
|
||||||
|
%dir /usr/share/omc
|
||||||
|
%dir /usr/share/omc/srvinfo.d
|
||||||
|
/usr/share/omc/srvinfo.d/nfs-kernel-server.xml
|
||||||
|
%config(noreplace) /var/lib/nfs/xtab
|
||||||
|
%config(noreplace) /var/lib/nfs/etab
|
||||||
|
%config(noreplace) /var/lib/nfs/rmtab
|
||||||
|
|
||||||
|
%files -n nfs-doc
|
||||||
|
%defattr(-,root,root)
|
||||||
|
%doc nfs/*.html nfs/*.ps linux-nfs/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Jun 05 2007 - mkoenig@suse.de
|
||||||
|
- update to version 1.1.0:
|
||||||
|
- package mount.nfs, umount.nfs to replace dropped nfs code
|
||||||
|
from util-linux mount.
|
||||||
|
- removed patches:
|
||||||
|
nfs-utils-noroot.patch
|
||||||
|
nfs-utils-gssd-select-ccache.patch
|
||||||
|
nfs-utils-krb5.patch
|
||||||
|
- Package split: nfs-common, nfs-server and nfs-doc
|
||||||
|
- adjust init scripts
|
||||||
|
- remove old Obsoletes/Provides:
|
||||||
|
nfsutils (last used 2001)
|
||||||
|
knfsd (last used 2000)
|
||||||
|
linuxnfs (last used 1999)
|
||||||
* Tue Feb 27 2007 - ro@suse.de
|
* Tue Feb 27 2007 - ro@suse.de
|
||||||
- update to 1.0.12
|
- update to 1.0.12
|
||||||
- Fix -n option to mountd
|
- Fix -n option to mountd
|
||||||
|
267
nfs.init
Normal file
267
nfs.init
Normal file
@ -0,0 +1,267 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
# Copyright (c) 1996-2002 SuSE Linux AG, Nuernberg, Germany.
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Author: Florian La Roche, 1996
|
||||||
|
# Werner Fink <werner@suse.de>, 1996
|
||||||
|
# Burchard Steinbild, 1996
|
||||||
|
#
|
||||||
|
# Please send feedback to http://www.suse.de/feedback
|
||||||
|
#
|
||||||
|
# /etc/init.d/nfs
|
||||||
|
#
|
||||||
|
### BEGIN INIT INFO
|
||||||
|
# Provides: nfs
|
||||||
|
# Required-Start: $network $portmap
|
||||||
|
# Required-Stop:
|
||||||
|
# Default-Start: 3 5
|
||||||
|
# Default-Stop:
|
||||||
|
# Short-Description: NFS client services
|
||||||
|
# Description: All necessary services for NFS clients
|
||||||
|
### END INIT INFO
|
||||||
|
|
||||||
|
. /etc/rc.status
|
||||||
|
. /etc/sysconfig/nfs
|
||||||
|
|
||||||
|
IDMAPD_BIN=/usr/sbin/rpc.idmapd
|
||||||
|
GSSD_BIN=/usr/sbin/rpc.gssd
|
||||||
|
|
||||||
|
IDMAPD_CLIENT_STATE=/var/lock/subsys/nfs-rpc.idmapd
|
||||||
|
IDMAPD_SERVER_STATE=/var/lock/subsys/nfsserver-rpc.idmapd
|
||||||
|
|
||||||
|
NEED_IDMAPD=no
|
||||||
|
NEED_GSSD=no
|
||||||
|
nfs=no
|
||||||
|
NEED_LDCONFIG=no
|
||||||
|
|
||||||
|
while read where what type options rest ; do
|
||||||
|
case "$where" in
|
||||||
|
\#*|"") ;;
|
||||||
|
*) case "$options" in
|
||||||
|
*noauto*) ;;
|
||||||
|
*) if test "$type" = "nfs" -o "$type" = "nfs4" ; then
|
||||||
|
nfs=yes
|
||||||
|
case "$where" in
|
||||||
|
/usr*|/opt*)
|
||||||
|
NEED_LDCONFIG=yes
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
if grep -q "^$where" /etc/ld.so.conf; then
|
||||||
|
NEED_LDCONFIG=yes
|
||||||
|
break;
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi ;;
|
||||||
|
esac
|
||||||
|
esac
|
||||||
|
done < /etc/fstab
|
||||||
|
|
||||||
|
case $NFS_SECURITY_GSS in
|
||||||
|
[Nn]*) flavors="";;
|
||||||
|
[Yy]*) flavors=krb5;;
|
||||||
|
*) flavors="$NFS_SECURITY_GSS";;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ "$flavors" ]; then
|
||||||
|
NEED_GSSD=yes
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$NFS4_SUPPORT" = yes ]; then
|
||||||
|
NEED_IDMAPD=yes
|
||||||
|
fi
|
||||||
|
|
||||||
|
mount_rpc_pipefs() {
|
||||||
|
# See if the file system is there yet
|
||||||
|
case `stat -c "%t" -f /var/lib/nfs/rpc_pipefs` in
|
||||||
|
*67596969*)
|
||||||
|
return 0;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs
|
||||||
|
}
|
||||||
|
|
||||||
|
mount_usr() {
|
||||||
|
while read where what type options rest ; do
|
||||||
|
case "$where" in
|
||||||
|
\#*|"") ;;
|
||||||
|
*) case "$options" in
|
||||||
|
*noauto*) ;;
|
||||||
|
*) if test "$type" = "nfs" -o "$type" = "nfs4" ; then
|
||||||
|
case "$where" in
|
||||||
|
/usr*)
|
||||||
|
mount -o nolock $where
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi ;;
|
||||||
|
esac
|
||||||
|
esac
|
||||||
|
done < /etc/fstab
|
||||||
|
}
|
||||||
|
|
||||||
|
do_start_gssd() {
|
||||||
|
for flavor in $flavors; do
|
||||||
|
/sbin/modprobe rpcsec_gss_$flavor
|
||||||
|
done
|
||||||
|
|
||||||
|
mount_rpc_pipefs
|
||||||
|
startproc $GSSD_BIN
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
do_start_idmapd() {
|
||||||
|
mount_rpc_pipefs
|
||||||
|
|
||||||
|
# as idmapd needs to be run be server and client
|
||||||
|
# check if there is already a idmapd running
|
||||||
|
if checkproc $IDMAPD_BIN && test -f $IDMAPD_SERVER_STATE; then
|
||||||
|
killproc -HUP $IDMAPD_BIN
|
||||||
|
else
|
||||||
|
startproc $IDMAPD_BIN
|
||||||
|
fi
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
rc_reset
|
||||||
|
case "$1" in
|
||||||
|
start|reload)
|
||||||
|
echo -n "Starting NFS client services:"
|
||||||
|
# in case we need /usr via nfs
|
||||||
|
mount_usr
|
||||||
|
# sm-notify
|
||||||
|
echo -n " sm-notify"
|
||||||
|
/usr/sbin/sm-notify
|
||||||
|
# gssd
|
||||||
|
if [ "$NEED_GSSD" = yes ]; then
|
||||||
|
echo -n " gssd"
|
||||||
|
do_start_gssd
|
||||||
|
if [ $? != 0 ]; then
|
||||||
|
rc_status -v
|
||||||
|
rc_exit
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
# idmapd
|
||||||
|
if [ "$NEED_IDMAPD" = yes ]; then
|
||||||
|
echo -n " idmapd"
|
||||||
|
do_start_idmapd
|
||||||
|
if [ $? != 0 ]; then
|
||||||
|
rc_status -v
|
||||||
|
rc_exit
|
||||||
|
fi
|
||||||
|
echo $IDMAPD_BIN > $IDMAPD_CLIENT_STATE
|
||||||
|
fi
|
||||||
|
# statd is started when needed by mount.nfs
|
||||||
|
#
|
||||||
|
if test "$nfs" = yes ; then
|
||||||
|
# Mount all auto NFS devices (-> nfs(5) and mount(8) )
|
||||||
|
# NFS-Server sometime not reachable during boot phase.
|
||||||
|
# It's sometime usefull to mount NFS devices in
|
||||||
|
# background with an ampersand (&) and a sleep time of
|
||||||
|
# two or more seconds, e.g:
|
||||||
|
#
|
||||||
|
# sleep 2 && mount -at nfs,nfs4 &
|
||||||
|
# sleep 2
|
||||||
|
#
|
||||||
|
# Note: Some people importing the /usr partition.
|
||||||
|
# Therefore we do _NOT_ use an ampersand!
|
||||||
|
#
|
||||||
|
mount -at nfs,nfs4 > /dev/null 2>&1
|
||||||
|
#
|
||||||
|
# generate new list of available shared libraries
|
||||||
|
#
|
||||||
|
if test "$NEED_LDCONFIG" = yes; then
|
||||||
|
rc_status
|
||||||
|
sleep 1
|
||||||
|
# check if ld.so.cache needs to be refreshed
|
||||||
|
/etc/init.d/boot.ldconfig start > /dev/null 2>&1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
#
|
||||||
|
rc_status -v
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
echo -n "Shutting down NFS client services:"
|
||||||
|
if test "$nfs" = "yes" ; then
|
||||||
|
#
|
||||||
|
# Unmount in background because during long timeouts
|
||||||
|
#
|
||||||
|
umount -at nfs,nfs4 &
|
||||||
|
sleep 2
|
||||||
|
fi
|
||||||
|
#
|
||||||
|
if [ "$NEED_GSSD" = yes ]; then
|
||||||
|
echo -n " gssd"
|
||||||
|
killproc $GSSD_BIN
|
||||||
|
if [ $? != 0 ]; then
|
||||||
|
rc_status -v
|
||||||
|
rc_exit
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
#
|
||||||
|
if [ "$NEED_IDMAPD" = yes ]; then
|
||||||
|
# only stop idmapd if it is not needed by server
|
||||||
|
if [ ! -f $IDMAPD_SERVER_STATE ]; then
|
||||||
|
echo -n " idmapd"
|
||||||
|
killproc $IDMAPD_BIN
|
||||||
|
if [ $? != 0 ]; then
|
||||||
|
rc_status -v
|
||||||
|
rc_exit
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
rm -f $IDMAPD_CLIENT_STATE
|
||||||
|
fi
|
||||||
|
#
|
||||||
|
rc_status -v
|
||||||
|
;;
|
||||||
|
restart|force-reload)
|
||||||
|
## Stop the service and regardless of whether it was
|
||||||
|
## running or not, start it again.
|
||||||
|
$0 stop
|
||||||
|
$0 start
|
||||||
|
rc_status
|
||||||
|
;;
|
||||||
|
status)
|
||||||
|
echo -n "Checking for mounted nfs shares (from /etc/fstab):"
|
||||||
|
if test "$nfs" = "yes" ; then
|
||||||
|
while read where what type options rest ; do
|
||||||
|
case "$where" in
|
||||||
|
\#*|"") ;;
|
||||||
|
*) case "$options" in
|
||||||
|
*noauto*) ;;
|
||||||
|
*) if test "$type" = "nfs" -o "$type" = "nfs4" ; then
|
||||||
|
grep -q "$where $what nfs" /proc/mounts || rc_failed 3
|
||||||
|
fi ;;
|
||||||
|
esac
|
||||||
|
esac
|
||||||
|
done < /etc/fstab
|
||||||
|
else
|
||||||
|
rc_failed 3
|
||||||
|
fi
|
||||||
|
#
|
||||||
|
if [ "$NEED_GSSD" = yes ] && ! checkproc $GSSD_BIN; then
|
||||||
|
echo "gssd not running"
|
||||||
|
rc_failed 3
|
||||||
|
fi
|
||||||
|
#
|
||||||
|
if [ "$NEED_IDMAPD" = yes ] && ! checkproc $IDMAPD_BIN; then
|
||||||
|
echo "idmapd not running"
|
||||||
|
rc_failed 3
|
||||||
|
fi
|
||||||
|
rc_status -v
|
||||||
|
;;
|
||||||
|
try-restart|condrestart)
|
||||||
|
$0 status
|
||||||
|
if test $? = 0; then
|
||||||
|
$0 restart
|
||||||
|
else
|
||||||
|
rc_reset
|
||||||
|
fi
|
||||||
|
rc_status
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Usage: $0 {start|stop|status|reload|force-reload|restart|try-restart}"
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
rc_exit
|
202
nfsserver.init
202
nfsserver.init
@ -1,5 +1,5 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Copyright (c) 1996 - 2001 SuSE GmbH Nuernberg, Germany. All rights reserved.
|
# Copyright (c) 1996 - 2007 SuSE GmbH Nuernberg, Germany. All rights reserved.
|
||||||
#
|
#
|
||||||
# Author: Florian La Roche <florian@suse.de>, 1996
|
# Author: Florian La Roche <florian@suse.de>, 1996
|
||||||
# Werner Fink <werner@suse.de>, 1996,98
|
# Werner Fink <werner@suse.de>, 1996,98
|
||||||
@ -10,13 +10,13 @@
|
|||||||
#
|
#
|
||||||
### BEGIN INIT INFO
|
### BEGIN INIT INFO
|
||||||
# Provides: nfsserver
|
# Provides: nfsserver
|
||||||
# Required-Start: $network $remote_fs $named portmap
|
# Required-Start: $network $named portmap
|
||||||
# Required-Stop: $network portmap
|
# Required-Stop: $network portmap
|
||||||
# Should-Start: ypbind svcgssd idmapd
|
# Should-Start: ypbind krb5kdc
|
||||||
# Should-Stop:
|
# Should-Stop:
|
||||||
# Default-Start: 3 5
|
# Default-Start: 3 5
|
||||||
# Default-Stop: 0 1 2 6
|
# Default-Stop: 0 1 2 6
|
||||||
# Description: Start the kernel based NFS daemon
|
# Short-Description: Start the kernel based NFS daemon
|
||||||
### END INIT INFO
|
### END INIT INFO
|
||||||
|
|
||||||
. /etc/sysconfig/nfs
|
. /etc/sysconfig/nfs
|
||||||
@ -50,10 +50,34 @@ rc_reset
|
|||||||
# with force-reload (in case signalling is not supported) are
|
# with force-reload (in case signalling is not supported) are
|
||||||
# considered a success.
|
# considered a success.
|
||||||
|
|
||||||
|
SVCGSSD_BIN=/usr/sbin/rpc.svcgssd
|
||||||
|
IDMAPD_BIN=/usr/sbin/rpc.idmapd
|
||||||
|
NFSD_BIN=/usr/sbin/rpc.nfsd
|
||||||
|
|
||||||
|
IDMAPD_CLIENT_STATE=/var/lock/subsys/nfs-rpc.idmapd
|
||||||
|
IDMAPD_SERVER_STATE=/var/lock/subsys/nfsserver-rpc.idmapd
|
||||||
|
|
||||||
|
NEED_SVCGSSD=no
|
||||||
|
NEED_IDMPAPD=no
|
||||||
|
|
||||||
case `uname -r` in
|
case `uname -r` in
|
||||||
0.*|1.*|2.0.*) exit 3
|
0.*|1.*|2.0.*) exit 3
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
case $NFS_SECURITY_GSS in
|
||||||
|
[Nn]*) flavors="";;
|
||||||
|
[Yy]*) flavors=krb5;;
|
||||||
|
*) flavors="$NFS_SECURITY_GSS";;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ "$flavors" ]; then
|
||||||
|
NEED_SVCGSSD=yes
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$NFS4_SUPPORT" = yes ]; then
|
||||||
|
NEED_IDMAPD=yes
|
||||||
|
fi
|
||||||
|
|
||||||
check_for_nfsdfs() {
|
check_for_nfsdfs() {
|
||||||
HAVE_NFSDFS="no"
|
HAVE_NFSDFS="no"
|
||||||
while read dummy type ; do
|
while read dummy type ; do
|
||||||
@ -89,13 +113,54 @@ nfs4_unbind_mounts() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mount_rpc_pipefs() {
|
||||||
|
|
||||||
|
# See if the file system is there yet
|
||||||
|
case `stat -c "%t" -f /var/lib/nfs/rpc_pipefs` in
|
||||||
|
*67596969*)
|
||||||
|
return 0;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs
|
||||||
|
}
|
||||||
|
|
||||||
|
umount_rpc_pipefs() {
|
||||||
|
|
||||||
|
case `stat -c "%t" -f /var/lib/nfs/rpc_pipefs` in
|
||||||
|
*67596969*)
|
||||||
|
umount /var/lib/nfs/rpc_pipefs;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
do_start_svcgssd() {
|
||||||
|
for flavor in $flavors; do
|
||||||
|
/sbin/modprobe rpcsec_gss_$flavor
|
||||||
|
done
|
||||||
|
|
||||||
|
mount_rpc_pipefs
|
||||||
|
startproc $SVCGSSD_BIN
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
do_start_idmapd() {
|
||||||
|
mount_rpc_pipefs
|
||||||
|
|
||||||
|
if checkproc $IDMAPD_BIN && test -f $IDMAPD_CLIENT_STATE; then
|
||||||
|
killproc -HUP $IDMAPD_BIN
|
||||||
|
else
|
||||||
|
startproc $IDMAPD_BIN
|
||||||
|
fi
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
PARAMS=3
|
PARAMS=3
|
||||||
test "$USE_KERNEL_NFSD_NUMBER" -gt 0 && PARAMS="$USE_KERNEL_NFSD_NUMBER"
|
test "$USE_KERNEL_NFSD_NUMBER" -gt 0 && PARAMS="$USE_KERNEL_NFSD_NUMBER"
|
||||||
|
|
||||||
echo -n "Starting kernel based NFS server"
|
echo -n "Starting kernel based NFS server:"
|
||||||
modprobe nfsd
|
modprobe nfsd
|
||||||
|
# mount nfsd filesystem
|
||||||
check_for_nfsdfs
|
check_for_nfsdfs
|
||||||
if [ "$HAVE_NFSDFS" = "yes" -a ! -f /proc/fs/nfsd/exports ] ; then
|
if [ "$HAVE_NFSDFS" = "yes" -a ! -f /proc/fs/nfsd/exports ] ; then
|
||||||
mount -t nfsd nfsd /proc/fs/nfsd
|
mount -t nfsd nfsd /proc/fs/nfsd
|
||||||
@ -107,36 +172,105 @@ case "$1" in
|
|||||||
echo "+2 +3 -4" > /proc/fs/nfsd/versions
|
echo "+2 +3 -4" > /proc/fs/nfsd/versions
|
||||||
fi
|
fi
|
||||||
nfs4_bind_mounts
|
nfs4_bind_mounts
|
||||||
|
# svcgssd; idmapd
|
||||||
|
if [ "$NEED_SVCGSSD" = yes ]; then
|
||||||
|
echo -n " svcgssd"
|
||||||
|
do_start_svcgssd
|
||||||
|
if [ $? != 0 ]; then
|
||||||
|
rc_status -v
|
||||||
|
rc_exit
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [ "$NEED_IDMAPD" = yes ]; then
|
||||||
|
echo -n " idmapd"
|
||||||
|
do_start_idmapd
|
||||||
|
if [ $? != 0 ]; then
|
||||||
|
rc_status -v
|
||||||
|
rc_exit
|
||||||
|
fi
|
||||||
|
echo $IDMAPD_BIN > $IDMAPD_SERVER_STATE
|
||||||
|
fi
|
||||||
|
# exportfs
|
||||||
/usr/sbin/exportfs -r
|
/usr/sbin/exportfs -r
|
||||||
rc_status
|
# rpc.mountd
|
||||||
/usr/sbin/rpc.nfsd $PARAMS
|
echo -n " mountd"
|
||||||
rc_status
|
|
||||||
if [ -n "$MOUNTD_PORT" ] ; then
|
if [ -n "$MOUNTD_PORT" ] ; then
|
||||||
startproc /usr/sbin/rpc.mountd -p $MOUNTD_PORT
|
startproc /usr/sbin/rpc.mountd -p $MOUNTD_PORT
|
||||||
else
|
else
|
||||||
startproc /usr/sbin/rpc.mountd
|
startproc /usr/sbin/rpc.mountd
|
||||||
fi
|
fi
|
||||||
if [ "$NFS4_SUPPORT" = "yes" ]; then
|
if [ $? != 0 ]; then
|
||||||
checkproc /usr/sbin/rpc.idmapd
|
rc_status -v
|
||||||
if [ $? -eq 0 ] ; then
|
rc_exit
|
||||||
## Let idmapd know that nfs server is starting up
|
fi
|
||||||
/etc/init.d/idmapd reload
|
# rpc.statd
|
||||||
fi
|
echo -n " statd"
|
||||||
fi
|
startproc /usr/sbin/rpc.statd --no-notify
|
||||||
|
if [ $? != 0 ]; then
|
||||||
|
rc_status -v
|
||||||
|
rc_exit
|
||||||
|
fi
|
||||||
|
# rpc.nfsd
|
||||||
|
echo -n " nfsd"
|
||||||
|
$NFSD_BIN $PARAMS
|
||||||
|
if [ $? != 0 ]; then
|
||||||
|
rc_status -v
|
||||||
|
rc_exit
|
||||||
|
fi
|
||||||
|
# sm-notify needs to be run last
|
||||||
|
echo -n " sm-notify"
|
||||||
|
/usr/sbin/sm-notify
|
||||||
|
#
|
||||||
rc_status -v
|
rc_status -v
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
echo -n "Shutting down kernel based NFS server"
|
echo -n "Shutting down kernel based NFS server:"
|
||||||
|
# rpc.nfsd
|
||||||
|
echo -n " nfsd"
|
||||||
killproc -n -KILL nfsd
|
killproc -n -KILL nfsd
|
||||||
rc_status
|
if [ $? != 0 ]; then
|
||||||
|
rc_status -v
|
||||||
|
rc_exit
|
||||||
|
fi
|
||||||
|
# rpc.statd
|
||||||
|
if ! checkproc -n lockd; then
|
||||||
|
echo -n " statd"
|
||||||
|
killproc rpc.statd
|
||||||
|
fi
|
||||||
|
#
|
||||||
|
# rpc.mountd
|
||||||
|
echo -n " mountd"
|
||||||
killproc -TERM /usr/sbin/rpc.mountd
|
killproc -TERM /usr/sbin/rpc.mountd
|
||||||
rc_status
|
if [ $? != 0 ]; then
|
||||||
|
rc_status -v
|
||||||
|
rc_exit
|
||||||
|
fi
|
||||||
|
# svcgssd
|
||||||
|
if [ "$NEED_SVCGSSD" = yes ]; then
|
||||||
|
echo -n " svcgssd"
|
||||||
|
killproc $SVCGSSD_BIN
|
||||||
|
if [ $? != 0 ]; then
|
||||||
|
rc_status -v
|
||||||
|
rc_exit
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
# idmap
|
||||||
|
if [ "$NEED_IDMAPD" = yes ]; then
|
||||||
|
# kill only if not needed by client anymore
|
||||||
|
if [ ! -f $IDMAPD_CLIENT_STATE ]; then
|
||||||
|
echo -n " idmapd"
|
||||||
|
killproc $IDMAPD_BIN
|
||||||
|
fi
|
||||||
|
rm -f $IDMAPD_SERVER_STATE
|
||||||
|
fi
|
||||||
|
# umount nfsd fs
|
||||||
check_for_nfsdfs
|
check_for_nfsdfs
|
||||||
if [ "$HAVE_NFSDFS" = "yes" -a -f /proc/fs/nfsd/exports ] ; then
|
if [ "$HAVE_NFSDFS" = "yes" -a -f /proc/fs/nfsd/exports ] ; then
|
||||||
umount /proc/fs/nfsd
|
umount /proc/fs/nfsd
|
||||||
rc_status
|
rc_status
|
||||||
fi
|
fi
|
||||||
nfs4_unbind_mounts
|
nfs4_unbind_mounts
|
||||||
|
#
|
||||||
rc_status -v
|
rc_status -v
|
||||||
;;
|
;;
|
||||||
try-restart)
|
try-restart)
|
||||||
@ -164,7 +298,7 @@ case "$1" in
|
|||||||
rc_status -v
|
rc_status -v
|
||||||
;;
|
;;
|
||||||
status)
|
status)
|
||||||
echo -n "Checking for kernel based NFS server: "
|
echo -n "Checking for kernel based NFS server:"
|
||||||
## Check status with checkproc(8), if process is running
|
## Check status with checkproc(8), if process is running
|
||||||
## checkproc will return with exit status 0.
|
## checkproc will return with exit status 0.
|
||||||
|
|
||||||
@ -175,10 +309,38 @@ case "$1" in
|
|||||||
# 3 - service not running
|
# 3 - service not running
|
||||||
|
|
||||||
# NOTE: checkproc returns LSB compliant status values.
|
# NOTE: checkproc returns LSB compliant status values.
|
||||||
|
if [ "$NEED_SVCGSSD" = yes ]; then
|
||||||
|
echo -n " svcgssd"
|
||||||
|
checkproc $SVCGSSD_BIN
|
||||||
|
if [ $? != 0 ]; then
|
||||||
|
rc_status -v
|
||||||
|
rc_exit
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [ "$NEED_IDMAPD" = yes ]; then
|
||||||
|
echo -n " idmapd"
|
||||||
|
checkproc $IDMAPD_BIN
|
||||||
|
if [ $? != 0 ]; then
|
||||||
|
rc_status -v
|
||||||
|
rc_exit
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
echo -n " mountd"
|
||||||
checkproc /usr/sbin/rpc.mountd
|
checkproc /usr/sbin/rpc.mountd
|
||||||
rc_status
|
if [ $? != 0 ]; then
|
||||||
|
rc_status -v
|
||||||
|
rc_exit
|
||||||
|
fi
|
||||||
|
echo -n " statd"
|
||||||
|
checkproc /usr/sbin/rpc.statd
|
||||||
|
if [ $? != 0 ]; then
|
||||||
|
rc_status -v
|
||||||
|
rc_exit
|
||||||
|
fi
|
||||||
|
echo -n " nfsd"
|
||||||
checkproc -n nfsd
|
checkproc -n nfsd
|
||||||
rc_status -v
|
rc_status -v
|
||||||
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
|
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
|
||||||
|
137
svcgssd.init
137
svcgssd.init
@ -1,137 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
# Copyright (c) 1996 - 2005 SuSE GmbH Nuernberg, Germany. All rights reserved.
|
|
||||||
#
|
|
||||||
# Author: Florian La Roche <florian@suse.de>, 1996
|
|
||||||
# Werner Fink <werner@suse.de>, 1996,98
|
|
||||||
# Burchard Steinbild <bs@suse.de>, 1997
|
|
||||||
# Thorsten Kukuk <kukuk@suse.de>, 2000,01
|
|
||||||
#
|
|
||||||
# /etc/init.d/svcgssd
|
|
||||||
#
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: svcgssd
|
|
||||||
# Required-Start: $network $remote_fs $named portmap
|
|
||||||
# Required-Stop: $network portmap
|
|
||||||
# Should-Start: ypbind krb5kdc
|
|
||||||
# Should-Stop:
|
|
||||||
# Default-Start: 3 5
|
|
||||||
# Default-Stop: 0 1 2 6
|
|
||||||
# Description: Start the RPC GSS security daemon
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
. /etc/sysconfig/nfs
|
|
||||||
|
|
||||||
# Shell functions sourced from /etc/rc.status:
|
|
||||||
# rc_check check and set local and overall rc status
|
|
||||||
# rc_status check and set local and overall rc status
|
|
||||||
# rc_status -v ditto but be verbose in local rc status
|
|
||||||
# rc_status -v -r ditto and clear the local rc status
|
|
||||||
# rc_failed set local and overall rc status to failed
|
|
||||||
# rc_failed <num> set local and overall rc status to <num><num>
|
|
||||||
# rc_reset clear local rc status (overall remains)
|
|
||||||
# rc_exit exit appropriate to overall rc status
|
|
||||||
. /etc/rc.status
|
|
||||||
|
|
||||||
# First reset status of this service
|
|
||||||
rc_reset
|
|
||||||
|
|
||||||
# Return values acc. to LSB for all commands but status:
|
|
||||||
# 0 - success
|
|
||||||
# 1 - generic or unspecified error
|
|
||||||
# 2 - invalid or excess argument(s)
|
|
||||||
# 3 - unimplemented feature (e.g. "reload")
|
|
||||||
# 4 - insufficient privilege
|
|
||||||
# 5 - program is not installed
|
|
||||||
# 6 - program is not configured
|
|
||||||
# 7 - program is not running
|
|
||||||
#
|
|
||||||
# Note that starting an already running service, stopping
|
|
||||||
# or restarting a not-running service as well as the restart
|
|
||||||
# with force-reload (in case signalling is not supported) are
|
|
||||||
# considered a success.
|
|
||||||
|
|
||||||
function mount_rpc_pipefs {
|
|
||||||
|
|
||||||
# See if the file system is there yet
|
|
||||||
case `stat -c "%t" -f /var/lib/nfs/rpc_pipefs` in
|
|
||||||
*67596969*)
|
|
||||||
return 0;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
echo -n " (mounting rpc_pipefs)"
|
|
||||||
mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs
|
|
||||||
}
|
|
||||||
|
|
||||||
case $NFS_SECURITY_GSS in
|
|
||||||
[Nn]*) flavors="";;
|
|
||||||
[Yy]*) flavors=krb5;;
|
|
||||||
*) flavors="$NFS_SECURITY_GSS";;
|
|
||||||
esac
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
start)
|
|
||||||
echo -n "Starting RPC GSS security daemon"
|
|
||||||
if [ -n "$flavors" ]; then
|
|
||||||
echo -n " ($flavors)"
|
|
||||||
for flavor in $flavors; do
|
|
||||||
/sbin/modprobe rpcsec_gss_$flavor
|
|
||||||
done
|
|
||||||
|
|
||||||
mount_rpc_pipefs
|
|
||||||
/usr/sbin/rpc.svcgssd
|
|
||||||
rc_status -v
|
|
||||||
else
|
|
||||||
rc_status -u
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
if checkproc /usr/sbin/rpc.svcgssd; then
|
|
||||||
echo -n "Shutting down RPC GSS security daemon"
|
|
||||||
killproc -TERM /usr/sbin/rpc.svcgssd
|
|
||||||
rc_status -v
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
try-restart)
|
|
||||||
## Stop the service and if this succeeds (i.e. the
|
|
||||||
## service was running before), start it again.
|
|
||||||
$0 status >/dev/null && $0 restart
|
|
||||||
|
|
||||||
# Remember status and be quiet
|
|
||||||
rc_status
|
|
||||||
;;
|
|
||||||
restart)
|
|
||||||
## Stop the service and regardless of whether it was
|
|
||||||
## running or not, start it again.
|
|
||||||
$0 stop
|
|
||||||
$0 start
|
|
||||||
|
|
||||||
# Remember status and be quiet
|
|
||||||
rc_status
|
|
||||||
;;
|
|
||||||
reload|force-reload)
|
|
||||||
if checkproc /usr/sbin/rpc.svcgssd; then
|
|
||||||
$0 restart
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
status)
|
|
||||||
echo -n "Checking for RPC GSS security daemon: "
|
|
||||||
## Check status with checkproc(8), if process is running
|
|
||||||
## checkproc will return with exit status 0.
|
|
||||||
|
|
||||||
# Status has a slightly different for the status command:
|
|
||||||
# 0 - service running
|
|
||||||
# 1 - service dead, but /var/run/ pid file exists
|
|
||||||
# 2 - service dead, but /var/lock/ lock file exists
|
|
||||||
# 3 - service not running
|
|
||||||
|
|
||||||
# NOTE: checkproc returns LSB compliant status values.
|
|
||||||
checkproc /usr/sbin/rpc.svcgssd
|
|
||||||
rc_status -v
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
rc_exit
|
|
Loading…
x
Reference in New Issue
Block a user