ÔÚ/usr/local/binÏÂÃæ·ÅºÃÁË¿ÉÖ´ÐгÌÐò£¬²ÎÕÕÁË/etc/init.d/ypxfrd £¬ÉÔ΢¸ÄÁËһϣ¬Ð´³ÉÁËÏÂÃæÕâ¸ö½Å±¾£¬ÔËÐÐÕâ¸ö½Å±¾(È¡ÃûΪteststart),red hat 9.0ϱ¨´í,˵ÎÞÕâ¸öÎļþ»òÕßĿ¼/etc/rc.d/init.d/functions! ÎÒÈ¥´ËĿ¼Ï¿´ÁË,´æÔÚ¸ÃÎļþ,²¢ÇÒÎÒÓÃshell ÔËÐÐypxfrd,¿ÉÒÔÕý³£Ö´ÐÐ. ¿ÉÎÒÖ»ÊÇÐÞ¸ÄÁ˼¸´¦µØ·½.ÏÂÃæÊÇÎÒ¸ÄдµÄ½Å±¾,ÎÒµÚÒ»´ÎдÕⶫÎ÷,Ïë±Ø»¹ÓÐÆäËû´íÎó.Çë¸ßÊÖÖ¸½Ì
#!/bin/bash
#
# Elink DG: Starts the Elink DG
#
# Version: @(#) /etc/init.d/elinkdg 1.0
# Source function library.
[ -f /etc/rc.d/init.d/functions ] || exit 0
. /etc/rc.d/init.d/functions
# The application programe path.
# add sosdairs
[ -f /usr/local/bin/elinkdg] || exit 0
RETVAL=0
start() {
echo -n $"Starting Elink DG server: "
# modify by sosdairs
# here has a error? YPXFRD_ARGS?
daemon elinkdg $YPXFRD_ARGS
ETVAL=$?
echo
# modify by sosdairs
[ $RETVAL -eq 0 ] && touch /usr/local/bin/elinkdginfo
return $RETVAL
}
stop() {
echo -n $"Stopping Elink DG server: "
killproc elinkdg
RETVAL=$?
# modify by sosdairs
[ $RETVAL -eq 0 ] && rm -f /usr/local/bin/elinkdginfo
echo
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status rpc.ypxfrd
;;
restart|reload)
stop
start
;;
condrestart)
if [ -f /usr/local/bin/elinkdginfo ]; then
stop
start
fi
;;
*)
echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
exit 1
esac
exit $RETVAL