nfs-server revision dd51520e127b452179a2ce4ea3bd8dee949f9afe
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai# CDDL HEADER START
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai# The contents of this file are subject to the terms of the
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai# Common Development and Distribution License (the "License").
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai# You may not use this file except in compliance with the License.
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai# See the License for the specific language governing permissions
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai# and limitations under the License.
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai# When distributing Covered Code, include this CDDL HEADER in each
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai# If applicable, add the following below this CDDL HEADER, with the
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai# fields enclosed by brackets "[]" replaced with your own identifying
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai# information: Portions Copyright [yyyy] [name of copyright owner]
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai# CDDL HEADER END
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai# Start/stop processes required for server NFS
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai# Handling a corner case here. If we were in offline state due to an
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai# unsatisfied dependency, the ipf_method process wouldn't have generated
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai# the ipfilter configuration. When we transition to online because the
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai# dependency is satisfied, the start method will have to generate the
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai# ipfilter configuration. To avoid all possible deadlock scenarios,
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai# we restart ipfilter which will regenerate the ipfilter configuration
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai# for the entire system.
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai# The ipf_method process signals that it didn't generate ipf rules by
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai# removing the service's ipf file. Thus we only restart network/ipfilter
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai# when the file is missing.
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai [ "`get_policy $SMF_FMRI`" = "use_global" ] && return 0
d62bc4badc1c1f1549c961cfb8b420e650e1272byz # The NFS server is not supported in a local zone
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai echo "The NFS server is not supported in a local zone"
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai # Share all file systems enabled for sharing. sharemgr understands
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai # regular shares and ZFS shares and will handle both. Technically,
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai # the shares would have been started long before getting here since
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai # nfsd has a dependency on them.
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai # restart stopped shares from the repository
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai # Start up mountd and nfsd if anything is exported.
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai if /usr/bin/grep -s nfs /etc/dfs/sharetab >/dev/null; then
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai # If auto-enable behavior is disabled, always start nfsd
facf4a8d7b59fde89a8662b4f4c73a758e6c402cllai if [ `svcprop -p application/auto_enable nfs/server` = "false" ]; then
rc=$?
echo "$0: mountd failed with $rc"
exit $SMF_EXIT_ERR_FATAL
rc=$?
echo "$0: nfsd failed with $rc"
exit $SMF_EXIT_ERR_FATAL
exit $SMF_EXIT_OK
if [ -n "$tport" ]; then
if [ -n "$uport" ]; then
if [ -n "$tports" ]; then
if [ -n "$uports" ]; then
if [ -n "$tports" ]; then
if [ -n "$uports" ]; then
if [ -n "$tports" ]; then
if [ -n "$uports" ]; then
exit $SMF_EXIT_OK