File ypxfrd.init of Package ypserv

#! /bin/bash
# Copyright (c) 2002, 2004 SuSE Linux AG
# Copyright (c) 2000, 2001 SuSE GmbH
#
# Author: Thorsten Kukuk <feedback@suse.de>
#
# /etc/init.d/ypxfrd
#
#   and its symbolic link
#
# /sbin/rcypxfrd
#
# System startup script for the rpc.ypxfrd daemon
#
### BEGIN INIT INFO
# Provides: ypxfrd
# Required-Start: $remote_fs $portmap ypserv
# Required-Stop: $remote_fs $portmap
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: Start rpc.ypxfrd daemon
# Description: Start rpc.ypxfrd to allow faster NIS map transfers
### END INIT INFO

YPXFRD_BIN=/usr/sbin/rpc.ypxfrd
test -x $YPXFRD_BIN || { echo "$YPXFRD_BIN not installed";
	if [ "$1" = "stop" ]; then exit 0; else exit 5; fi; }

. /etc/rc.status

# First reset status of this service
rc_reset

case "$1" in
    start)
	echo -n "Starting rpc.ypxfrd"
	startproc $YPXFRD_BIN
	rc_status -v
	;;
    stop)
	echo -n "Shutting down rpc.ypxfrd"
	killproc -TERM $YPXFRD_BIN
	rc_status -v
	;;
    try-restart|condrestart)
        if test "$1" = "condrestart"; then
                echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
        fi
        $0 status
        if test $? = 0; then
                $0 restart
        else
                rc_reset        # Not running is not a failure.
        fi
        rc_status
	;;
    restart)
	$0 stop
	$0 start
	rc_status
	;;
    force-reload)
	echo -n "Reload service rpc.ypxfrd"
	killproc -HUP $YPXFRD_BIN
	rc_status -v
	;;
    reload)
	echo -n "Reload service rpc.ypxfrd"
	killproc -HUP $YPXFRD_BIN
	rc_status -v
	;;
    status)
	echo -n "Checking for rpc.ypxfrd: "
	checkproc $YPXFRD_BIN
	rc_status -v
	;;
    probe)
        test /etc/ypserv.conf -nt /var/run/ypxfrd.pid && echo reload
        test /var/run/securenets -nt /var/run/ypxfrd.pid && echo reload
	;;
    *)
	echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
	exit 1
	;;
esac
rc_exit