ypserv/ypserv-ypserv.init
cvsdist 6f4560d768 auto-import changelog data from ypserv-1.3.12-2.src.rpm
Mon Aug 27 2001 Florian La Roche <Florian.LaRoche@redhat.de>
- set domainname if it is not yet set #52514
2004-09-09 15:14:37 +00:00

82 lines
1.6 KiB
Bash

#!/bin/bash
#
# ypserv: Starts the yp-server
#
# Version: @(#) /etc/init.d/ypserv.init 1.0
#
# Author: Joerg Mertin <smurphy@stargate.bln.sub.org>
#
# chkconfig: - 26 74
# description: ypserv is an implementation of the standard NIS/YP networking \
# protocol. It allows network-wide distribution of hostname, \
# username, and other information databases. This is the NIS \
# server, and is not needed on NIS clients.
# processname: ypserv
# config: /etc/ypserv.conf
# Source function library.
[ -f /etc/rc.d/init.d/functions ] || exit 0
. /etc/rc.d/init.d/functions
# getting the YP-Domainname
. /etc/sysconfig/network
RETVAL=0
start() {
DOMAINNAME=`domainname`
if [ "$DOMAINNAME" = "(none)" -o "$DOMAINNAME" = "" ]; then
if [ -n "$NISDOMAIN" ]; then
action $"Setting NIS domain name $NISDOMAIN: " domainname $NISDOMAIN
else
exit 1
fi
fi
echo -n $"Starting YP server services: "
daemon ypserv $YPSERV_ARGS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/ypserv
return $RETVAL
}
stop() {
echo -n $"Stopping YP server services: "
killproc ypserv
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ypserv
echo
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status ypserv
;;
restart)
stop
start
;;
reload)
restart
;;
condrestart)
if [ -f /var/lock/subsys/ypserv ]; then
stop
start
fi
;;
*)
echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
exit 1
esac
exit $RETVAL