Mon, 28 Jan 2013 17:37:18 +0100
Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.
1 #!@l_prefix@/bin/openpkg rc
2 ##
3 ## rc.arpd -- Run-Commands
4 ##
6 %config
7 arpd_enable="$openpkg_rc_def"
8 arpd_log_prolog="true"
9 arpd_log_epilog="true"
10 arpd_log_numfiles="10"
11 arpd_log_minsize="1M"
12 arpd_log_complevel="9"
13 arpd_ip_network="192.168.100.0/24"
14 arpd_if=""
16 %common
17 arpd_pidfile="@l_prefix@/var/arpd/arpd.pid"
18 arpd_signal () {
19 [ -f $arpd_pidfile ] && kill -$1 `cat $arpd_pidfile`
20 }
22 %status -u @l_susr@ -o
23 arpd_usable="unknown"
24 arpd_active="no"
25 rcService arpd enable yes && \
26 arpd_signal 0 && arpd_active="yes"
27 echo "arpd_enable=\"$arpd_enable\""
28 echo "arpd_usable=\"$arpd_usable\""
29 echo "arpd_active=\"$arpd_active\""
31 %start -u @l_susr@
32 rcService arpd enable yes || exit 0
33 rcService arpd active yes && exit 0
34 if [ ".$arpd_if" != . ]; then
35 arpd_interface="-i $arpd_if"
36 fi
37 @l_prefix@/sbin/arpd \
38 $arpd_interface \
39 $arpd_ip_network \
40 >/dev/null 2>&1
42 %stop -u @l_susr@
43 rcService arpd enable yes || exit 0
44 rcService arpd active no && exit 0
45 arpd_signal TERM
46 rcService arpd active no && exit 0
47 arpd_signal TERM
48 rcService arpd active no && exit 0
49 rm -f $arpd_pidfile
51 %restart -u @l_susr@
52 rcService arpd enable yes || exit 0
53 rcService arpd active no && exit 0
54 rc arpd start
55 sleep 2
56 rc arpd stop
58 %reload -u @l_susr@
59 rcService arpd enable yes || exit 0
60 rcService arpd active no && exit 0
61 arpd_signal HUP
63 %daily -u @l_susr@
64 rcService arpd enable yes || exit 0
65 shtool rotate -f \
66 -n ${arpd_log_numfiles} -s ${arpd_log_minsize} -d \
67 -z ${arpd_log_complevel} -o @l_susr@ -g @l_rgrp@ -m 644 \
68 -P "${arpd_log_prolog}" \
69 -E "${arpd_log_epilog}; rc arpd restart" \
70 @l_prefix@/var/arpd/arpd.log