Registration is now invite-only. Any user can make an invite, you need to create it here and give resulting link to someone to register.
avatar
mikhailnov has added 402a2c4099
clean up, migrate to systemd-sysusers, add quagga user to quaggavt gr...

...oup as in Fedora, borrow patches from Debian

... ... --- a/.abf.yml
... ... +++ b/.abf.yml
... ... @@ -1,4 +1,2 @@
1
removed_sources:
2
  quagga-0.99.22.4.tar.xz: d1e0e05ff82df0656de33649f321e9aa6f205a4e
3 1
sources:
4 2
  quagga-1.2.4.tar.gz: 8e1471624f5baf54b53be6636e451824d3ef15f6
view file @ 402a2c4099
... ... --- /dev/null
... ... +++ b/DEBIAN-Add-correct-QUAGGA_VERSION-to-manpages.patch
... ... @@ -0,0 +1,121 @@
1
From: Scott Leggett <scott@sl.id.au>
2
Date: Sun, 5 Nov 2017 15:13:27 +1100
3
Subject: Add correct QUAGGA_VERSION to manpages.
4
5
---
6
 doc/Makefile.am | 6 ++++++
7
 doc/bgpd.8      | 2 +-
8
 doc/isisd.8     | 2 +-
9
 doc/ospf6d.8    | 2 +-
10
 doc/ospfd.8     | 2 +-
11
 doc/pimd.8      | 2 +-
12
 doc/ripd.8      | 2 +-
13
 doc/ripngd.8    | 2 +-
14
 doc/vtysh.1     | 2 +-
15
 doc/zebra.8     | 2 +-
16
 10 files changed, 15 insertions(+), 9 deletions(-)
17
18
diff --git a/doc/Makefile.am b/doc/Makefile.am
19
index 38920c8..2c08d5c 100644
20
--- a/doc/Makefile.am
21
+++ b/doc/Makefile.am
22
@@ -123,3 +123,9 @@ DISTCLEANFILES = quagga.info*
23
 # do nothing for DVI, so we don't have to generate or distribute EPS
24
 # figures
25
 dvi: # nothing
26
+
27
+.PHONY: versioned_manpages
28
+versioned_manpages: $(man_MANS)
29
+	for man in $^; do \
30
+		m4 -DQUAGGA_VERSION=$(QUAGGA_VERSION) $$man | sponge $$man; \
31
+		done
32
diff --git a/doc/bgpd.8 b/doc/bgpd.8
33
index e680ddb..d05edf6 100644
34
--- a/doc/bgpd.8
35
+++ b/doc/bgpd.8
36
@@ -1,4 +1,4 @@
37
-.TH BGPD 8 "25 November 2004" "Quagga BGPD daemon" "Version 0.97.3"
38
+.TH BGPD 8 "25 November 2004" "Quagga BGPD daemon" "Version QUAGGA_VERSION"
39
 .SH NAME
40
 bgpd \- a BGPv4, BGPv4\+, BGPv4\- routing engine for use with Quagga routing
41
 software
42
diff --git a/doc/isisd.8 b/doc/isisd.8
43
index 84e6cf5..c014762 100644
44
--- a/doc/isisd.8
45
+++ b/doc/isisd.8
46
@@ -1,4 +1,4 @@
47
-.TH IS-IS 8 "25 November 2004" "Quagga IS-IS daemon" "Version 0.97.3"
48
+.TH IS-IS 8 "25 November 2004" "Quagga IS-IS daemon" "Version QUAGGA_VERSION"
49
 .SH NAME
50
 isisd \- an IS-IS routing engine for use with Quagga routing software.
51
 .SH SYNOPSIS
52
diff --git a/doc/ospf6d.8 b/doc/ospf6d.8
53
index 0643226..9446db1 100644
54
--- a/doc/ospf6d.8
55
+++ b/doc/ospf6d.8
56
@@ -1,4 +1,4 @@
57
-.TH OSPF6D 8 "25 November 2004" "Quagga OSPFv3 daemon" "Version 0.97.3"
58
+.TH OSPF6D 8 "25 November 2004" "Quagga OSPFv3 daemon" "Version QUAGGA_VERSION"
59
 .SH NAME
60
 ospf6d \- an OSPFv3 routing engine for use with Quagga routing software.
61
 .SH SYNOPSIS
62
diff --git a/doc/ospfd.8 b/doc/ospfd.8
63
index 8c819cf..626eab2 100644
64
--- a/doc/ospfd.8
65
+++ b/doc/ospfd.8
66
@@ -1,4 +1,4 @@
67
-.TH OSPFD 8 "25 November 2004" "Quagga OSPFv2 daemon" "Version 0.97.3"
68
+.TH OSPFD 8 "25 November 2004" "Quagga OSPFv2 daemon" "Version QUAGGA_VERSION"
69
 .SH NAME
70
 ospfd \- an OSPFv2 routing engine for use with Quagga routing software.
71
 .SH SYNOPSIS
72
diff --git a/doc/pimd.8 b/doc/pimd.8
73
index 0dd170a..7c89914 100644
74
--- a/doc/pimd.8
75
+++ b/doc/pimd.8
76
@@ -1,4 +1,4 @@
77
-.TH PIM 8 "10 December 2008" "Quagga PIM daemon" "Version 0.99.11"
78
+.TH PIM 8 "10 December 2008" "Quagga PIM daemon" "Version QUAGGA_VERSION"
79
 .SH NAME
80
 pimd \- a PIM routing for use with Quagga Routing Suite.
81
 .SH SYNOPSIS
82
diff --git a/doc/ripd.8 b/doc/ripd.8
83
index 8fa9bf2..d506959 100644
84
--- a/doc/ripd.8
85
+++ b/doc/ripd.8
86
@@ -1,4 +1,4 @@
87
-.TH RIPD 8 "25 November 2004" "Quagga RIP daemon" "Version 0.97.3"
88
+.TH RIPD 8 "25 November 2004" "Quagga RIP daemon" "Version QUAGGA_VERSION"
89
 .SH NAME
90
 ripd \- a RIP routing engine for use with Quagga routing software.
91
 .SH SYNOPSIS
