From 2aaa31261b7997a3d62142cca8074578e0321d6d Mon Sep 17 00:00:00 2001 From: Robby Workman Date: Fri, 7 Sep 2012 15:32:57 -0500 Subject: system/preload: Miscellaneous cleanups and fixes Signed-off-by: Robby Workman --- system/preload/preload.SlackBuild | 17 +++++------------ system/preload/rc.preload | 6 +++--- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/system/preload/preload.SlackBuild b/system/preload/preload.SlackBuild index dd51886faa..f6e5016f6a 100644 --- a/system/preload/preload.SlackBuild +++ b/system/preload/preload.SlackBuild @@ -2,7 +2,7 @@ # Slackware build script for preload -# Copyright 2008-2011 Robby Workman Northport, Alabama (USA) +# Copyright 2008-2012 Robby Workman Northport, Alabama (USA) # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -23,8 +23,8 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PRGNAM=preload -VERSION=0.6.4 -BUILD=${BUILD:-1} +VERSION=${VERSION:-0.6.4} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then @@ -79,11 +79,9 @@ CFLAGS="$SLKCFLAGS" \ --docdir=/usr/doc/$PRGNAM-$VERSION \ --build=$ARCH-slackware-linux -cp $CWD/preload.8 . - make pkgdocdir=/usr/doc/$PRGNAM-$VERSION || \ make pkgdocdir=/usr/doc/$PRGNAM-$VERSION -# Yes, this is intentional +# Yes, this is intentional; it sometimes fails on the first run ?? make install \ pkgdocdir=/usr/doc/$PRGNAM-$VERSION \ @@ -92,14 +90,9 @@ make install \ find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true -# Clobber the bad manpage (I thought the stuff above fixed it) +# Clobber the bad manpage gzip -9c $CWD/preload.8 > $PKG/usr/man/man8/preload.8.gz -# Create the lockfile directory -# We'll use /var/run/preload instead of /var/lock/subsys, so that a stale -# lockfile hanging around won't keep preload from starting on boot -mkdir -p $PKG/var/run/preload - # Let's not clobber things that might already exist mv $PKG/etc/preload.conf $PKG/etc/preload.conf.new mv $PKG/etc/logrotate.d/preload $PKG/etc/logrotate.d/preload.new diff --git a/system/preload/rc.preload b/system/preload/rc.preload index efe8802a2f..b7e08b8936 100644 --- a/system/preload/rc.preload +++ b/system/preload/rc.preload @@ -10,10 +10,10 @@ free -m | awk '/Mem:/ {exit ($2 >= ('256'))?0:1}' || exit 1 start() { if [ -x /usr/sbin/preload ]; then - if [ ! -f /var/run/preload/preload.lock ]; then + if [ ! -f /var/run/preload.lock ]; then echo "Starting preload daemon: /usr/sbin/preload " /usr/sbin/preload $PRELOAD_OPTS && \ - touch /var/run/preload/preload.lock + touch /var/run/preload.lock else echo "/usr/sbin/preload is already running. Exiting." exit 1 @@ -28,7 +28,7 @@ start() { stop() { echo "Stopping preload daemon... " killall -9 preload - rm -f /var/run/preload/preload.lock + rm -f /var/run/preload.lock } restart() { -- cgit v1.2.3