1 |
flameeyes 11/09/27 13:07:50 |
2 |
|
3 |
Added: zebra.init.3 quagga-services.init.2 |
4 |
Log: |
5 |
Version bump (security fixes); use EAPI=4; use OpenRC's proper init scripts with check whether to use syslog or not; disable strict aliasing since way too many warnings are thrown right now and this could be mission-critical for many. |
6 |
|
7 |
(Portage version: 2.2.0_alpha59/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 net-misc/quagga/files/zebra.init.3 |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/quagga/files/zebra.init.3?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/quagga/files/zebra.init.3?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: zebra.init.3 |
16 |
=================================================================== |
17 |
#!/sbin/runscript |
18 |
# Copyright 1999-2011 Gentoo Foundation |
19 |
# Distributed under the terms of the GNU General Public License v2 |
20 |
# $Header: /var/cvsroot/gentoo-x86/net-misc/quagga/files/zebra.init.3,v 1.1 2011/09/27 13:07:50 flameeyes Exp $ |
21 |
|
22 |
: CFGFILE=/etc/quagga/${SVCNAME}.conf |
23 |
|
24 |
get_service_config() { |
25 |
awk '$1 == "'$1'" { s=$2 } END { print s }' "$CFGFILE" |
26 |
} |
27 |
|
28 |
depend() { |
29 |
config "$CFGFILE" |
30 |
|
31 |
need net |
32 |
|
33 |
[ "$(get_service_config log)" = "syslog" ] && \ |
34 |
use logger |
35 |
} |
36 |
|
37 |
start() { |
38 |
if [ ! -e "${CFGFILE}" ] ; then |
39 |
eerror "Before starting ${SVCNAME} you have to configure it, by creating" |
40 |
eerror "a ${CFGFILE} file." |
41 |
eerror "" |
42 |
eerror "A sample file has been installed in `ls /usr/share/doc/quagga-*/samples/${SVCNAME}.conf.sample`" |
43 |
return 1 |
44 |
fi |
45 |
|
46 |
if [ ! -d /var/run/quagga ] ; then |
47 |
mkdir -p /var/run/quagga |
48 |
chown quagga:quagga /var/run/quagga |
49 |
chmod 0750 /var/run/quagga |
50 |
fi |
51 |
|
52 |
ebegin "Cleaning up stale zebra routes..." |
53 |
ip route flush proto zebra |
54 |
eend $? |
55 |
|
56 |
ebegin "Starting ${SVCNAME}" |
57 |
start-stop-daemon \ |
58 |
--start --exec /usr/sbin/${SVCNAME} \ |
59 |
--pidfile /var/run/quagga/${SVCNAME}.pid \ |
60 |
-- -d -f "${CFGFILE}" ${EXTRA_OPTS} \ |
61 |
--pid_file /var/run/quagga/${SVCNAME}.pid |
62 |
|
63 |
eend $? |
64 |
} |
65 |
|
66 |
stop() { |
67 |
ebegin "Stopping ${SVCNAME}" |
68 |
start-stop-daemon --stop \ |
69 |
--pidfile /var/run/quagga/${SVCNAME}.pid |
70 |
eend $? |
71 |
} |
72 |
|
73 |
|
74 |
|
75 |
1.1 net-misc/quagga/files/quagga-services.init.2 |
76 |
|
77 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/quagga/files/quagga-services.init.2?rev=1.1&view=markup |
78 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/quagga/files/quagga-services.init.2?rev=1.1&content-type=text/plain |
79 |
|
80 |
Index: quagga-services.init.2 |
81 |
=================================================================== |
82 |
#!/sbin/runscript |
83 |
# Copyright 1999-2011 Gentoo Foundation |
84 |
# Distributed under the terms of the GNU General Public License v2 |
85 |
# $Header: /var/cvsroot/gentoo-x86/net-misc/quagga/files/quagga-services.init.2,v 1.1 2011/09/27 13:07:50 flameeyes Exp $ |
86 |
|
87 |
: CFGFILE=/etc/quagga/${SVCNAME}.conf |
88 |
|
89 |
get_service_config() { |
90 |
awk '$1 == "'$1'" { s=$2 } END { print s }' "$CFGFILE" |
91 |
} |
92 |
|
93 |
depend() { |
94 |
config "$CFGFILE" |
95 |
|
96 |
need zebra |
97 |
|
98 |
[ "$(get_service_config log)" = "syslog" ] && \ |
99 |
use logger |
100 |
} |
101 |
|
102 |
start() { |
103 |
if [ ! -e "${CFGFILE}" ] ; then |
104 |
eerror "Before starting ${SVCNAME} you have to configure it, by creating" |
105 |
eerror "a ${CFGFILE} file." |
106 |
eerror "" |
107 |
eerror "A sample file has been installed in `ls /usr/share/doc/quagga-*/samples/${SVCNAME}.conf.sample`" |
108 |
return 1 |
109 |
fi |
110 |
|
111 |
if [ ! -d /var/run/quagga ] ; then |
112 |
mkdir -p /var/run/quagga |
113 |
chown quagga:quagga /var/run/quagga |
114 |
chmod 0750 /var/run/quagga |
115 |
fi |
116 |
|
117 |
ebegin "Starting ${SVCNAME}" |
118 |
start-stop-daemon \ |
119 |
--start --exec /usr/sbin/${SVCNAME} \ |
120 |
--pidfile /var/run/quagga/${SVCNAME}.pid \ |
121 |
-- -d -f "${CFGFILE}" ${EXTRA_OPTS} \ |
122 |
--pid_file /var/run/quagga/${SVCNAME}.pid |
123 |
|
124 |
eend $? |
125 |
} |
126 |
|
127 |
stop() { |
128 |
ebegin "Stopping ${SVCNAME}" |
129 |
start-stop-daemon --stop \ |
130 |
--pidfile /var/run/quagga/${SVCNAME}.pid |
131 |
eend $? |
132 |
} |