From a42b0aa7ba6c47bb6a4666821747fdcc4208d791 Mon Sep 17 00:00:00 2001 From: bougyman Date: Sat, 11 Apr 2015 17:53:13 -0500 Subject: [PATCH] New package: preload-0.6.4 Closes #1291 --- srcpkgs/preload/files/preload/conf | 10 ++++++++++ srcpkgs/preload/files/preload/log/run | 1 + srcpkgs/preload/files/preload/run | 15 +++++++++++++++ srcpkgs/preload/template | 22 ++++++++++++++++++++++ 4 files changed, 48 insertions(+) create mode 100644 srcpkgs/preload/files/preload/conf create mode 120000 srcpkgs/preload/files/preload/log/run create mode 100755 srcpkgs/preload/files/preload/run create mode 100644 srcpkgs/preload/template diff --git a/srcpkgs/preload/files/preload/conf b/srcpkgs/preload/files/preload/conf new file mode 100644 index 0000000000..3ab13e119c --- /dev/null +++ b/srcpkgs/preload/files/preload/conf @@ -0,0 +1,10 @@ +# Miminum memory that the system should have for preload to be launched. +# In megabytes. +MIN_MEMORY="256" + +# Command-line arguments to pass to the daemon. Read preload(8) man page +# for available options. +OPTS="--verbose 1 -l ''" + +# Option to call ionice with. Leave empty to skip ionice. +IONICE_OPTS="-c3" diff --git a/srcpkgs/preload/files/preload/log/run b/srcpkgs/preload/files/preload/log/run new file mode 120000 index 0000000000..914853dd4f --- /dev/null +++ b/srcpkgs/preload/files/preload/log/run @@ -0,0 +1 @@ +/usr/bin/rsvlog \ No newline at end of file diff --git a/srcpkgs/preload/files/preload/run b/srcpkgs/preload/files/preload/run new file mode 100755 index 0000000000..3104724076 --- /dev/null +++ b/srcpkgs/preload/files/preload/run @@ -0,0 +1,15 @@ +#!/bin/sh +exec 2>&1 +[ -r conf ] && . conf +MIN_MEMORY=${MIN_MEMORY:-256} +free -m | awk '/Mem:/ {exit ($2 >= ('"$MIN_MEMORY"'))?0:1}' || exit 0 + +if [ -n "$IONICE_OPTS" ]; then + if [ -x "$IONICE" ]; then + RUNNER="$IONICE $IONICE_OPTS" + else + echo "ionice not found, running with normal io priority" 1>&2 + fi +fi + +exec $RUNNER preload $OPTS -f 2>&1 diff --git a/srcpkgs/preload/template b/srcpkgs/preload/template new file mode 100644 index 0000000000..0c380ac684 --- /dev/null +++ b/srcpkgs/preload/template @@ -0,0 +1,22 @@ +# Template file for 'preload' +pkgname=preload +version=0.6.4 +revision=1 +build_style=gnu-configure +hostmakedepends="help2man pkg-config" +makedepends="libglib-devel" +depends="sv-helper" +short_desc="An adaptive readahead daemon" +maintainer="bougyman " +license="GPL-2" +homepage="http://sourceforge.net/projects/preload" +distfiles="${SOURCEFORGE_SITE}/${pkgname}/${pkgname}-${version}.tar.gz" +checksum=d0a558e83cb29a51d9d96736ef39f4b4e55e43a589ad1aec594a048ca22f816b + +post_install() { + rm -rf etc/rc.d + rm -rf etc/logrotate.d + rm -rf etc/sysconfig + rm -rf var/log + vsv preload +}