1 |
#!/bin/sh |
2 |
# |
3 |
# ypserv: Starts the yp-server |
4 |
# |
5 |
# Version: @(#) /etc/init.d/ypserv.init 1.0 |
6 |
# |
7 |
# Author: Joerg Mertin <smurphy@stargate.bln.sub.org> |
8 |
# |
9 |
# chkconfig: 2345 16 84 |
10 |
# description: ypserv is an implementation of the standard NIS/YP networking \ |
11 |
# protocol. It allows network-wide distribution of hostname, \ |
12 |
# username, and other information databases. This is the NIS \ |
13 |
# server, and is not needed on NIS clients. |
14 |
# processname: ypserv |
15 |
# |
16 |
# config: /etc/ypserv.conf |
17 |
# |
18 |
### BEGIN INIT INFO |
19 |
# Provides: ypserv |
20 |
# Required-Start: $remote_fs $portmap |
21 |
# Required-Stop: $remote_fs $portmap |
22 |
# Should-Start: slpd |
23 |
# Should-Stop: slpd |
24 |
# Default-Start: 2 3 4 5 |
25 |
# Default-Stop: 0 6 |
26 |
# Short-Description: The ypserver daemon (for a NIS/YP server) |
27 |
# Description: ypserv is an implementation of the standard NIS/YP networking |
28 |
# protocol. It allows network-wide distribution of hostname, |
29 |
# username, and other information databases. This is the NIS |
30 |
# server, and is not needed on NIS clients. |
31 |
### END INIT INFO |
32 |
|
33 |
# Source function library. |
34 |
if [ -f /etc/init.d/functions ] ; then |
35 |
. /etc/init.d/functions |
36 |
elif [ -f /etc/rc.d/init.d/functions ] ; then |
37 |
. /etc/rc.d/init.d/functions |
38 |
else |
39 |
exit 0 |
40 |
fi |
41 |
|
42 |
# getting the YP-Domainname |
43 |
. /etc/sysconfig/network |
44 |
|
45 |
RETVAL=0 |
46 |
|
47 |
start() { |
48 |
echo -n "Starting YP server services: " |
49 |
daemon ypserv |
50 |
RETVAL=$? |
51 |
echo |
52 |
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/ypserv |
53 |
return $RETVAL |
54 |
} |
55 |
|
56 |
stop() { |
57 |
echo -n "Stopping YP server services: " |
58 |
killproc ypserv |
59 |
RETVAL=$? |
60 |
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ypserv |
61 |
echo |
62 |
return $RETVAL |
63 |
} |
64 |
|
65 |
# See how we were called. |
66 |
case "$1" in |
67 |
start) |
68 |
start |
69 |
;; |
70 |
stop) |
71 |
stop |
72 |
;; |
73 |
status) |
74 |
status ypserv |
75 |
;; |
76 |
restart|reload) |
77 |
stop |
78 |
start |
79 |
;; |
80 |
condrestart) |
81 |
if [ -f /var/lock/subsys/ypserv ]; then |
82 |
stop |
83 |
start |
84 |
fi |
85 |
;; |
86 |
*) |
87 |
echo "Usage: $0 {start|stop|status|reload|restart|condrestart}" |
88 |
exit 1 |
89 |
esac |
90 |
|
91 |
exit $RETVAL |
92 |
|