92
diff --git a/doc/ripngd.8 b/doc/ripngd.8
93
index 6e63dc2..c336c89 100644
94
--- a/doc/ripngd.8
95
+++ b/doc/ripngd.8
96
@@ -1,4 +1,4 @@
97
-.TH RIPNGD 8 "25 November 2004" "Quagga RIPNG daemon" "Version 0.97.3"
98
+.TH RIPNGD 8 "25 November 2004" "Quagga RIPNG daemon" "Version QUAGGA_VERSION"
99
 .SH NAME
100
 ripngd \- a RIPNG routing engine for use with Quagga routing software.
101
 .SH SYNOPSIS
102
diff --git a/doc/vtysh.1 b/doc/vtysh.1
103
index a2afa9f..ff672d0 100644
104
--- a/doc/vtysh.1
105
+++ b/doc/vtysh.1
106
@@ -1,4 +1,4 @@
107
-.TH VTYSH 1 "27 July 2006" "Quagga VTY shell" "Version 0.96.5"
108
+.TH VTYSH 1 "27 July 2006" "Quagga VTY shell" "Version QUAGGA_VERSION"
109
 .SH NAME
110
 vtysh \- a integrated shell for Quagga routing software
111
 .SH SYNOPSIS
112
diff --git a/doc/zebra.8 b/doc/zebra.8
113
index da5881c..23cf39e 100644
114
--- a/doc/zebra.8
115
+++ b/doc/zebra.8
116
@@ -1,4 +1,4 @@
117
-.TH ZEBRA 8 "25 November 2004" "Zebra daemon" "Version 0.97.3"
118
+.TH ZEBRA 8 "25 November 2004" "Zebra daemon" "Version QUAGGA_VERSION"
119
 .SH NAME
120
 zebra \- a routing manager for use with associated Quagga components.
121
 .SH SYNOPSIS
view file @ 402a2c4099
... ... --- /dev/null
... ... +++ b/DEBIAN-Fix-typo-in-dump-bgp-help-text.patch
... ... @@ -0,0 +1,23 @@
1
From: Scott Leggett <scott@sl.id.au>
2
Date: Sun, 5 Nov 2017 22:03:17 +1100
3
Subject: Fix typo in dump-bgp help text.
4
5
---
6
 bgpd/bgp_dump.c | 4 ++--
7
 1 file changed, 2 insertions(+), 2 deletions(-)
8
9
diff --git a/bgpd/bgp_dump.c b/bgpd/bgp_dump.c
10
index 01f9b41..2b8513c 100644
11
--- a/bgpd/bgp_dump.c
12
+++ b/bgpd/bgp_dump.c
13
@@ -741,8 +741,8 @@ DEFUN (dump_bgp_all,
14
        "dump bgp (all|all-et|updates|updates-et|routes-mrt) PATH [INTERVAL]",
15
        "Dump packet\n"
16
        "BGP packet dump\n"
17
-       "Dump all BGP packets\nDump all BGP packets (Extended Tiemstamp Header)\n"
18
-       "Dump BGP updates only\nDump BGP updates only (Extended Tiemstamp Header)\n"
19
+       "Dump all BGP packets\nDump all BGP packets (Extended Timestamp Header)\n"
20
+       "Dump BGP updates only\nDump BGP updates only (Extended Timestamp Header)\n"
21
        "Dump whole BGP routing table\n"
22
        "Output filename\n"
23
        "Interval of output\n")
view file @ 402a2c4099
... ... --- /dev/null
... ... +++ b/DEBIAN-Patch-init-scripts-for-Debian.patch
... ... @@ -0,0 +1,777 @@
1
From: Brett Parker <iDunno@sommitrealweird.co.uk>
2
Date: Sat, 31 Mar 2018 14:21:41 +0100
3
Subject: Patch init scripts for Debian
4
5
---
6
 redhat/bgpd.init        | 40 +++++++++++++++++++++-------------------
7
 redhat/isisd.init       | 40 +++++++++++++++++++++-------------------
8
 redhat/ospf6d.init      | 40 +++++++++++++++++++++-------------------
9
 redhat/ospfd.init       | 40 +++++++++++++++++++++-------------------
10
 redhat/pimd.init        | 40 +++++++++++++++++++++-------------------
11
 redhat/quagga.sysconfig |  4 ++--
12
 redhat/ripd.init        | 40 +++++++++++++++++++++-------------------
13
 redhat/ripngd.init      | 40 +++++++++++++++++++++-------------------
14
 redhat/watchquagga.init | 37 +++++++++++++++++++------------------
15
 redhat/zebra.init       | 40 +++++++++++++++++++++-------------------
16
 10 files changed, 189 insertions(+), 172 deletions(-)
17
18
diff --git a/redhat/bgpd.init b/redhat/bgpd.init
19
index e18511a..d55333d 100644
20
--- a/redhat/bgpd.init
21
+++ b/redhat/bgpd.init
22
@@ -4,49 +4,51 @@
23
 
24
 ### BEGIN INIT INFO
25
 # Provides: bgpd
26
+# Required-Start:    $remote_fs $syslog $network zebra
27
+# Required-Stop:     $remote_fs $syslog $network zebra
28
+# Default-Start:     2 3 4 5
29
+# Default-Stop:      0 1 6
30
 # Short-Description: BGP routing engine
31
 # Description: BGP routing engine for use with Zebra
32
 ### END INIT INFO
33
 
34
 # source function library
35
-. /etc/rc.d/init.d/functions
36
-
37
-# Get network config
38
-. /etc/sysconfig/network
39
+. /lib/lsb/init-functions
40
 
41
 # quagga command line options
42
-. /etc/sysconfig/quagga
43
+. /etc/default/quagga
44
 
45
 RETVAL=0
46
 PROG="bgpd"
47
-cmd=bgpd
48
-LOCK_FILE=/var/lock/subsys/bgpd
49
+cmd=/usr/sbin/bgpd
50
+LOCK_FILE=/var/lock/quagga/bgpd
51
 CONF_FILE=/etc/quagga/bgpd.conf
52
 
53
+[ -d /var/lock/quagga ] || mkdir /var/lock/quagga
54
+[ -d /run/quagga ] || ( mkdir /run/quagga && chown quagga:quagga /run/quagga )
55
+
56
+# if the config file doesn't exist, exit immediately
57
+[ -f "$CONF_FILE" ] || exit 0
58
+
59
 case "$1" in
60
   start)
61
-	# Check that networking is up.
62
-	[ "${NETWORKING}" = "no" ] && exit 1
63
-
64
-	# The process must be configured first.
65
-	[ -f $CONF_FILE ] || exit 6
66
 	if [ `id -u` -ne 0 ]; then
67
 		echo $"Insufficient privilege" 1>&2
68
 		exit 4
69
 	fi
70
 
71
-	echo -n $"Starting $PROG: "
72
-	daemon $cmd -d $BGPD_OPTS -f $CONF_FILE
73
+	log_daemon_msg "Starting $PROG" "$PROG"
74
+	start_daemon -- $cmd -d $BGPD_OPTS -f $CONF_FILE
75
 	RETVAL=$?
76
 	[ $RETVAL -eq 0 ] && touch $LOCK_FILE
77
-	echo
78
+	log_end_msg $RETVAL
79
 	;;
80
   stop)
81
-	echo -n $"Shutting down $PROG: "
82
-	killproc $cmd
83
+	log_daemon_msg "Shutting down $PROG" "$PROG"
84
+	killproc -p /run/quagga/$PROG.pid $cmd
85
 	RETVAL=$?
86
 	[ $RETVAL -eq 0 ] && rm -f $LOCK_FILE
87
-	echo
88
+	log_end_msg $RETVAL
89
 	;;
90
   restart|reload|force-reload)
91
 	$0 stop
92
@@ -61,7 +63,7 @@ case "$1" in
93
 	RETVAL=$?
94
 	;;
95
   status)
96
-	status $cmd
97
+	status_of_proc -p /run/quagga/$PROG.pid $cmd
98
 	RETVAL=$?
99
 	;;
100
   *)
101
diff --git a/redhat/isisd.init b/redhat/isisd.init
102
index 9e80530..e5b6160 100644
103
--- a/redhat/isisd.init
104
+++ b/redhat/isisd.init
105
@@ -4,49 +4,51 @@
106
 
107
 ### BEGIN INIT INFO
108
 # Provides: isisd
109
+# Required-Start:    $remote_fs $syslog $network zebra
110
+# Required-Stop:     $remote_fs $syslog $network zebra
111
+# Default-Start:     2 3 4 5
112
+# Default-Stop:      0 1 6
113
 # Short-Description: IS-IS routing engine
114
 # Description: IS-IS routing engine for use with Zebra
115
 ### END INIT INFO
116
 
117
 # source function library
118
-. /etc/rc.d/init.d/functions
119
-
120
-# Get network config
121
-. /etc/sysconfig/network
122
+. /lib/lsb/init-functions
123
 
124
 # quagga command line options
125
-. /etc/sysconfig/quagga
126
+. /etc/default/quagga
127
 
128
 RETVAL=0
129
 PROG="isisd"
130
-cmd=isisd
131
-LOCK_FILE=/var/lock/subsys/isisd
132
+cmd=/usr/sbin/isisd
133
+LOCK_FILE=/var/lock/quagga/isisd
134
 CONF_FILE=/etc/quagga/isisd.conf
135
 
136
+[ -d /var/lock/quagga ] || mkdir /var/lock/quagga
137
+[ -d /run/quagga ] || ( mkdir /run/quagga && chown quagga:quagga /run/quagga )
138
+
139
+# if the config file doesn't exist, exit immediately
140
+[ -f "$CONF_FILE" ] || exit 0
141
+
142
 case "$1" in
143
   start)
144
-	# Check that networking is up.
145
-	[ "${NETWORKING}" = "no" ] && exit 1
146
-
147
-	# The process must be configured first.
148
-	[ -f $CONF_FILE ] || exit 6
149
 	if [ `id -u` -ne 0 ]; then
150
 		echo $"Insufficient privilege" 1>&2
151
 		exit 4
152
 	fi
153
 
154
-	echo -n $"Starting $PROG: "
155
-	daemon $cmd -d $ISISD_OPTS -f $CONF_FILE
156
+	log_daemon_msg "Starting $PROG" "$PROG"
157
+	start_daemon -- $cmd -d $ISISD_OPTS -f $CONF_FILE
158
 	RETVAL=$?
159
 	[ $RETVAL -eq 0 ] && touch $LOCK_FILE
160
-	echo
161
+	log_end_msg $RETVAL
162
 	;;
163
   stop)
164
-	echo -n $"Shutting down $PROG: "
165
-	killproc $cmd
166
+	log_daemon_msg "Shutting down $PROG" "$PROG"
167
+	killproc -p /run/quagga/$PROG.pid $cmd
168
 	RETVAL=$?
169
 	[ $RETVAL -eq 0 ] && rm -f $LOCK_FILE
170
-	echo
171
+	log_end_msg $RETVAL
172
 	;;
173
   restart|reload|force-reload)
174
 	$0 stop
175
@@ -61,7 +63,7 @@ case "$1" in
176
 	RETVAL=$?
177
 	;;
178
   status)
179
-	status $cmd
180
+	status_of_proc -p /run/quagga/$PROG.pid $cmd
181
 	RETVAL=$?
182
 	;;
183
   *)
184
diff --git a/redhat/ospf6d.init b/redhat/ospf6d.init
185
index 4133b4a..a44d4a8 100644
186
--- a/redhat/ospf6d.init
187
+++ b/redhat/ospf6d.init
188
@@ -4,49 +4,51 @@
189
 
190
 ### BEGIN INIT INFO
191
 # Provides: ospf6d
192
+# Required-Start:    $remote_fs $syslog $network zebra
193
+# Required-Stop:     $remote_fs $syslog $network zebra
194
+# Default-Start:     2 3 4 5
195
+# Default-Stop:      0 1 6
196
 # Short-Description: OSPF routing engine for IPv6
197
 # Description: OSPF routing engine for use with Zebra and IPv6
198
 ### END INIT INFO
199
 
200
 # source function library
201
-. /etc/rc.d/init.d/functions
202
-
203
-# Get network config
204
-. /etc/sysconfig/network
205
+. /lib/lsb/init-functions
206
 
207
 # quagga command line options
208
-. /etc/sysconfig/quagga
209
+. /etc/default/quagga
210
 
211
 RETVAL=0
212
 PROG="ospf6d"
213
-cmd=ospf6d
214
-LOCK_FILE=/var/lock/subsys/ospf6d
215
+cmd=/usr/sbin/ospf6d
216
+LOCK_FILE=/var/lock/quagga/ospf6d
217
 CONF_FILE=/etc/quagga/ospf6d.conf
