2004-09-09 15:13:27 +00:00
|
|
|
#!/bin/bash
|
2004-09-09 15:13:01 +00:00
|
|
|
#
|
|
|
|
# yppasswdd: Starts the yp-passwdd, the YP password changing server
|
|
|
|
#
|
|
|
|
# Version: @(#) /etc/init.d/yppasswdd 1.0
|
|
|
|
#
|
|
|
|
# chkconfig: - 66 34
|
|
|
|
# description: yppasswdd is the RPC server that lets users change their \
|
|
|
|
# passwords in the presence of NIS (a.k.a. YP). It must be \
|
|
|
|
# run on the NIS master server for that NIS domain. The client \
|
|
|
|
# program is knwon as yppasswd in most cases.
|
|
|
|
# processname: rpc.yppasswdd
|
|
|
|
|
|
|
|
# Source function library.
|
2004-09-09 15:13:27 +00:00
|
|
|
[ -f /etc/rc.d/init.d/functions ] || exit 0
|
|
|
|
. /etc/rc.d/init.d/functions
|
2004-09-09 15:13:01 +00:00
|
|
|
|
|
|
|
# getting the YP-Domainname
|
|
|
|
. /etc/sysconfig/network
|
|
|
|
|
2004-09-09 15:15:29 +00:00
|
|
|
# Get the settings
|
|
|
|
. /etc/sysconfig/yppasswdd
|
|
|
|
|
|
|
|
if [ "$ETCDIR" ]; then
|
|
|
|
YPPASSWDD_ARGS="$YPPASSWDD_ARGS -D $ETCDIR"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$PASSWDFILE" ]; then
|
|
|
|
YPPASSWDD_ARGS="$YPPASSWDD_ARGS -p $PASSWDFILE"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$SHADOWFILE" ]; then
|
|
|
|
YPPASSWDD_ARGS="$YPPASSWDD_ARGS -s $SHADOWFILE"
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2004-09-09 15:13:01 +00:00
|
|
|
RETVAL=0
|
|
|
|
|
|
|
|
start() {
|
2004-09-09 15:13:27 +00:00
|
|
|
echo -n $"Starting YP passwd service: "
|
2004-09-09 15:14:21 +00:00
|
|
|
daemon rpc.yppasswdd $YPPASSWDD_ARGS
|
2004-09-09 15:13:01 +00:00
|
|
|
RETVAL=$?
|
|
|
|
echo
|
|
|
|
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/yppasswdd
|
|
|
|
return $RETVAL
|
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
2004-09-09 15:13:27 +00:00
|
|
|
echo -n $"Stopping YP passwd service: "
|
2004-09-09 15:13:01 +00:00
|
|
|
killproc rpc.yppasswdd
|
|
|
|
RETVAL=$?
|
|
|
|
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/yppasswdd
|
|
|
|
echo
|
|
|
|
return $RETVAL
|
|
|
|
}
|
|
|
|
|
|
|
|
# See how we were called.
|
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
start
|
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
stop
|
|
|
|
;;
|
|
|
|
status)
|
|
|
|
status rpc.yppasswdd
|
|
|
|
;;
|
|
|
|
restart|reload)
|
|
|
|
stop
|
|
|
|
start
|
|
|
|
;;
|
|
|
|
condrestart)
|
|
|
|
if [ -f /var/lock/subsys/yppasswdd ]; then
|
|
|
|
stop
|
|
|
|
start
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*)
|
2004-09-09 15:13:27 +00:00
|
|
|
echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
|
2004-09-09 15:13:01 +00:00
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit $RETVAL
|