1 |
#!/bin/sh |
2 |
# |
3 |
# yppasswdd: Starts the yp-passwdd, the YP password changing server |
4 |
# |
5 |
# Version: @(#) /etc/init.d/yppasswdd 1.0 |
6 |
# |
7 |
# chkconfig: 2345 66 34 |
8 |
# description: yppasswdd is the RPC server that lets users change their \ |
9 |
# passwords in the presence of NIS (a.k.a. YP). It must be \ |
10 |
# run on the NIS master server for that NIS domain. The client \ |
11 |
# program is knwon as yppasswd in most cases. |
12 |
# processname: rpc.yppasswdd |
13 |
# |
14 |
### BEGIN INIT INFO |
15 |
# Provides: yppasswdd |
16 |
# Required-Start: $portmap ypserv |
17 |
# Required-Stop: $portmap |
18 |
# Default-Start: 2 3 4 5 |
19 |
# Default-Stop: 0 6 |
20 |
# Short-Description: The YP password changing server |
21 |
# Description: yppasswdd is the RPC server that lets users change their |
22 |
# passwords in the presence of NIS (a.k.a. YP). It must be |
23 |
# run on the NIS master server for that NIS domain. The client |
24 |
# program is knwon as yppasswd in most cases. |
25 |
### END INIT INFO |
26 |
|
27 |
# Source function library. |
28 |
if [ -f /etc/init.d/functions ] ; then |
29 |
. /etc/init.d/functions |
30 |
elif [ -f /etc/rc.d/init.d/functions ] ; then |
31 |
. /etc/rc.d/init.d/functions |
32 |
else |
33 |
exit 0 |
34 |
fi |
35 |
|
36 |
# getting the YP-Domainname |
37 |
. /etc/sysconfig/network |
38 |
|
39 |
RETVAL=0 |
40 |
|
41 |
start() { |
42 |
echo -n "Starting YP passwd service: " |
43 |
daemon rpc.yppasswdd |
44 |
RETVAL=$? |
45 |
echo |
46 |
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/yppasswdd |
47 |
return $RETVAL |
48 |
} |
49 |
|
50 |
stop() { |
51 |
echo -n "Stopping YP passwd service: " |
52 |
killproc rpc.yppasswdd |
53 |
RETVAL=$? |
54 |
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/yppasswdd |
55 |
echo |
56 |
return $RETVAL |
57 |
} |
58 |
|
59 |
# See how we were called. |
60 |
case "$1" in |
61 |
start) |
62 |
start |
63 |
;; |
64 |
stop) |
65 |
stop |
66 |
;; |
67 |
status) |
68 |
status rpc.yppasswdd |
69 |
;; |
70 |
restart|reload) |
71 |
stop |
72 |
start |
73 |
;; |
74 |
condrestart) |
75 |
if [ -f /var/lock/subsys/yppasswdd ]; then |
76 |
stop |
77 |
start |
78 |
fi |
79 |
;; |
80 |
*) |
81 |
echo "Usage: $0 {start|stop|status|restart|reload|condrestart}" |
82 |
exit 1 |
83 |
esac |
84 |
|
85 |
exit $RETVAL |
86 |
|