218
 
219
+[ -d /var/lock/quagga ] || mkdir /var/lock/quagga
220
+[ -d /run/quagga ] || ( mkdir /run/quagga && chown quagga:quagga /run/quagga )
221
+
222
+# if the config file doesn't exist, exit immediately
223
+[ -f "$CONF_FILE" ] || exit 0
224
+
225
 case "$1" in
226
   start)
227
-	# Check that networking is up.
228
-	[ "${NETWORKING}" = "no" ] && exit 1
229
-
230
-	# The process must be configured first.
231
-	[ -f $CONF_FILE ] || exit 6
232
 	if [ `id -u` -ne 0 ]; then
233
 		echo $"Insufficient privilege" 1>&2
234
 		exit 4
235
 	fi
236
 
237
-	echo -n $"Starting $PROG: "
238
-	daemon $cmd -d $OSPF6D_OPTS -f $CONF_FILE
239
+	log_daemon_msg "Starting $PROG" "$PROG"
240
+	start_daemon -- $cmd -d $OSPF6D_OPTS -f $CONF_FILE
241
 	RETVAL=$?
242
 	[ $RETVAL -eq 0 ] && touch $LOCK_FILE
243
-	echo
244
+	log_end_msg $RETVAL
245
 	;;
246
   stop)
247
-	echo -n $"Shutting down $PROG: "
248
-	killproc $cmd
249
+	log_daemon_msg "Shutting down $PROG" "$PROG"
250
+	killproc -p /run/quagga/$PROG.pid $cmd
251
 	RETVAL=$?
252
 	[ $RETVAL -eq 0 ] && rm -f $LOCK_FILE
253
-	echo
254
+	log_end_msg $RETVAL
255
 	;;
256
   restart|reload|force-reload)
257
 	$0 stop
258
@@ -61,7 +63,7 @@ case "$1" in
259
 	RETVAL=$?
260
 	;;
261
   status)
262
-	status $cmd
263
+	status_of_proc -p /run/quagga/$PROG.pid $cmd
264
 	RETVAL=$?
265
 	;;
266
   *)
267
diff --git a/redhat/ospfd.init b/redhat/ospfd.init
268
index d964f38..ce88838 100644
269
--- a/redhat/ospfd.init
270
+++ b/redhat/ospfd.init
271
@@ -4,49 +4,51 @@
272
 
273
 ### BEGIN INIT INFO
274
 # Provides: ospfd
275
+# Required-Start:    $remote_fs $syslog $network zebra
276
+# Required-Stop:     $remote_fs $syslog $network zebra
277
+# Default-Start:     2 3 4 5
278
+# Default-Stop:      0 1 6
279
 # Short-Description: OSPF routing engine
280
 # Description: OSPF routing engine for use with Zebra
281
 ### END INIT INFO
282
 
283
 # source function library
284
-. /etc/rc.d/init.d/functions
285
-
286
-# Get network config
287
-. /etc/sysconfig/network
288
+. /lib/lsb/init-functions
289
 
290
 # quagga command line options
291
-. /etc/sysconfig/quagga
292
+. /etc/default/quagga
293
 
294
 RETVAL=0
295
 PROG="ospfd"
296
-cmd=ospfd
297
-LOCK_FILE=/var/lock/subsys/ospfd
298
+cmd=/usr/sbin/ospfd
299
+LOCK_FILE=/var/lock/quagga/ospfd
300
 CONF_FILE=/etc/quagga/ospfd.conf
301
 
302
+[ -d /var/lock/quagga ] || mkdir /var/lock/quagga
303
+[ -d /run/quagga ] || ( mkdir /run/quagga && chown quagga:quagga /run/quagga )
304
+
305
+# if the config file doesn't exist, exit immediately
306
+[ -f "$CONF_FILE" ] || exit 0
307
+
308
 case "$1" in
309
   start)
310
-	# Check that networking is up.
311
-	[ "${NETWORKING}" = "no" ] && exit 1
312
-
313
-	# The process must be configured first.
314
-	[ -f $CONF_FILE ] || exit 6
315
 	if [ `id -u` -ne 0 ]; then
316
 		echo $"Insufficient privilege" 1>&2
317
 		exit 4
318
 	fi
319
 
320
-	echo -n $"Starting $PROG: "
321
-	daemon $cmd -d $OSPFD_OPTS -f $CONF_FILE
322
+	log_daemon_msg "Starting $PROG" "$PROG"
323
+	start_daemon $cmd -d $OSPFD_OPTS -f $CONF_FILE
324
 	RETVAL=$?
325
 	[ $RETVAL -eq 0 ] && touch $LOCK_FILE
326
-	echo
327
+	log_end_msg $RETVAL
328
 	;;
329
   stop)
330
-	echo -n $"Shutting down $PROG: "
331
-	killproc $cmd
332
+	log_daemon_msg "Shutting down $PROG" "$PROG"
333
+	killproc -p /run/quagga/$PROG.pid $cmd
334
 	RETVAL=$?
335
 	[ $RETVAL -eq 0 ] && rm -f $LOCK_FILE
336
-	echo
337
+	log_end_msg $RETVAL
338
 	;;
339
   restart|reload|force-reload)
340
 	$0 stop
341
@@ -61,7 +63,7 @@ case "$1" in
342
 	RETVAL=$?
343
 	;;
344
   status)
345
-	status $cmd
346
+	status_of_proc -p /run/quagga/$PROG.pid $cmd
347
 	RETVAL=$?
348
 	;;
349
   *)
350
diff --git a/redhat/pimd.init b/redhat/pimd.init
351
index 49f9075..5ea5c3c 100644
352
--- a/redhat/pimd.init
353
+++ b/redhat/pimd.init
354
@@ -4,49 +4,51 @@
355
 
356
 ### BEGIN INIT INFO
357
 # Provides: pimd
358
+# Required-Start:    $remote_fs $syslog $network zebra
359
+# Required-Stop:     $remote_fs $syslog $network zebra
360
+# Default-Start:     2 3 4 5
361
+# Default-Stop:      0 1 6
362
 # Short-Description: PIM multicast routing engine
363
 # Description: PIM routing engine for use with Zebra
364
 ### END INIT INFO
365
 
366
 # source function library
