summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Telka <marcel.telka@nexenta.com>2015-07-09 22:09:37 +0200
committerRobert Mustacchi <rm@joyent.com>2015-07-30 08:34:09 -0700
commit50b1420592e389f7ad93528e20c703aff72dc15e (patch)
tree41c2038f0532211839402093c0aa658947f2728f
parent1f183ba0b0be3e10202501aa3740753df6512804 (diff)
downloadillumos-joyent-50b1420592e389f7ad93528e20c703aff72dc15e.tar.gz
6088 Unable to enable the nfs/server service when nothing is shared
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com> Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Reviewed by: Toomas Soome <tsoome@me.com> Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com> Reviewed by: Richard Elling <Richard.Elling@RichardElling.com> Reviewed by: Rich Lowe <richlowe@richlowe.net> Approved by: Robert Mustacchi <rm@joyent.com>
-rw-r--r--usr/src/cmd/fs.d/nfs/svc/nfs-server53
1 files changed, 17 insertions, 36 deletions
diff --git a/usr/src/cmd/fs.d/nfs/svc/nfs-server b/usr/src/cmd/fs.d/nfs/svc/nfs-server
index b0c6d155a5..1c7391b8df 100644
--- a/usr/src/cmd/fs.d/nfs/svc/nfs-server
+++ b/usr/src/cmd/fs.d/nfs/svc/nfs-server
@@ -19,9 +19,10 @@
#
# CDDL HEADER END
#
+
#
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
-# Copyright 2012 Nexenta Systems, Inc. All rights reserved.
#
# Start/stop processes required for server NFS
@@ -76,50 +77,30 @@ case "$1" in
# the shares would have been started long before getting here since
# nfsd has a dependency on them.
- startnfsd=0
-
# restart stopped shares from the repository
/usr/sbin/sharemgr start -P nfs -a
- # Start up mountd and nfsd if anything is exported.
-
- if /usr/bin/grep -s nfs /etc/dfs/sharetab >/dev/null; then
- startnfsd=1
- fi
-
- # If auto-enable behavior is disabled, always start nfsd
-
- if [ `svcprop -p application/auto_enable nfs/server` = "false" ]; then
- startnfsd=1
- fi
-
# Options for nfsd are now set in SMF
- if [ $startnfsd -ne 0 ]; then
- /usr/lib/nfs/mountd
- rc=$?
- if [ $rc != 0 ]; then
- /usr/sbin/svcadm mark -t maintenance svc:/network/nfs/server
- echo "$0: mountd failed with $rc"
- sleep 5 &
- exit $SMF_EXIT_ERR_FATAL
- fi
- /usr/lib/nfs/nfsd
- rc=$?
- if [ $rc != 0 ]; then
- /usr/sbin/svcadm mark -t maintenance svc:/network/nfs/server
- echo "$0: nfsd failed with $rc"
- sleep 5 &
- exit $SMF_EXIT_ERR_FATAL
- fi
+ /usr/lib/nfs/mountd
+ rc=$?
+ if [ $rc != 0 ]; then
+ /usr/sbin/svcadm mark -t maintenance svc:/network/nfs/server
+ echo "$0: mountd failed with $rc"
+ sleep 5 &
+ exit $SMF_EXIT_ERR_FATAL
+ fi
- configure_ipfilter
- else
- /usr/sbin/svcadm disable -t svc:/network/nfs/server
- echo "No NFS filesystems are shared"
+ /usr/lib/nfs/nfsd
+ rc=$?
+ if [ $rc != 0 ]; then
+ /usr/sbin/svcadm mark -t maintenance svc:/network/nfs/server
+ echo "$0: nfsd failed with $rc"
sleep 5 &
+ exit $SMF_EXIT_ERR_FATAL
fi
+ configure_ipfilter
;;
'refresh')