aboutsummaryrefslogtreecommitdiff
path: root/sysutils/atop
diff options
context:
space:
mode:
authorMartin Wilke <miwi@FreeBSD.org>2011-07-02 13:23:32 +0000
committerMartin Wilke <miwi@FreeBSD.org>2011-07-02 13:23:32 +0000
commit84c5423927e6d80241fed1c098303bce13d74981 (patch)
tree23b0972b890120016c56960ce28b68e5eb23a1fb /sysutils/atop
parente541d7720012523462551ad2689e6925fb7d061d (diff)
downloadports-84c5423927e6d80241fed1c098303bce13d74981.tar.gz
ports-84c5423927e6d80241fed1c098303bce13d74981.zip
Notes
Diffstat (limited to 'sysutils/atop')
-rw-r--r--sysutils/atop/Makefile5
-rw-r--r--sysutils/atop/distinfo4
-rw-r--r--sysutils/atop/files/atop.in18
-rw-r--r--sysutils/atop/files/pkg-message.in21
4 files changed, 43 insertions, 5 deletions
diff --git a/sysutils/atop/Makefile b/sysutils/atop/Makefile
index c09493183d19..152f96773ed2 100644
--- a/sysutils/atop/Makefile
+++ b/sysutils/atop/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= atop
-PORTVERSION= 1.26.b3
+PORTVERSION= 1.26.b4
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_BERLIOS}
MASTER_SITE_SUBDIR=atop-freebsd
@@ -24,6 +24,8 @@ LOGDIR?= /var/log/atop
USE_RC_SUBR= atop
PLIST_SUB+= LOGDIR="${LOGDIR}"
+SUB_FILES= pkg-message
+SUB_LIST= LOGDIR="${LOGDIR}"
do-install:
@${INSTALL_PROGRAM} ${WRKSRC}/atop ${PREFIX}/bin
@@ -38,5 +40,6 @@ do-install:
${INSTALL_MAN} ${WRKSRC}/AUTHOR ${WRKSRC}/ChangeLog \
${WRKSRC}/README ${DOCSDIR}
.endif
+ @${CAT} ${PKGMESSAGE}
.include <bsd.port.mk>
diff --git a/sysutils/atop/distinfo b/sysutils/atop/distinfo
index 1910f8f4798e..d898d029e4fb 100644
--- a/sysutils/atop/distinfo
+++ b/sysutils/atop/distinfo
@@ -1,2 +1,2 @@
-SHA256 (atop-1.26.fbsd.beta3.tar.bz2) = 5c06ee28cc215a88ccec25555253d5d732d7ce5fb43b8c2931f37283fc40f1c8
-SIZE (atop-1.26.fbsd.beta3.tar.bz2) = 130202
+SHA256 (atop-1.26.fbsd.beta4.tar.bz2) = 1ac8ebc8ed47c2789f2eb22b4a84e3b2e624b6c55cc6c827026e3821e861fbb0
+SIZE (atop-1.26.fbsd.beta4.tar.bz2) = 130254
diff --git a/sysutils/atop/files/atop.in b/sysutils/atop/files/atop.in
index f628ba3474b5..e60987c2a86f 100644
--- a/sysutils/atop/files/atop.in
+++ b/sysutils/atop/files/atop.in
@@ -21,7 +21,9 @@ atop_pidfile="/var/run/atop.pid"
name="atop"
rcvar=`set_rcvar`
command="%%PREFIX%%/bin/atop"
+extra_commands="rotate"
start_cmd="atop_start"
+rotate_cmd="atop_rotate"
atop_start()
{
@@ -29,14 +31,26 @@ atop_start()
echo 1>&2 "${name} already running? (pid=$rc_pid)."
return 1
fi
- check_startmsgs && echo "Starting ${name}."
- /usr/sbin/daemon -p $pidfile ${command} -w /var/log/atop/atop_`date '+%Y%m%d'` ${atop_flags} ${atop_interval}
+ echo "Starting ${name}."
+ /usr/sbin/daemon -p $pidfile ${command} -w ${atop_logdir}/atop_`date '+%Y%m%d'` ${atop_flags} ${atop_interval}
_run_rc_postcmd
}
+atop_rotate()
+{
+
+ echo "Rotating logfile (${name})."
+ # write final sample and stop
+ sig_stop=SIGUSR2
+ /usr/bin/find $atop_logdir -name atop_???????? -mtime +${atop_keepdays} -exec rm {} \;
+ run_rc_command "restart"
+}
+
load_rc_config $name
+: ${atop_logdir="%%LOGDIR%%"}
: ${atop_interval=10}
+: ${atop_keepdays=30}
: ${atop_flags=""}
pidfile="${atop_pidfile}"
diff --git a/sysutils/atop/files/pkg-message.in b/sysutils/atop/files/pkg-message.in
new file mode 100644
index 000000000000..fc098e7495e4
--- /dev/null
+++ b/sysutils/atop/files/pkg-message.in
@@ -0,0 +1,21 @@
+****************************************************************************
+
+atop succesfully installed. To run in interactive mode use "atop" command.
+
+To run the atop in collecting mode from startup, add
+
+atop_enable="YES"
+
+in your /etc/rc.conf.
+
+You will also need to add "rotate" command to the system crontab:
+
+0 0 * * * %%PREFIX%%/etc/rc.d/atop rotate
+
+To change number of days to keep the logs (default - 30) use atop_keepdays
+variable in your /etc/rc.conf file.
+
+To change default (10 seconds) interval use atop_inteval (e.g. atop_interval=5)
+in /etc/rc.conf
+
+****************************************************************************