367
-. /etc/rc.d/init.d/functions
368
-
369
-# Get network config
370
-. /etc/sysconfig/network
371
+. /lib/lsb/init-functions
372
 
373
 # quagga command line options
374
-. /etc/sysconfig/quagga
375
+. /etc/default/quagga
376
 
377
 RETVAL=0
378
 PROG="pimd"
379
-cmd=pimd
380
-LOCK_FILE=/var/lock/subsys/pimd
381
+cmd=/usr/sbin/pimd
382
+LOCK_FILE=/var/lock/quagga/pimd
383
 CONF_FILE=/etc/quagga/pimd.conf
384
 
385
+[ -d /var/lock/quagga ] || mkdir /var/lock/quagga
386
+[ -d /run/quagga ] || ( mkdir /run/quagga && chown quagga:quagga /run/quagga )
387
+
388
+# if the config file doesn't exist, exit immediately
389
+[ -f "$CONF_FILE" ] || exit 0
390
+
391
 case "$1" in
392
   start)
393
-	# Check that networking is up.
394
-	[ "${NETWORKING}" = "no" ] && exit 1
395
-
396
-	# The process must be configured first.
397
-	[ -f $CONF_FILE ] || exit 6
398
 	if [ `id -u` -ne 0 ]; then
399
 		echo $"Insufficient privilege" 1>&2
400
 		exit 4
401
 	fi
402
 
403
-	echo -n $"Starting $PROG: "
404
-	daemon $cmd -d $PIMD_OPTS -f $CONF_FILE
405
+	log_daemon_msg "Starting $PROG" "$PROG"
406
+	start_daemon -- $cmd -d $PIMD_OPTS -f $CONF_FILE
407
 	RETVAL=$?
408
 	[ $RETVAL -eq 0 ] && touch $LOCK_FILE
409
-	echo
410
+	log_end_msg $RETVAL
411
 	;;
412
   stop)
413
-	echo -n $"Shutting down $PROG: "
414
-	killproc $cmd
415
+	log_daemon_msg "Shutting down $PROG" "$PROG"
416
+	killproc -p /run/quagga/$PROG.pid $cmd
417
 	RETVAL=$?
418
 	[ $RETVAL -eq 0 ] && rm -f $LOCK_FILE
419
-	echo
420
+	log_end_msg $RETVAL
421
 	;;
422
   restart|reload|force-reload)
423
 	$0 stop
424
@@ -61,7 +63,7 @@ case "$1" in
425
 	RETVAL=$?
426
 	;;
427
   status)
428
-	status $cmd
429
+	status_of_proc -p /run/quagga/$PROG.pid $cmd
430
 	RETVAL=$?
431
 	;;
432
   *)
433
diff --git a/redhat/quagga.sysconfig b/redhat/quagga.sysconfig
434
index 8353b13..de4a099 100644
435
--- a/redhat/quagga.sysconfig
436
+++ b/redhat/quagga.sysconfig
437
@@ -15,7 +15,7 @@ PIMD_OPTS="-A 127.0.0.1"
438
 # system startup to chmod config files.
439
 QUAGGA_USER=quagga
440
 QUAGGA_GROUP=quagga
441
-VTY_GROUP=
442
+VTY_GROUP=quaggavty
443
 
444
 # Watchquagga configuration for LSB initscripts
445
 #
446
@@ -28,4 +28,4 @@ VTY_GROUP=
447
 #WATCH_DAEMONS="zebra bgpd ospfd ospf6d ripd ripngd"
448
 #
449
 # Timer values can be adjusting by editing this line:
450
-WATCH_OPTS="-Az -b_ -r/sbin/service_%s_restart -s/sbin/service_%s_start -k/sbin/service_%s_stop"
451
+WATCH_OPTS="-Az -b_ -r '/usr/sbin/invoke-rc.d %s restart' -s '/usr/sbin/invoke-rc.d %s start' -k '/usr/sbin/invoke-rc.d %s stop'"
452
diff --git a/redhat/ripd.init b/redhat/ripd.init
453
index 9b412cb..b83e669 100644
454
--- a/redhat/ripd.init
455
+++ b/redhat/ripd.init
456
@@ -4,49 +4,51 @@
457
 
458
 ### BEGIN INIT INFO
459
 # Provides: ripd
460
+# Required-Start:    $remote_fs $syslog $network zebra
461
+# Required-Stop:     $remote_fs $syslog $network zebra
462
+# Default-Start:     2 3 4 5
463
+# Default-Stop:      0 1 6
464
 # Short-Description: RIP routing engine
465
 # Description: RIP routing engine for use with Zebra
466
 ### END INIT INFO
467
 
468
 # source function library
469
-. /etc/rc.d/init.d/functions
470
-
471
-# Get network config
472
-. /etc/sysconfig/network
473
+. /lib/lsb/init-functions
474
 
475
 # quagga command line options
476
-. /etc/sysconfig/quagga
477
+. /etc/default/quagga
478
 
479
 RETVAL=0
480
 PROG="ripd"
481
-cmd=ripd
482
-LOCK_FILE=/var/lock/subsys/ripd
483
+cmd=/usr/sbin/ripd
484
+LOCK_FILE=/var/lock/quagga/ripd
485
 CONF_FILE=/etc/quagga/ripd.conf
486
 
487
+[ -d /var/lock/quagga ] || mkdir /var/lock/quagga
488
+[ -d /run/quagga ] || ( mkdir /run/quagga && chown quagga:quagga /run/quagga )
489
+
490
+# if the config file doesn't exist, exit immediately
491
+[ -f "$CONF_FILE" ] || exit 0
492
+
493
 case "$1" in
494
   start)
495
-	# Check that networking is up.
496
-	[ "${NETWORKING}" = "no" ] && exit 1
497
-
498
-	# The process must be configured first.
499
-	[ -f $CONF_FILE ] || exit 6
500
 	if [ `id -u` -ne 0 ]; then
501
 		echo $"Insufficient privilege" 1>&2
502
 		exit 4
503
 	fi
504
 
505
-	echo -n $"Starting $PROG: "
506
-	daemon $cmd -d $RIPD_OPTS -f $CONF_FILE
507
+	log_daemon_msg "Starting $PROG" "$PROG"
508
+	start_daemon $cmd -d $RIPD_OPTS -f $CONF_FILE
509
 	RETVAL=$?
