60 lines
1.2 KiB
Bash
Executable File
60 lines
1.2 KiB
Bash
Executable File
#! /bin/bash
|
|
# Copyright (c) 2002, 2004 SuSE Linux AG
|
|
# Copyright (c) 2000, 2001 SuSE GmbH
|
|
#
|
|
# Author: Thorsten Kukuk <feedback@suse.de>
|
|
#
|
|
# /etc/init.d/ypserv
|
|
#
|
|
# System startup script for the NIS daemon
|
|
#
|
|
### BEGIN INIT INFO
|
|
# Provides: ypserv
|
|
# Required-Start: $remote_fs $portmap
|
|
# Should-Start: slpd
|
|
# Should-Stop: $null
|
|
# Required-Stop: $remote_fs $portmap
|
|
# Default-Start: 3 5
|
|
# Default-Stop: 0 1 2 6
|
|
# Short-Description: Start ypserv daemon
|
|
# Description: Start ypserv to distribute NIS maps
|
|
### END INIT INFO
|
|
|
|
YPSERV_BIN=/usr/sbin/ypserv
|
|
test -x $YPSERV_BIN || { echo "$YPSERV_BIN not installed";
|
|
if [ "$1" = "stop" ]; then exit 0; else exit 5; fi; }
|
|
|
|
. /etc/sysconfig/rc
|
|
. ${rc_functions}
|
|
|
|
case "$1" in
|
|
start)
|
|
boot_mesg "Starting ypserv... "
|
|
loadproc $YPSERV_BIN
|
|
;;
|
|
stop)
|
|
boot_mesg "Stopping ypserv... "
|
|
killproc $YPSERV_BIN
|
|
;;
|
|
restart)
|
|
$0 stop
|
|
sleep 1
|
|
$0 start
|
|
;;
|
|
status)
|
|
boot_mesg "Checking for ypserv: "
|
|
statusproc $YPSERV_BIN
|
|
exit $?
|
|
;;
|
|
probe)
|
|
test /etc/ypserv.conf -nt /var/run/ypserv.pid && echo reload
|
|
test /var/yp/securenets -nt /var/run/ypserv.pid && echo reload
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {start|stop|status|restart|probe}"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0
|