[arch-commits] Commit in mlocate/trunk (PKGBUILD updatedb.cron.daily)
Allan McRae
allan at archlinux.org
Thu Oct 22 13:58:17 UTC 2009
Date: Thursday, October 22, 2009 @ 09:58:17
Author: allan
Revision: 56512
upgpkg: mlocate 0.22.2-2
use nice/ionice in cron job (FS#16518)
Modified:
mlocate/trunk/PKGBUILD
mlocate/trunk/updatedb.cron.daily
---------------------+
PKGBUILD | 4 ++--
updatedb.cron.daily | 23 +++++++++++++++++++++--
2 files changed, 23 insertions(+), 4 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2009-10-22 12:41:46 UTC (rev 56511)
+++ PKGBUILD 2009-10-22 13:58:17 UTC (rev 56512)
@@ -4,7 +4,7 @@
pkgname=mlocate
pkgver=0.22.2
-pkgrel=1
+pkgrel=2
pkgdesc="Faster merging drop-in for slocate"
arch=('i686' 'x86_64')
url="http://carolina.mff.cuni.cz/~trmac/blog/mlocate"
@@ -22,7 +22,7 @@
updatedb.cron.daily)
md5sums=('27de49a88b8657f50fda02d152b8a5f1'
'66898efb290eff4efd44a0b94fe3927d'
- 'eee7f9db8c6145724313af6fd5fe9d66')
+ 'cde5da81bebad2de556ef2e43d895e13')
build() {
cd $srcdir/$pkgname-$pkgver
Modified: updatedb.cron.daily
===================================================================
--- updatedb.cron.daily 2009-10-22 12:41:46 UTC (rev 56511)
+++ updatedb.cron.daily 2009-10-22 13:58:17 UTC (rev 56512)
@@ -1,10 +1,29 @@
#!/bin/sh
+# nicenesses range from -20 (most favorable scheduling) to 19 (least favorable)
+NICE=19
+
+# 0 for none, 1 for real time, 2 for best-effort, 3 for idle
+IONICE_CLASS=2
+
+# 0-7 (for IONICE_CLASS 1 and 2 only), 0=highest, 7=lowest
+IONICE_PRIORITY=7
+
+UPDATEDB="/usr/bin/updatedb"
+
+if [ -x /usr/bin/nice ]; then
+ UPDATEDB="/usr/bin/nice -n ${NICE:-19} ${UPDATEDB}"
+fi
+
+if [ -x /usr/bin/ionice ]; then
+ UPDATEDB="/usr/bin/ionice -c ${IONICE_CLASS:-2} -n ${IONICE_PRIORITY:-7} ${UPDATEDB}"
+fi
+
# Update the "locate" database
if [ -x /usr/bin/updatedb ]; then
if [ -f /etc/updatedb.conf ]; then
- /usr/bin/updatedb
+ ${UPDATEDB}
else
- /usr/bin/updatedb -f proc
+ ${UPDATEDB} -f proc
fi
fi
More information about the arch-commits
mailing list