510
 	[ $RETVAL -eq 0 ] && touch $LOCK_FILE
511
-	echo
512
+	log_end_msg $RETVAL
513
 	;;
514
   stop)
515
-	echo -n $"Shutting down $PROG: "
516
-	killproc $cmd
517
+	log_daemon_msg "Shutting down $PROG" "$PROG"
518
+	killproc -p /run/quagga/$PROG.pid $cmd
519
 	RETVAL=$?
520
 	[ $RETVAL -eq 0 ] && rm -f $LOCK_FILE
521
-	echo
522
+	log_end_msg $RETVAL
523
 	;;
524
   restart|reload|force-reload)
525
 	$0 stop
526
@@ -61,7 +63,7 @@ case "$1" in
527
 	RETVAL=$?
528
 	;;
529
   status)
530
-	status $cmd
531
+	status_of_proc -p /run/quagga/$PROG.pid $cmd
532
 	RETVAL=$?
533
 	;;
534
   *)
535
diff --git a/redhat/ripngd.init b/redhat/ripngd.init
536
index 88f346f..1341b75 100644
537
--- a/redhat/ripngd.init
538
+++ b/redhat/ripngd.init
539
@@ -4,49 +4,51 @@
540
 
541
 ### BEGIN INIT INFO
542
 # Provides: ripngd
543
+# Required-Start:    $remote_fs $syslog $network zebra
544
+# Required-Stop:     $remote_fs $syslog $network zebra
545
+# Default-Start:     2 3 4 5
546
+# Default-Stop:      0 1 6
547
 # Short-Description: RIP routing engine for IPv6
548
 # Description: RIP routing engine for use with Zebra and IPv6
549
 ### END INIT INFO
550
 
551
 # source function library
552
-. /etc/rc.d/init.d/functions
553
-
554
-# Get network config
555
-. /etc/sysconfig/network
556
+. /lib/lsb/init-functions
557
 
558
 # quagga command line options
559
-. /etc/sysconfig/quagga
560
+. /etc/default/quagga
561
 
562
 RETVAL=0
563
 PROG="ripngd"
564
-cmd=ripngd
565
-LOCK_FILE=/var/lock/subsys/ripngd
566
+cmd=/usr/sbin/ripngd
567
+LOCK_FILE=/var/lock/quagga/ripngd
568
 CONF_FILE=/etc/quagga/ripngd.conf
569
 
570
+[ -d /var/lock/quagga ] || mkdir /var/lock/quagga
571
+[ -d /run/quagga ] || ( mkdir /run/quagga && chown quagga:quagga /run/quagga )
572
+
573
+# if the config file doesn't exist, exit immediately
574
+[ -f "$CONF_FILE" ] || exit 0
575
+
576
 case "$1" in
577
   start)
578
-	# Check that networking is up.
579
-	[ "${NETWORKING}" = "no" ] && exit 1
580
-
581
-	# The process must be configured first.
582
-	[ -f $CONF_FILE ] || exit 6
583
 	if [ `id -u` -ne 0 ]; then
584
 		echo $"Insufficient privilege" 1>&2
585
 		exit 4
586
 	fi
587
 
588
-	echo -n $"Starting $PROG: "
589
-	daemon $cmd -d $RIPNGD_OPTS -f $CONF_FILE
590
+	log_daemon_msg "Starting $PROG" "$PROG"
591
+	start_daemon $cmd -d $RIPNGD_OPTS -f $CONF_FILE
592
 	RETVAL=$?
593
 	[ $RETVAL -eq 0 ] && touch $LOCK_FILE
594
-	echo
595
+	log_end_msg $RETVAL
596
 	;;
597
   stop)
598
-	echo -n $"Shutting down $PROG: "
599
-	killproc $cmd
600
+	log_daemon_msg "Shutting down $PROG" "$PROG"
601
+	killproc -p /run/quagga/$PROG.pid $cmd
602
 	RETVAL=$?
603
 	[ $RETVAL -eq 0 ] && rm -f $LOCK_FILE
604
-	echo
605
+	log_end_msg $RETVAL
606
 	;;
607
   restart|reload|force-reload)
608
 	$0 stop
609
@@ -61,7 +63,7 @@ case "$1" in
610
 	RETVAL=$?
611
 	;;
612
   status)
613
-	status $cmd
614
+	status_of_proc -p /run/quagga/$PROG.pid $cmd
615
 	RETVAL=$?
616
 	;;
617
   *)
618
diff --git a/redhat/watchquagga.init b/redhat/watchquagga.init
619
index dda3506..bed9c78 100644
620
--- a/redhat/watchquagga.init
621
+++ b/redhat/watchquagga.init
622
@@ -3,44 +3,45 @@
623
 
624
 ### BEGIN INIT INFO
625
 # Provides: watchquagga
626
+# Required-Start:    $remote_fs $syslog $network
627
+# Required-Stop:     $remote_fs $syslog $network
628
+# Default-Start:     2 3 4 5
629
+# Default-Stop:      0 1 6
630
 # Short-Description: Quagga watchdog
631
 # Description: Quagga watchdog for use with Zebra
632
 ### END INIT INFO
633
 
634
 # source function library
635
-. /etc/rc.d/init.d/functions
636
-
637
-# Get network config
638
-. /etc/sysconfig/network
639
+. /lib/lsb/init-functions
640
 
641
 # quagga command line options
642
-. /etc/sysconfig/quagga
643
+. /etc/default/quagga
644
 
645
 RETVAL=0
646
 PROG="watchquagga"
647
-cmd=watchquagga
648
-LOCK_FILE=/var/lock/subsys/watchquagga
649
+cmd=/usr/sbin/watchquagga
650
+LOCK_FILE=/var/lock/quagga/watchquagga
651
+
652
+[ -d /var/lock/quagga ] || mkdir /var/lock/quagga
653
+[ -d /run/quagga ] || ( mkdir /run/quagga && chown quagga:quagga /run/quagga )
654
 
655
 case "$1" in
656
   start)
657
-	# Check that networking is up.
658
-	[ "${NETWORKING}" = "no" ] && exit 1
659
-
660
 	# Check that there are daemons to be monitored.
661
-	[ -z "$WATCH_DAEMONS" ] && exit 1
662
+	[ -z "$WATCH_DAEMONS" ] && exit 0
663
 
