system/atop: Added to 12.0 repository

This commit is contained in:
Menno E. Duursma 2010-05-11 20:01:53 +02:00 committed by Robby Workman
parent b0d02a1f05
commit efd5c4148c
7 changed files with 190 additions and 0 deletions

16
system/atop/README Normal file
View file

@ -0,0 +1,16 @@
ATOP is an advanced interactive monitor for Linux-systems
to view the load on system-level and process-level.
Some features depend on the 'acct' (BSD accounting) package from
Slackware being installed. To enable it, execute the following:
touch /var/log/pacct
chgrp utmp /var/log/pacct
chmod 640 /var/log/pacct
accton
You may want to have atop start at boot; to do so, added the
following lines to /etc/rc.d/rc.local:
# Start the accounting top service
if [ -x /etc/rc.d/rc.atop ]; then
/etc/rc.d/rc.atop
fi

View file

@ -0,0 +1,71 @@
#!/bin/sh
# Slackware build script for atop
# Written by Menno E. Duursma <druiloor@zonnet.nl>
# Modified by Robby Workman <rworkman@slackbuilds.org>
PRGNAM=atop
VERSION=1.20
ARCH=${ARCH:-i486}
BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
fi
set -e # Exit on most errors
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
chmod -R u+w,go+r-w,a-s .
make CFLAGS="$SLKCFLAGS"
# Install the binary sgid utmp in order to allow accounting
install -D -o root -g utmp -m 2751 atop $PKG/usr/bin/atop
# Add the init script and fix the paths in it
patch -p1 < $CWD/atop.init.diff
install -D -m 0755 atop.init $PKG/etc/rc.d/rc.atop.new
mkdir -p $PKG/etc/{logrotate.d,cron.daily}
install -m 0644 psaccs_atop $PKG/etc/logrotate.d/psaccs_atop.new
install -m 0644 psaccu_atop $PKG/etc/logrotate.d/psaccu_atop.new
install -m 0644 $CWD/psacct.logrotate $PKG/etc/logrotate.d/psacct.new
install -m 0755 atop.daily $PKG/etc/cron.daily/atop.new
mkdir -p $PKG/var/log/atop
touch $PKG/var/log/atop/dummy_{before,after}
# We'll create daily.log in doinst.sh so it doesn't get wiped on uninstall
( cd $PKG
find . -type f | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
)
mkdir -p $PKG/usr/man/man1
gzip -9c man/atop.1 > $PKG/usr/man/man1/atop.1.gz
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a [A-Z][A-Z]* ChangeLog $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz

8
system/atop/atop.info Normal file
View file

@ -0,0 +1,8 @@
PRGNAM="atop"
VERSION="1.20"
HOMEPAGE="http://www.atcomputing.nl/Tools/atop"
DOWNLOAD="http://oldwww.atconsultancy.nl/atop/packages/atop-1.20.tar.gz"
MD5SUM="ca4c8f47532b25aa0afd7d1061a1ad11"
MAINTAINER="Menno E. Duursma"
EMAIL="druiloor@zonnet.nl"
APPROVED="rworkman"

View file

@ -0,0 +1,34 @@
--- atop-1.20/atop.init.orig 2008-01-08 20:44:34.327288088 -0600
+++ atop-1.20/atop.init 2008-01-08 20:45:25.786220566 -0600
@@ -7,7 +7,7 @@
#
# Check existance of binaries
-[ -f /usr/bin/atop ] || exit 0
+[ -f /usr/bin/atop ] || exit 1
PIDFILE=/var/run/atop.pid
RETVAL=0
@@ -22,7 +22,7 @@
:
else
# Start atop
- /etc/atop/atop.daily
+ /etc/cron.daily/atop.daily
fi
;;
@@ -43,11 +43,11 @@
;;
reload)
- /etc/atop/atop.daily
+ /etc/cron.daily/atop.daily
;;
restart)
- /etc/atop/atop.daily
+ /etc/cron.daily/atop.daily
;;
*)

28
system/atop/doinst.sh Normal file
View file

@ -0,0 +1,28 @@
config() {
NEW="$1"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
# If there's no config file by that name, mv it over:
if [ ! -r $OLD ]; then
mv $NEW $OLD
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
# toss the redundant copy
rm $NEW
fi
# Otherwise, we leave the .new copy for the admin to consider...
}
# Keep same perms on rc.atop.new:
if [ -e etc/rc.d/rc.atop ]; then
cp -a etc/rc.d/rc.atop etc/rc.d/rc.atop.new.incoming
cat etc/rc.d/rc.atop.new > etc/rc.d/rc.atop.new.incoming
mv etc/rc.d/rc.atop.new.incoming etc/rc.d/rc.atop.new
fi
config etc/rc.d/rc.atop.new
config etc/cron.daily/atop.new
config etc/logrotate.d/psacct.new
config etc/logrotate.d/psaccs_atop.new
config etc/logrotate.d/psaccu_atop.new
touch var/log/atop/daily.log

View file

@ -0,0 +1,14 @@
/var/log/pacct {
create 640 root utmp
daily
# Keep 4 weeks of backlog
rotate 28
compress
missingok
prerotate
/sbin/accton
endscript
postrotate
/sbin/accton /var/log/pacct
endscript
}

19
system/atop/slack-desc Normal file
View file

@ -0,0 +1,19 @@
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
atop: Acounting Top (advanced interactive monitor)
atop:
atop: ATOP is an advanced interactive monitor for Linux-systems
atop: to view the load on system-level and process-level.
atop:
atop: atop was wtitten and is maintained by Gerlof Langeveld of
atop: AT Consultancy bv, Nijmegen, The Netherlands
atop:
atop:
atop:
atop: