summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPacho Ramos <pacho@gentoo.org>2010-09-07 12:11:06 +0000
committerPacho Ramos <pacho@gentoo.org>2010-09-07 12:11:06 +0000
commit2266833a9d1eeece169437e4af4d6229b43bfa61 (patch)
tree67516f3c8c0632aee96cc9121d283e366b82dd36 /sys-apps/preload
parentNon-maintainer commit: Revision bump to fix CVE-2010-2956 (bug 335381). Remov... (diff)
downloadgentoo-2-2266833a9d1eeece169437e4af4d6229b43bfa61.tar.gz
gentoo-2-2266833a9d1eeece169437e4af4d6229b43bfa61.tar.bz2
gentoo-2-2266833a9d1eeece169437e4af4d6229b43bfa61.zip
Revision bump to fix race condition (bug #299140 by Ambroz Bizjak) and make it POSIX compliant (bug #310511 by Michał Górny), thanks a lot to Michał for providing the new init.d script.
(Portage version: 2.1.8.3/cvs/Linux x86_64)
Diffstat (limited to 'sys-apps/preload')
-rw-r--r--sys-apps/preload/ChangeLog10
-rwxr-xr-xsys-apps/preload/files/preload-0.6.4.init.in-r166
-rw-r--r--sys-apps/preload/preload-0.6.4-r2.ebuild52
3 files changed, 127 insertions, 1 deletions
diff --git a/sys-apps/preload/ChangeLog b/sys-apps/preload/ChangeLog
index fe7902ec31f2..de0507675f10 100644
--- a/sys-apps/preload/ChangeLog
+++ b/sys-apps/preload/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for sys-apps/preload
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/preload/ChangeLog,v 1.15 2010/09/06 15:36:10 pacho Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/preload/ChangeLog,v 1.16 2010/09/07 12:11:05 pacho Exp $
+
+*preload-0.6.4-r2 (07 Sep 2010)
+
+ 07 Sep 2010; Pacho Ramos <pacho@gentoo.org> +preload-0.6.4-r2.ebuild,
+ +files/preload-0.6.4.init.in-r1:
+ Revision bump to fix race condition (bug #299140 by Ambroz Bizjak) and
+ make it POSIX compliant (bug #310511 by Michał Górny), thanks a lot to
+ Michał for providing the new init.d script.
06 Sep 2010; Pacho Ramos <pacho@gentoo.org> preload-0.6.4-r1.ebuild,
+files/preload-0.6.4-use-help2man-as-usual.patch,
diff --git a/sys-apps/preload/files/preload-0.6.4.init.in-r1 b/sys-apps/preload/files/preload-0.6.4.init.in-r1
new file mode 100755
index 000000000000..8a6351940743
--- /dev/null
+++ b/sys-apps/preload/files/preload-0.6.4.init.in-r1
@@ -0,0 +1,66 @@
+#!/sbin/runscript
+
+description='Start/stop the preload daemon'
+extra_started_commands='dump reload'
+description_dump='Dump the config and state of the daemon (to the logfile)'
+description_reload='Reload the daemon'
+
+PIDFILE="/var/run/preload.pid"
+
+depend() {
+ after localmount
+ use netmount ntpd
+}
+
+dump() {
+ local pid
+ pid=$(cat ${PIDFILE})
+
+ ebegin "Dumping the config and state of preload"
+ if [ -n "${pid}" ]; then
+ kill -USR1 ${pid}
+ kill -USR2 ${pid}
+ fi
+ eend ${?} && \
+ einfo "These should have been written to ${PRELOAD_LOGFILE:-/var/log/preload.log}"
+}
+
+reload() {
+ ebegin "Reloading preload"
+ kill -HUP $(cat ${PIDFILE})
+ eend ${?}
+}
+
+start() {
+ local ionice
+
+ ebegin "Starting preload"
+
+ #MIN_MEMORY=${MIN_MEMORY:-256}
+ # Check for > MIN_MEMORY MB
+ #free -m | awk '/Mem:/ {exit ($2 >= ('"$MIN_MEMORY"'))?0:1}' || exit 0
+
+ # First try to start with ionice; if that fails, try without.
+ for ionice in "ionice ${IONICE_OPTS:--c3}" ''; do
+ # Avoid 'ionice not found' errors
+ ${ionice:-true} >/dev/null 2>&1 || continue
+
+ ${ionice} start-stop-daemon --start --quiet --background \
+ --make-pidfile --pidfile ${PIDFILE} \
+ --exec /usr/sbin/preload -- \
+ -l ${PRELOAD_LOGFILE:-/var/log/preload.log} \
+ -V ${PRELOAD_VERBOSITY:-1} \
+ -n ${PRELOAD_NICE:-15} \
+ -s ${PRELOAD_STATEFILE:-""} \
+ ${PRELOAD_OPTS} -f \
+ && break
+ done
+
+ eend ${?}
+}
+
+stop() {
+ ebegin "Stopping preload (this may take a while)"
+ start-stop-daemon --stop --retry 120 --quiet --pidfile ${PIDFILE}
+ eend ${?}
+}
diff --git a/sys-apps/preload/preload-0.6.4-r2.ebuild b/sys-apps/preload/preload-0.6.4-r2.ebuild
new file mode 100644
index 000000000000..aa44842ebef0
--- /dev/null
+++ b/sys-apps/preload/preload-0.6.4-r2.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/preload/preload-0.6.4-r2.ebuild,v 1.1 2010/09/07 12:11:05 pacho Exp $
+
+EAPI="2"
+
+inherit eutils autotools
+
+DESCRIPTION="Adaptive readahead daemon."
+HOMEPAGE="http://sourceforge.net/projects/preload/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="vanilla"
+
+WANT_AUTOCONF="2.56"
+
+RDEPEND=">=dev-libs/glib-2.6"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/00-patch-configure.diff
+ epatch "${FILESDIR}"/02-patch-preload_conf.diff
+ epatch "${FILESDIR}"/02-patch-preload_sysconfig.diff
+ epatch "${FILESDIR}"/${PN}-0.6.4-use-help2man-as-usual.patch
+ epatch "${FILESDIR}"/${PN}-0.6.4-use-make-dependencies.patch
+ use vanilla || epatch "${FILESDIR}"/000{1,2,3}-*.patch
+ cat "${FILESDIR}"/preload-0.6.4.init.in-r1 > preload.init.in || die
+
+ eautoreconf
+}
+
+src_configure() {
+ econf --localstatedir=/var
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "install failed"
+ # Remove log and state file from image or they will be
+ # truncated during merge
+ rm "${D}"/var/lib/preload/preload.state || die "cleanup failed"
+ rm "${D}"/var/log/preload.log || die "cleanup failed"
+ keepdir /var/lib/preload
+ keepdir /var/log
+}
+
+pkg_postinst() {
+ elog "You probably want to add preload to the default runlevel like so:"
+ elog "# rc-update add preload default"
+}