1From 0ef1a95b220c7e110da950e5cc544c50c25b1bc6 Mon Sep 17 00:00:00 2001
2From: Li xin <lixin.fnst@cn.fujitsu.com>
3Date: Tue, 18 Nov 2014 18:11:56 +0900
4Subject: [PATCH 4/5] rarpd.init : add new init file
5
6Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
7---
8 rarpd.init | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
9 1 file changed, 96 insertions(+)
10 create mode 100644 rarpd.init
11
12diff --git a/rarpd.init b/rarpd.init
13new file mode 100644
14index 0000000..efcf825
15--- /dev/null
16+++ b/rarpd.init
17@@ -0,0 +1,96 @@
18+#!/bin/bash
19+#
20+#	/etc/init.d/rarpd
21+#
22+# Starts the rarpd daemon
23+#
24+# chkconfig: - 82 16
25+# description: Server Reverse Address Resolution Protocol requests.
26+# processname: rarpd
27+
28+### BEGIN INIT INFO
29+# Provides: rarpd
30+# Required-Start: $syslog $network
31+# Required-Stop:  $syslog $network
32+# Default-Start:
33+# Default-Stop: 0 1 2 3 4 5 6
34+# Short-Description: start and stop rarpd
35+# Description: RARP (Reverse Address Resolution Protocol) is a protocol \
36+#              which allows individual devices on an IP network to get \
37+#              their own IP addresses from the RARP server. \
38+### END INIT INFO
39+
40+# Source function library.
41+. /etc/init.d/functions
42+
43+# Read the config file if exists
44+if [ -f /etc/sysconfig/rarpd ]; then
45+ . /etc/sysconfig/rarpd
46+fi
47+
48+RETVAL=0
49+prog="rarpd"
50+
51+
52+start() {
53+    #if these files don't exist rarpd can't work
54+    test -x /usr/sbin/rarpd -a -f /etc/ethers || exit 6
55+	# Check if rarpd is already running
56+	#if [ ! -f /var/lock/subsys/rarpd ]; then
57+    status rarpd;
58+    if [ $? -ne 0 ]; then
59+	    echo -n $"Starting $prog: "
60+	    daemon /usr/sbin/rarpd $OPTIONS $INTERFACE
61+	    RETVAL=$?
62+	    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/rarpd
63+	    echo
64+	fi
65+	return $RETVAL
66+}
67+
68+stop() {
69+	echo -n $"Stopping $prog: "
70+	killproc /usr/sbin/rarpd
71+	RETVAL=$?
72+	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/rarpd
73+	echo
74+	return $RETVAL
75+}
76+reload() {
77+    RETVAL=3
78+}
79+
80+#
81+#	See how we were called.
82+#
83+case "$1" in
84+  start)
85+	start
86+	;;
87+  stop)
88+	stop
89+	;;
90+  reload)
91+    reload
92+    ;;
93+  force-reload|restart)
94+    stop
95+	start
96+	;;
97+  condrestart)
98+	if [ -f /var/lock/subsys/rarpd ]; then
99+	    stop
100+	    start
101+	fi
102+	;;
103+  status)
104+	status rarpd
105+	RETVAL=$?
106+	;;
107+  *)
108+	echo $"Usage: $0 {start|stop|restart|condrestart|reload|status|force-reload}"
109+	RETVAL=2
110+
111+esac
112+
113+exit $RETVAL
114--
1151.8.4.2
116
117