From: "Peter Volkov (pva)" <pva@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] gentoo-x86 commit in net-analyzer/smokeping/files: smokeping.init.2
Date: Wed, 16 Jun 2010 18:24:17 +0000 (UTC) [thread overview]
Message-ID: <20100616182417.9BB9C2C3ED@corvid.gentoo.org> (raw)
pva 10/06/16 18:24:17
Added: smokeping.init.2
Log:
Create /var/run/smokeping directory at init.d script start as FSH suggests. Fix permissions of that directory, bug #324177, thank Weeve for report.
(Portage version: 2.1.8.3/cvs/Linux x86_64)
Revision Changes Path
1.1 net-analyzer/smokeping/files/smokeping.init.2
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/smokeping/files/smokeping.init.2?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/smokeping/files/smokeping.init.2?rev=1.1&content-type=text/plain
Index: smokeping.init.2
===================================================================
#!/sbin/runscript
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
opts="${opts} dump reload restore"
depend() {
need net
use dns
}
checkconfig() {
if [ ! -f "/etc/smokeping/config" ] ; then
eerror "You need /etc/smokeping/config to run smokeping!"
return 1
fi
}
start() {
checkconfig || return 1
if [ ! -d /var/run/smokeping/ ]; then
mkdir /var/run/smokeping/
fi
chown smokeping:smokeping /var/run/smokeping/
ebegin "Starting smokeping"
LC_ALL=C \
start-stop-daemon --start --name smokeping \
--pidfile /var/run/smokeping/smokeping.pid \
--exec /usr/bin/smokeping \
--chuid smokeping:smokeping
eend $?
}
stop() {
ebegin "Stopping smokeping"
start-stop-daemon --stop \
--pidfile /var/run/smokeping/smokeping.pid
eend $?
}
reload() {
ebegin "Reloading smokeping"
/usr/bin/smokeping --reload 1>/dev/null 2>&1
eend $?
}
dump() {
ebegin "Dumping smokeping rrd files to XML for backup or upgrade use"
if service_started "${myservice}" ; then
eerror "You need to stop smokeping before dumping files!"
return 1
fi
for f in `find /var/lib/smokeping -name '*.rrd' -print` ; do
f_xml=`dirname $f`/`basename $f .rrd`.xml
rrdtool dump "$f" > "${f_xml}"
chown root:0 "${f_xml}"
done
eend $?
}
restore() {
ebegin "Restoring smokeping rrd files from XML dump files"
if service_started "${myservice}" ; then
eerror "You need to stop smokeping before restoring files!"
return 1
fi
for f in `find /var/lib/smokeping -name '*.xml' -print` ; do
f_rrd=`dirname $f`/`basename $f .xml`.rrd
mv -f "${f_rrd}" "${f_rrd}.bak"
chown root:0 "${f_rrd}.bak"
rrdtool restore "$f" "${f_rrd}"
chown smokeping:smokeping "${f_rrd}"
done
eend $?
}
next reply other threads:[~2010-06-16 18:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-16 18:24 Peter Volkov (pva) [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-04-29 10:32 [gentoo-commits] gentoo-x86 commit in net-analyzer/smokeping/files: smokeping.init.2 Tobias Klausmann (klausman)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100616182417.9BB9C2C3ED@corvid.gentoo.org \
--to=pva@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox