[Pkg-awstats-commits] [SCM] awstats Debian packaging branch, master, updated. debian/6.9.5.dfsg-2-5-g7774d56
Sergey B Kirpichev
skirpichev at gmail.com
Tue May 18 14:44:17 UTC 2010
The following commit has been merged in the master branch:
commit fae819b2a15d9dbf8f3861f9b87cfadfaa31c82b
Author: Sergey B Kirpichev <skirpichev at gmail.com>
Date: Tue May 18 18:27:56 2010 +0400
Option to use "nice" to lower the priority of cron scripts (Closes: #580693, thanks to Ken Neighbors)
diff --git a/debian/buildstatic.sh b/debian/buildstatic.sh
index 63293da..e233aea 100755
--- a/debian/buildstatic.sh
+++ b/debian/buildstatic.sh
@@ -30,7 +30,7 @@ do
m=`date +%m`
mkdir -p /var/cache/awstats/$c/$Y/$m/
AL=${AWSTATS_LANG:-en}
- if ! $BUILDSTATICPAGES \
+ if ! nice -n $AWSTATS_NICE $BUILDSTATICPAGES \
-config=$c \
-year=$Y \
-month=$m \
diff --git a/debian/default/awstats b/debian/default/awstats
index 3e17e91..44513a2 100644
--- a/debian/default/awstats
+++ b/debian/default/awstats
@@ -1,5 +1,10 @@
# AWStats configuration options
+# This variable controls the scheduling priority for updating AWStats
+# datafiles and for generating static html reports. Normal priority
+# is 0 and a lower priority is 10. See "man nice" for more info.
+AWSTATS_NICE=10
+
# This variable controls whether to create static html reports every
# night in /var/cache/awstats/. Set to "yes" or "no".
AWSTATS_ENABLE_BUILDSTATICPAGES="yes"
diff --git a/debian/update.sh b/debian/update.sh
index 1bb1ebe..17ebba7 100755
--- a/debian/update.sh
+++ b/debian/update.sh
@@ -14,6 +14,7 @@ ERRFILE=`mktemp /tmp/awstats.XXXXXXXXXX`
trap 'rm -f $ERRFILE' INT QUIT TERM EXIT
[ -f $AWSTATS ] || exit 1
+[ -r "$DEFAULT" ] && . "$DEFAULT"
cd /etc/awstats
@@ -21,7 +22,9 @@ for c in awstats \
`/bin/ls -1 awstats.*.conf 2>/dev/null | \
/bin/sed 's/^awstats\.\(.*\)\.conf/\1/'`
do
- if ! $AWSTATS -config=$c -update >$ERRFILE 2>&1
+ if ! nice -n $AWSTATS_NICE $AWSTATS \
+ -config=$c \
+ -update >$ERRFILE 2>&1
then
cat $ERRFILE >&2 # an error occurred
fi
--
awstats Debian packaging
More information about the Pkg-awstats-commits
mailing list