Gentoo Archives: gentoo-commits

From: "Tobias Klausmann (klausman)" <klausman@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-analyzer/smokeping/files: smokeping.init.2
Date: Sun, 29 Apr 2012 10:32:24
Message-Id: 20120429103215.95BF12004C@flycatcher.gentoo.org
1 klausman 12/04/29 10:32:15
2
3 Modified: smokeping.init.2
4 Log:
5 Fix init script to not trigger warnings with newer OpenRC. Also simplify dump and restore commands (OpenRC will do these checks for us now).
6
7 (Portage version: 2.1.10.57/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.2 net-analyzer/smokeping/files/smokeping.init.2
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/smokeping/files/smokeping.init.2?rev=1.2&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/smokeping/files/smokeping.init.2?rev=1.2&content-type=text/plain
14 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/smokeping/files/smokeping.init.2?r1=1.1&r2=1.2
15
16 Index: smokeping.init.2
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/net-analyzer/smokeping/files/smokeping.init.2,v
19 retrieving revision 1.1
20 retrieving revision 1.2
21 diff -u -r1.1 -r1.2
22 --- smokeping.init.2 16 Jun 2010 18:24:17 -0000 1.1
23 +++ smokeping.init.2 29 Apr 2012 10:32:15 -0000 1.2
24 @@ -1,8 +1,9 @@
25 #!/sbin/runscript
26 -# Copyright 1999-2008 Gentoo Foundation
27 +# Copyright 1999-2012 Gentoo Foundation
28 # Distributed under the terms of the GNU General Public License v2
29
30 -opts="${opts} dump reload restore"
31 +extra_started_commands="reload"
32 +extra_stopped_commands="dump restore"
33
34 depend() {
35 need net
36 @@ -48,10 +49,6 @@
37
38 dump() {
39 ebegin "Dumping smokeping rrd files to XML for backup or upgrade use"
40 - if service_started "${myservice}" ; then
41 - eerror "You need to stop smokeping before dumping files!"
42 - return 1
43 - fi
44 for f in `find /var/lib/smokeping -name '*.rrd' -print` ; do
45 f_xml=`dirname $f`/`basename $f .rrd`.xml
46 rrdtool dump "$f" > "${f_xml}"
47 @@ -62,10 +59,6 @@
48
49 restore() {
50 ebegin "Restoring smokeping rrd files from XML dump files"
51 - if service_started "${myservice}" ; then
52 - eerror "You need to stop smokeping before restoring files!"
53 - return 1
54 - fi
55 for f in `find /var/lib/smokeping -name '*.xml' -print` ; do
56 f_rrd=`dirname $f`/`basename $f .xml`.rrd
57 mv -f "${f_rrd}" "${f_rrd}.bak"