diff options
author | Jeremy Olexa <darkside@gentoo.org> | 2009-05-20 02:58:30 +0000 |
---|---|---|
committer | Jeremy Olexa <darkside@gentoo.org> | 2009-05-20 02:58:30 +0000 |
commit | b902bf5aa810fca9e8caccba904f1e1993169f53 (patch) | |
tree | 3b0d87280f80a3c3739af181ef14cfef768724cd /sys-apps/preload | |
parent | Automated update of use.local.desc (diff) | |
download | gentoo-2-b902bf5aa810fca9e8caccba904f1e1993169f53.tar.gz gentoo-2-b902bf5aa810fca9e8caccba904f1e1993169f53.tar.bz2 gentoo-2-b902bf5aa810fca9e8caccba904f1e1993169f53.zip |
Misc fixes, bug 267538 - imported from Kai Krakow's overlay
(Portage version: 2.1.6.13/cvs/Linux x86_64)
Diffstat (limited to 'sys-apps/preload')
14 files changed, 225 insertions, 164 deletions
diff --git a/sys-apps/preload/ChangeLog b/sys-apps/preload/ChangeLog index 102b28e6f78f..960bce48245d 100644 --- a/sys-apps/preload/ChangeLog +++ b/sys-apps/preload/ChangeLog @@ -1,6 +1,22 @@ # ChangeLog for sys-apps/preload # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/preload/ChangeLog,v 1.9 2009/05/07 03:06:49 darkside Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/preload/ChangeLog,v 1.10 2009/05/20 02:58:30 darkside Exp $ + +*preload-0.6.4-r1 (20 May 2009) + + 20 May 2009; Jeremy Olexa <darkside@gentoo.org> + -files/preload-0.6.3-conf.patch, +files/00-patch-configure.diff, + -files/preload-0.6.3-forking-children.patch, + +files/0002-Create-short-overlapping-io-bursts.patch, + -files/preload-0.6.3-nice-segfault.patch, + -files/preload-0.6.3-overlapping-io-bursts.patch, + +files/0001-Early-restart-of-forking-readahead-children.patch, + +files/preload-0.6.4.init.in, + +files/0003-Fix-wait_for_children-loop.patch, + +files/02-patch-preload_conf.diff, +files/02-patch-preload_sysconfig.diff, + -files/conf.d-preload, -files/init.d-preload, -preload-0.6.3-r5.ebuild, + +preload-0.6.4-r1.ebuild: + Misc fixes, bug 267538 - imported from Kai Krakow's overlay *preload-0.6.4 (07 May 2009) diff --git a/sys-apps/preload/files/00-patch-configure.diff b/sys-apps/preload/files/00-patch-configure.diff new file mode 100644 index 000000000000..6d7faab3c60c --- /dev/null +++ b/sys-apps/preload/files/00-patch-configure.diff @@ -0,0 +1,13 @@ +--- a/configure.ac 2008-02-26 12:40:18.421567321 +0100 ++++ b/configure.ac 2008-02-26 12:41:10.198008844 +0100 +@@ -54,8 +54,8 @@ + + # Directories we need. + pkgdocdir='${datadir}/doc/'${PACKAGE_NAME}-${PACKAGE_VERSION} +-initddir='${sysconfdir}/rc.d/init.d' +-sysconfigdir='${sysconfdir}/sysconfig' ++initddir='${sysconfdir}/init.d' ++sysconfigdir='${sysconfdir}/conf.d' + logrotatedir='${sysconfdir}/logrotate.d' + logdir='${localstatedir}/log' + subsysdir='${localstatedir}/lock/subsys' diff --git a/sys-apps/preload/files/preload-0.6.3-forking-children.patch b/sys-apps/preload/files/0001-Early-restart-of-forking-readahead-children.patch index 3f705237acbc..2143ba3cc15e 100644 --- a/sys-apps/preload/files/preload-0.6.3-forking-children.patch +++ b/sys-apps/preload/files/0001-Early-restart-of-forking-readahead-children.patch @@ -37,7 +37,7 @@ index c169e81..7617449 100644 { /* wait for child processes to terminate */ - while (procs > 0) -+ while (procs > maxprocs) ++ while (procs >= maxprocs) { int status; if (wait (&status) > 0) diff --git a/sys-apps/preload/files/preload-0.6.3-overlapping-io-bursts.patch b/sys-apps/preload/files/0002-Create-short-overlapping-io-bursts.patch index 20ba67a1bb4b..20ba67a1bb4b 100644 --- a/sys-apps/preload/files/preload-0.6.3-overlapping-io-bursts.patch +++ b/sys-apps/preload/files/0002-Create-short-overlapping-io-bursts.patch diff --git a/sys-apps/preload/files/0003-Fix-wait_for_children-loop.patch b/sys-apps/preload/files/0003-Fix-wait_for_children-loop.patch new file mode 100644 index 000000000000..dc37548638a5 --- /dev/null +++ b/sys-apps/preload/files/0003-Fix-wait_for_children-loop.patch @@ -0,0 +1,27 @@ +From 536714622135e53db3f8a5673db32c5de9620aa8 Mon Sep 17 00:00:00 2001 +From: Kai Krakow <kai@kaishome.de> +Date: Tue, 29 Jul 2008 08:15:55 +0200 +Subject: [PATCH] Fix wait_for_children() loop + +Brain damage repaired: One should not wait while zero or +more children exist... That's always the case. :-( +--- + src/readahead.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/src/readahead.c b/src/readahead.c +index 466961d..08d9f4f 100644 +--- a/src/readahead.c ++++ b/src/readahead.c +@@ -106,7 +106,7 @@ static void + wait_for_children (int maxprocs) + { + /* wait for child processes to terminate */ +- while (procs >= maxprocs) ++ while (procs > maxprocs) + { + int status; + if (wait (&status) > 0) +-- +1.5.4.5 + diff --git a/sys-apps/preload/files/02-patch-preload_conf.diff b/sys-apps/preload/files/02-patch-preload_conf.diff new file mode 100644 index 000000000000..70055c3bbb0f --- /dev/null +++ b/sys-apps/preload/files/02-patch-preload_conf.diff @@ -0,0 +1,21 @@ +diff -urN preload-0.6.orig/src/preload.conf.in preload-0.6/src/preload.conf.in +--- preload-0.6.orig/src/preload.conf.in 2008-07-24 02:02:11.000000000 +0200 ++++ preload-0.6/src/preload.conf.in 2008-07-24 16:32:28.565184094 +0200 +@@ -132,7 +132,7 @@ + # preload doesn't special-handle device files internally. + # + # default: (empty list, accept all) +-mapprefix = /usr/;/lib;/var/cache/;!/ ++mapprefix = /usr/;/lib;/var/cache/;/opt/;/home/;!/ + + # exeprefix: + # +@@ -141,7 +141,7 @@ + # files instead of maps. + # + # default: (empty list, accept all) +-exeprefix = !/usr/sbin/;!/usr/local/sbin/;/usr/;!/ ++exeprefix = !/usr/sbin/;!/usr/local/sbin/;/usr/;/opt/;/usr/libexec/;!/ + + # maxprocs + # diff --git a/sys-apps/preload/files/02-patch-preload_sysconfig.diff b/sys-apps/preload/files/02-patch-preload_sysconfig.diff new file mode 100644 index 000000000000..2a8e14525b4e --- /dev/null +++ b/sys-apps/preload/files/02-patch-preload_sysconfig.diff @@ -0,0 +1,39 @@ +diff -urN preload-0.6.4.orig/preload.sysconfig preload-0.6.4/preload.sysconfig +--- preload-0.6.4.orig/preload.sysconfig 2008-10-23 03:08:20.000000000 +0200 ++++ preload-0.6.4/preload.sysconfig 2009-05-01 13:51:03.493828659 +0200 +@@ -1,10 +1,30 @@ ++# Copyright 1999-2008 Gentoo Foundation ++# $Header: /var/cvsroot/gentoo-x86/sys-apps/preload/files/02-patch-preload_sysconfig.diff,v 1.1 2009/05/20 02:58:30 darkside Exp $ ++# preload configuration file ++ ++PIDFILE="/var/run/preload.pid" ++ ++# verbosity. 0-10, Default is 1. ++#PRELOAD_VERBOSITY="1" ++ ++# set this for niceness. Default is 15. Valid ranges are from -20 to 19. See ++# nice(1) man page. ++#PRELOAD_NICE="15" ++ ++# log file (default is /var/log/preload.log ) ++#PRELOAD_LOGFILE="/var/log/preload.log" ++ ++# preload state file (default location is /var/lib/preload/preload.state ) ++# Empty (commented out) means no state is saved. ++PRELOAD_STATEFILE="/var/lib/preload/preload.state" ++ + # Miminum memory that the system should have for preload to be launched. +-# In megabytes. +-MIN_MEMORY="256" ++# In megabytes. Currently unused. ++#MIN_MEMORY="256" + + # Command-line arguments to pass to the daemon. Read preload(8) man page + # for available options. +-PRELOAD_OPTS="--verbose 1" ++#PRELOAD_OPTS="--verbose 1" + +-# Option to call ionice with. Leave empty to skip ionice. +-IONICE_OPTS="-c3" ++# Option to call ionice with. Leave empty to use defaults. ++#IONICE_OPTS="-c3" diff --git a/sys-apps/preload/files/conf.d-preload b/sys-apps/preload/files/conf.d-preload deleted file mode 100644 index 400778d091a4..000000000000 --- a/sys-apps/preload/files/conf.d-preload +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# $Header: /var/cvsroot/gentoo-x86/sys-apps/preload/files/conf.d-preload,v 1.6 2008/10/28 02:02:14 darkside Exp $ -# preload configuration file - -PIDFILE="/var/run/preload.pid" - -# verbosity. 0-10, Default is 4. -#PRELOAD_VERBOSITY="4" - -# set this for niceness. Default is 15. Valid ranges are from -20 to 19. See -# nice(1) man page. -#PRELOAD_NICE="15" - -# log file (default is /var/log/preload.log ) -#PRELOAD_LOGFILE="/var/log/preload.log" - -# preload state file (default location is /var/lib/preload/preload.state ) -# Empty (commented out) means no state is saved. -PRELOAD_STATEFILE="/var/lib/preload/preload.state" - -# Option to call ionice with. Leave empty to skip ionice. -#IONICE_OPTS="-c3" diff --git a/sys-apps/preload/files/init.d-preload b/sys-apps/preload/files/init.d-preload deleted file mode 100644 index 33890ae87cf8..000000000000 --- a/sys-apps/preload/files/init.d-preload +++ /dev/null @@ -1,29 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/preload/files/init.d-preload,v 1.6 2008/10/28 13:04:57 darkside Exp $ - -depend() { - after localmount xdm -} - -start() { - ebegin "Starting preload" - start-stop-daemon --start --quiet --background \ - --make-pidfile --pidfile ${PIDFILE} --exec /usr/sbin/preload -- \ - -l ${PRELOAD_LOGFILE:-/var/log/preload.log} -V ${PRELOAD_VERBOSITY:-4} \ - -n ${PRELOAD_NICE:-15} -s ${PRELOAD_STATEFILE:-""} -f - - IONICE="$(command -v ionice)" - if [ -x "${IONICE}" -a -n "${IONICE_OPTS}" ]; then - einfo "ionicing preload" - "${IONICE}" "${IONICE_OPTS}" -p $(cat ${PIDFILE}) - fi - eend $? -} - -stop() { - ebegin "Stopping preload (may take awhile)" - start-stop-daemon --stop --retry 120 --quiet --pidfile ${PIDFILE} - eend $? -} diff --git a/sys-apps/preload/files/preload-0.6.3-conf.patch b/sys-apps/preload/files/preload-0.6.3-conf.patch deleted file mode 100644 index e7e27367039d..000000000000 --- a/sys-apps/preload/files/preload-0.6.3-conf.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- src/preload.conf.in~ 2008-10-18 17:12:39.000000000 +0200 -+++ src/preload.conf.in 2008-10-18 17:12:39.000000000 +0200 -@@ -132,7 +132,7 @@ - # preload doesn't special-handle device files internally. - # - # default: (empty list, accept all) --mapprefix = /usr;/lib;/lib64;/var/cache;!/ -+mapprefix = /usr;/lib;/lib64;/lib32;/opt;/var/cache;!/ - - # exeprefix: - # -@@ -141,7 +141,7 @@ - # files instead of maps. - # - # default: (empty list, accept all) --exeprefix = !/usr/sbin;!/usr/local/sbin;/usr;!/ -+exeprefix = !/usr/sbin;!/usr/local/sbin;/usr;/opt;!/ - - # maxprocs - # diff --git a/sys-apps/preload/files/preload-0.6.3-nice-segfault.patch b/sys-apps/preload/files/preload-0.6.3-nice-segfault.patch deleted file mode 100644 index 058c5367770f..000000000000 --- a/sys-apps/preload/files/preload-0.6.3-nice-segfault.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 6c0e605415f82509522597f8695be8797104ac4b Mon Sep 17 00:00:00 2001 -From: Behdad Esfahbod <behdad@users.sourceforge.net> -Date: Tue, 19 Aug 2008 16:38:54 +0000 -Subject: [PATCH] 2008-08-19 Behdad Esfahbod <behdad@gnome.org> - - * src/cmdline.c: --nice was segfaulting. Fix it. ---- - ChangeLog | 4 ++++ - src/cmdline.c | 2 +- - 2 files changed, 5 insertions(+), 1 deletions(-) - -diff --git a/ChangeLog b/ChangeLog -index 2d785af..87ac2a0 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,7 @@ -+2008-08-19 Behdad Esfahbod <behdad@gnome.org> -+ -+ * src/cmdline.c: --nice was segfaulting. Fix it. -+ - 2008-07-28 Behdad Esfahbod <behdad@gnome.org> - - * NEWS: -diff --git a/src/cmdline.c b/src/cmdline.c -index b175a21..e4e6797 100644 ---- a/src/cmdline.c -+++ b/src/cmdline.c -@@ -38,7 +38,7 @@ static const struct option const opts[] = { - {"statefile", 1, 0, 's'}, - {"logfile", 1, 0, 'l'}, - {"foreground", 0, 0, 'f'}, -- {"nice", 0, 0, 'n'}, -+ {"nice", 1, 0, 'n'}, - {"verbose", 1, 0, 'V'}, - {"debug", 0, 0, 'd'}, - {NULL, 0, 0, 0}, --- -1.5.6.4 - diff --git a/sys-apps/preload/files/preload-0.6.4.init.in b/sys-apps/preload/files/preload-0.6.4.init.in new file mode 100644 index 000000000000..664cc9b09983 --- /dev/null +++ b/sys-apps/preload/files/preload-0.6.4.init.in @@ -0,0 +1,50 @@ +#!/sbin/runscript + +PIDFILE="/var/run/@PACKAGE@.pid" + +depend() { + after localmount + use netmount ntpd +} + +dump() { + ebegin "Dumping config and state for @PACKAGE@" + kill -USR1 $(<${PIDFILE}) + kill -USR2 $(<${PIDFILE}) + eend $? +} + +reload() { + ebegin "Reloading @PACKAGE@" + kill -HUP $(<${PIDFILE}) + eend $? +} + +start() { + ebegin "Starting @PACKAGE@" + + #MIN_MEMORY=${MIN_MEMORY:-256} + # Check for > MIN_MEMORY MB + #free -m | awk '/Mem:/ {exit ($2 >= ('"$MIN_MEMORY"'))?0:1}' || exit 0 + + # IMPORTANT: Let ssd do the backgrounding so we immediatly get a valid + # pid file in the next step (ionice) + start-stop-daemon --start --quiet --background \ + --make-pidfile --pidfile ${PIDFILE} \ + --exec @sbindir@/@PACKAGE@ -- \ + -l ${PRELOAD_LOGFILE:-/var/log/preload.log} -V ${PRELOAD_VERBOSITY:-1} \ + -n ${PRELOAD_NICE:-15} -s ${PRELOAD_STATEFILE:-""} ${PRELOAD_OPTS} -f + + IONICE=$(which ionice) + if [ -x "$IONICE" ]; then + IONICE_OPTS=${IONICE_OPTS:--c3} + $IONICE ${IONICE_OPTS} -p$(<${PIDFILE}) + fi + eend $? +} + +stop() { + ebegin "Stopping @PACKAGE@ (this may take while)" + start-stop-daemon --stop --retry 120 --quiet --pidfile ${PIDFILE} + eend $? +} diff --git a/sys-apps/preload/preload-0.6.3-r5.ebuild b/sys-apps/preload/preload-0.6.3-r5.ebuild deleted file mode 100644 index b8ae5d576c4e..000000000000 --- a/sys-apps/preload/preload-0.6.3-r5.ebuild +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/preload/preload-0.6.3-r5.ebuild,v 1.1 2008/10/28 02:02:14 darkside Exp $ - -inherit eutils - -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" - -RDEPEND="dev-libs/glib" -DEPEND="${RDEPEND} - dev-util/pkgconfig" - -src_unpack() { - unpack ${A} - cd "${S}" - # Patch to add /opt & /lib32 to allowed files to preload. Submitted - # upstream, bug #242580 - epatch "${FILESDIR}/${P}-conf.patch" - epatch "${FILESDIR}/${P}-nice-segfault.patch" - use vanilla || epatch "${FILESDIR}/${P}-forking-children.patch" - use vanilla || epatch "${FILESDIR}/${P}-overlapping-io-bursts.patch" -} - -src_compile() { - econf --localstatedir=/var - emake -j1 || die "emake failed" -} - -src_install() { - emake DESTDIR="${D}" install || die "install failed" - rm -rf "${D}/etc/rc.d/" || die "rm rc.d failed" - rm -rf "${D}/etc/sysconfig/" || die "rm sysconfig failed" - rm -f "${D}/var/lib/preload/preload.state" || die "cleanup1 failed" - rm -f "${D}/var/log/preload.log" || die "cleanup2 failed" - keepdir /var/lib/preload - keepdir /var/log - newinitd "${FILESDIR}/init.d-preload" preload || die "initd failed" - newconfd "${FILESDIR}/conf.d-preload" preload || die "confd failed" - dodoc AUTHORS ChangeLog NEWS README THANKS TODO -} - -pkg_postinst() { - elog "To start preload at boot, remember to add it to a runlevel:" - elog "# rc-update add preload default" -} diff --git a/sys-apps/preload/preload-0.6.4-r1.ebuild b/sys-apps/preload/preload-0.6.4-r1.ebuild new file mode 100644 index 000000000000..c199f96b31f0 --- /dev/null +++ b/sys-apps/preload/preload-0.6.4-r1.ebuild @@ -0,0 +1,57 @@ +# Copyright 1999-2009 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-r1.ebuild,v 1.1 2009/05/20 02:58:30 darkside Exp $ + +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_unpack() { + unpack ${A} + cd "${S}" + + epatch "${FILESDIR}"/00-patch-configure.diff + epatch "${FILESDIR}"/02-patch-preload_conf.diff + epatch "${FILESDIR}"/02-patch-preload_sysconfig.diff + use vanilla || epatch "${FILESDIR}"/000{1,2,3}-*.patch + cat "${FILESDIR}"/preload-0.6.4.init.in > preload.init.in || die + + eautoreconf +} + +src_compile() { + econf --localstatedir=/var + emake -j1 || die "emake failed" +} + +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() { + einfo "You probably want to add preload to the boot runlevel like so:" + einfo "# rc-update add preload boot" + echo + eerror "IMPORTANT: If you are upgrading from preload < 0.6 ensure to" + eerror "merge your config files (etc-update) or system performance" + eerror "may suffer." + echo +} |