664
-	echo -n $"Starting $PROG: "
665
-	daemon $cmd -d $WATCH_OPTS $WATCH_DAEMONS
666
+	log_daemon_msg "Starting $PROG" "$PROG"
667
+	start_daemon $cmd -d $WATCH_OPTS $WATCH_DAEMONS
668
 	RETVAL=$?
669
 	[ $RETVAL -eq 0 ] && touch $LOCK_FILE
670
-	echo
671
+	log_end_msg $RETVAL
672
 	;;
673
   stop)
674
-	echo -n $"Shutting down $PROG: "
675
-	killproc $cmd
676
+	log_daemon_msg "Shutting down $PROG" "$PROG"
677
+	killproc -p /run/quagga/$PROG.pid $cmd
678
 	RETVAL=$?
679
 	[ $RETVAL -eq 0 ] && rm -f $LOCK_FILE
680
-	echo
681
+	log_end_msg $RETVAL
682
 	;;
683
   restart|reload|force-reload)
684
 	$0 stop
685
@@ -55,7 +56,7 @@ case "$1" in
686
 	RETVAL=$?
687
 	;;
688
   status)
689
-	status $cmd
690
+	status_of_proc -p /run/quagga/$PROG.pid $cmd
691
 	RETVAL=$?
692
 	;;
693
   *)
694
diff --git a/redhat/zebra.init b/redhat/zebra.init
695
index 4242b16..55450c6 100644
696
--- a/redhat/zebra.init
697
+++ b/redhat/zebra.init
698
@@ -4,50 +4,52 @@
699
 
700
 ### BEGIN INIT INFO
701
 # Provides: zebra
702
+# Required-Start:    $remote_fs $syslog $network
703
+# Required-Stop:     $remote_fs $syslog $network
704
+# Default-Start:     2 3 4 5
705
+# Default-Stop:      0 1 6
706
 # Short-Description: GNU Zebra routing manager
707
 # Description: GNU Zebra routing manager
708
 ### END INIT INFO
709
 
710
 # source function library
711
-. /etc/rc.d/init.d/functions
712
-
713
-# Get network config
714
-. /etc/sysconfig/network
715
+. /lib/lsb/init-functions
716
 
717
 # quagga command line options
718
-. /etc/sysconfig/quagga
719
+. /etc/default/quagga
720
 
721
 RETVAL=0
722
 PROG="zebra"
723
-cmd=zebra
724
-LOCK_FILE=/var/lock/subsys/zebra
725
+cmd=/usr/sbin/zebra
726
+LOCK_FILE=/var/lock/quagga/zebra
727
 CONF_FILE=/etc/quagga/zebra.conf
728
 
729
+[ -d /var/lock/quagga ] || mkdir /var/lock/quagga
730
+[ -d /run/quagga ] || ( mkdir /run/quagga && chown quagga:quagga /run/quagga )
731
+
732
+# if the config file doesn't exist, exit immediately
733
+[ -f "$CONF_FILE" ] || exit 0
734
+
735
 case "$1" in
736
   start)
737
-	# Check that networking is up.
738
-	[ "${NETWORKING}" = "no" ] && exit 1
739
-
740
-	# The process must be configured first.
741
-	[ -f $CONF_FILE ] || exit 6
742
 	if [ `id -u` -ne 0 ]; then
743
 		echo $"Insufficient privilege" 1>&2
744
 		exit 4
745
 	fi
746
 
747
-	echo -n $"Starting $PROG: "
748
+	log_daemon_msg "Starting $PROG" "$PROG"
749
 	/sbin/ip route flush proto zebra
750
-	daemon $cmd -d $ZEBRA_OPTS -f $CONF_FILE
751
+	start_daemon $cmd -d $ZEBRA_OPTS -f $CONF_FILE
752
 	RETVAL=$?
753
 	[ $RETVAL -eq 0 ] && touch $LOCK_FILE
754
-	echo
755
+	log_end_msg $RETVAL
756
 	;;
757
   stop)
758
-	echo -n $"Shutting down $PROG: "
759
-	killproc $cmd
760
+	log_daemon_msg "Shutting down $PROG" "$PROG"
761
+	killproc -p /run/quagga/$PROG.pid $cmd
762
 	RETVAL=$?
763
 	[ $RETVAL -eq 0 ] && rm -f $LOCK_FILE
764
-	echo
765
+	log_end_msg $RETVAL
766
 	;;
767
   restart|reload|force-reload)
768
 	$0 stop
769
@@ -62,7 +64,7 @@ case "$1" in
770
 	RETVAL=$?
771
 	;;
772
   status)
773
-	status $cmd
774
+	status_of_proc -p /run/quagga/$PROG.pid $cmd
775
 	RETVAL=$?
776
 	;;
777
   *)
view file @ 402a2c4099
... ... --- /dev/null
... ... +++ b/DEBIAN-Remove-duplicated-footnote.patch
... ... @@ -0,0 +1,20 @@
1
From: Scott Leggett <scott@sl.id.au>
2
Date: Sun, 5 Nov 2017 22:02:51 +1100
3
Subject: Remove duplicated footnote.
4
5
---
6
 doc/bgpd.texi | 1 -
7
 1 file changed, 1 deletion(-)
8
9
diff --git a/doc/bgpd.texi b/doc/bgpd.texi
10
index 3cd442d..3a0f310 100644
11
--- a/doc/bgpd.texi
12
+++ b/doc/bgpd.texi
13
@@ -1724,7 +1724,6 @@ Dump all BGP packet and events to @var{path} file.
14
 If @var{interval} is set, a new file will be created for echo @var{interval} of seconds.
15
 The path @var{path} can be set with date and time formatting (strftime).
16
 The type ‘all-et’ enables support for Extended Timestamp Header (@pxref{Packet Binary Dump Format}).
17
-(@pxref{Packet Binary Dump Format})
18
 @end deffn 
19
 
20
 @deffn Command {dump bgp updates @var{path} [@var{interval}]} {}
