mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-04 20:29:09 +01:00
system/preload: Miscellaneous cleanups and fixes
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
This commit is contained in:
parent
a554826da4
commit
2aaa31261b
2 changed files with 8 additions and 15 deletions
|
@ -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
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue