Репозитории ALT
5.1: | 2.2beta51-alt1 |
4.1: | 2.2beta51-alt1 |
4.0: | 2.2beta51-alt1 |
3.0: | 2.2beta51-alt1 |
Группа :: Сети/Прочее
Пакет: nfs-server-userland
Главная Изменения Спек Патчи Исходники Загрузить Gear Bugs and FR Repocop
#!/bin/sh
#
# nfs This shell script takes care of starting and stopping
# the NFS services.
#
# chkconfig: 234 60 20
# 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.
# probe: true
WITHOUT_RC_COMPAT=1
# Source function library.
. /etc/init.d/functions
# Source networking configuration.
# Check that networking is up.
SourceIfNotEmpty /etc/sysconfig/network && [ "$NETWORKING" != no ] || exit
SourceIfNotEmpty /etc/sysconfig/vserver
NFSD=/usr/sbin/rpc.nfsd
MOUNTD=/usr/sbin/rpc.mountd
EXPORTFS=/usr/sbin/exportfs
RPCINFO=/usr/sbin/rpcinfo
EXPORTS=/etc/exports
[ -x "$NFSD" -a -x "$MOUNTD" ] || exit
SourceIfNotEmpty /etc/sysconfig/nfs
# set defaults
[ -z "$MOUNTD_NFS_V2" ] && MOUNTD_NFS_V2=auto
[ -z "$MOUNTD_NFS_V3" ] && MOUNTD_NFS_V3=auto
[ -z "$NFSDCOUNT" ] && NFSDCOUNT=8
LOCKFILE=/var/lock/subsys/nfs
RETVAL=0
start()
{
# Don't start anything when exports is empty
[ -s "$EXPORTS" ] || return
# nfsd
action $"Starting NFS daemon: " $CHBIND $NFSD
RETVAL=$?
[ $RETVAL -eq 0 ] || return
# mountd
[ -n "$MOUNTD_PORT" ] \
&& MOUNTD_OPTIONS="$MOUNTD_OPTIONS -P $MOUNTD_PORT"
[ "$MOUNTD_TCP" = "no" -o "$MOUNTD_TCP" = "NO" ] \
&& MOUNTD_OPTIONS="$MOUNTD_OPTIONS --no-tcp"
msg_starting $"NFS mount"
start_daemon --no-announce -- $CHBIND $MOUNTD $MOUNTD_OPTIONS
RETVAL=$?
[ $RETVAL -eq 0 ] || return
touch "$LOCKFILE"
return $RETVAL
}
stop()
{
# Stop daemons.
msg_stopping $"NFS mount"
stop_daemon --no-announce -- $MOUNTD
msg_stopping $"NFS daemon"
stop_daemon --no-announce -- $NFSD
# Do it the last so that clients can still access the server
# when the server is running.
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f "$LOCKFILE"
return $RETVAL
}
restart()
{
stop
start
}
reload()
{
action "Reexporting NFS file systems:" kill -SIGHUP $NFSD
RETVAL=$?
[ $RETVAL -eq 0 ] && touch "$LOCKFILE"
return $RETVAL
}
statuses()
{
status $MOUNTD
status $NFSD
RETVAL=$?
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
reload)
reload
;;
condstop)
if [ -e "$LOCKFILE" ]; then
stop
fi
;;
condrestart)
if [ -e "$LOCKFILE" ]; then
restart
fi
;;
status)
statuses
;;
*)
msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|status}"
RETVAL=1
esac
exit $RETVAL