view file @ 402a2c4099
... ... --- /dev/null
... ... +++ b/quagga-sysusers.conf
... ... @@ -0,0 +1,4 @@
1
u @quagga_user@ - "Quagga routing suite user" /run/quagga
2
g @quagga_user@ -
3
g @vty_group@ -
4
m @quagga_user@ @vty_group@
... ... --- a/quagga.spec
... ... +++ b/quagga.spec
... ... @@ -1,4 +1,4 @@
1
%define	_disable_ld_no_undefined 1
1
%define _disable_ld_no_undefined 1
2 2
3 3
# configure options
4 4
%define	with_snmp	0
... ... @@ -35,12 +35,13 @@
35 35
Summary:	Routing daemon
36 36
Name:		quagga
37 37
Version:	1.2.4
38
Release:	1
38
Release:	2
39 39
License:	GPLv2+
40 40
Group:		System/Servers
41 41
Url:		http://www.quagga.net
42 42
Source0:	http://download.savannah.gnu.org/releases/quagga/%{name}-%{version}.tar.gz
43
Source2:	%{name}-tmpfiles.conf
43
Source2:	quagga-tmpfiles.conf
44
Source3:	quagga-sysusers.conf
44 45
Source10:	babeld.service
45 46
Source11:	ripngd.service
46 47
Source12:	ospf6d.service
... ... @@ -51,6 +52,10 @@ Source16: bgpd.service
52 52
Source17:	zebra.service
53 53
Source18:	watchquagga.service
54 54
Source100:	%{name}.rpmlintrc
55
Patch1:		DEBIAN-Add-correct-QUAGGA_VERSION-to-manpages.patch
56
Patch2:		DEBIAN-Fix-typo-in-dump-bgp-help-text.patch
57
Patch3:		DEBIAN-Patch-init-scripts-for-Debian.patch
58
Patch4:		DEBIAN-Remove-duplicated-footnote.patch
55 59
BuildRequires:	chrpath
56 60
BuildRequires:	gawk
57 61
BuildRequires:	systemd-units
... ... @@ -71,8 +76,6 @@ Requires: net-snmp-mibs
76 76
BuildRequires:	readline-devel
77 77
BuildRequires:	pkgconfig(ncurses)
78 78
%endif
79
Requires(post):		systemd
80
Requires(pre,post,preun,postun):	rpm-helper
81 79
82 80
%description
83 81
Quagga is a free software that manages TCP/IP based routing
... ... @@ -91,6 +94,7 @@ Quagga is a fork of GNU Zebra.
94 94
%dir %attr(0751,%{quagga_user},%{quagga_user}) %{_sysconfdir}/quagga
95 95
%dir %attr(0750,%{quagga_user},%{quagga_user}) /var/log/quagga
96 96
%{_tmpfilesdir}/%{name}.conf
97
%{_sysusersdir}/%{name}.conf
97 98
#
98 99
%attr(0640,%{quagga_user},%{vty_group}) %config(noreplace) %{_sysconfdir}/quagga/vtysh.conf*
99 100
#
... ... @@ -152,22 +156,19 @@ Quagga is a fork of GNU Zebra.
156 156
%{_infodir}/*info*
157 157
158 158
%pre
159
# add vty_group
160
%_pre_groupadd %{vty_group}
161
# add quagga user and group
162
%_pre_useradd %{quagga_user} %{_localstatedir}/lib /sbin/nologin
159
%sysusers_create_package %{name} %{SOURCE3}
163 160
164 161
%post
165
systemd-tmpfiles --create %{name}.conf
166
%_post_service zebra
167
%_post_service ripd
162
%tmpfiles_create %{name}.conf
163
%systemd_post zebra.service
164
%systemd_post ripd.service
168 165
%if %{with_ipv6}
169
%_post_service ospf6d
170
%_post_service ripngd
166
%systemd_post ospf6d.service
167
%systemd_post ripngd.service
171 168
%endif
172
%_post_service ospfd
173
%_post_service bgpd
174
%_post_service watchquagga
169
%systemd_post ospfd.service
170
%systemd_post bgpd.service
171
%systemd_post watchquagga.service
175 172
176 173
# Create dummy files if they don't exist so basic functions can be used.
177 174
if [ ! -e %{_sysconfdir}/quagga/zebra.conf ]; then
... ... @@ -178,24 +179,9 @@ fi
179 179
if [ ! -e %{_sysconfdir}/quagga/vtysh.conf ]; then
180 180
	touch %{_sysconfdir}/quagga/vtysh.conf
181 181
	chmod 640 %{_sysconfdir}/quagga/vtysh.conf
182
	chown %{quagga_user}:%{vty_group} %{_sysconfdir}/quagga/vtysh.conf
182 183
fi
183 184
184
%preun
185
%_preun_service zebra
186
%_preun_service ripd
187
%if %{with_ipv6}
188
%_preun_service ripngd
189
%endif
190
%_preun_service ospfd
191
%if %{with_ipv6}
192
%_preun_service ospf6d
193
%endif
194
%_preun_service bgpd
195
%_preun_service watchquagga
196
197
%postun
198
%_postun_userdel %{quagga_user}
199
200 185
#----------------------------------------------------------------------------
201 186
202 187
%package contrib
... ... @@ -289,15 +275,17 @@ developing OSPF-API and quagga applications.
275 275
276 276
%prep
277 277
%setup -q
278
%autopatch -p1
278 279
279 280
280 281
%build
281
export CFLAGS="%{optflags} -fPIC"
282
283 282
%serverbuild
284 283
autoreconf -vfi
285 284
# Unrecognized options: --enable-netlink --with-pcreposix --enable-ipv6
286
%configure --disable-static \
285
%configure \
286
	--disable-static \
287
	--with-pic \
288
	--with-pkg-extra-version="-rosa" \
287 289
	--sysconfdir=%{_sysconfdir}/quagga \
288 290
	--localstatedir=/run/quagga \
289 291
%if %{with_snmp}
... ... @@ -383,6 +371,9 @@ install -m 644 %{SOURCE12} %{buildroot}%{_unitdir}
371 371
%if %{with_isisd}
372 372
install -m 644 %{SOURCE13} %{buildroot}%{_unitdir}
373 373
%endif
374
mkdir -p %{buildroot}%{_sysusersdir}
375
cat %{SOURCE3} | sed -e 's,@quagga_user@,%{quagga_user},g' -e 's,@vty_group@,%{vty_group},g' \
376
	> %{buildroot}%{_sysusersdir}/%{name}.conf
374 377
375 378
# Install sysconfig and logrotate stuff
376 379
install -m644 %{zeb_rh_src}/quagga.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/quagga

Comments