[SCM] tomcat7: Servlet and JSP engine branch, master, updated. debian/7.0.28-2-2-g532a7b3
tony mancill
tmancill at debian.org
Thu Sep 27 19:59:57 UTC 2012
The following commit has been merged in the master branch:
commit 532a7b39e4e0dfcbe5374ed6b01c36efc2200fea
Author: tony mancill <tmancill at debian.org>
Date: Thu Sep 27 11:02:48 2012 -0700
use logrotate template file and ucf handling (Debian #688936)
diff --git a/debian/changelog b/debian/changelog
index 8d102a1..0983f28 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,13 @@
tomcat7 (7.0.28-3) UNRELEASED; urgency=low
+ [ Miguel Landaeta ]
* Fix small typo in README.Debian.
- -- Miguel Landaeta <miguel at miguel.cc> Tue, 18 Sep 2012 18:57:45 -0430
+ [ tony mancill ]
+ * Use ucf and a template for /etc/logrotate.d/tomcat6 file to avoid
+ updating the shipped conffile. (Closes: #688936)
+
+ -- tony mancill <tmancill at debian.org> Thu, 27 Sep 2012 10:55:35 -0700
tomcat7 (7.0.28-2) unstable; urgency=low
diff --git a/debian/logrotate.md5sum b/debian/logrotate.md5sum
new file mode 100644
index 0000000..626c504
--- /dev/null
+++ b/debian/logrotate.md5sum
@@ -0,0 +1 @@
+9e56464a7cc25288a994171d0e303ba6 logrotate.template
diff --git a/debian/logrotate b/debian/logrotate.template
similarity index 72%
rename from debian/logrotate
rename to debian/logrotate.template
index 8df018b..ce082df 100644
--- a/debian/logrotate
+++ b/debian/logrotate.template
@@ -4,5 +4,5 @@
rotate 52
compress
missingok
- create 640 @@@TOMCAT7USER@@@ adm
+ create 640 tomcat7 adm
}
diff --git a/debian/rules b/debian/rules
index 72689b9..31423af 100755
--- a/debian/rules
+++ b/debian/rules
@@ -85,7 +85,6 @@ install: build
dh_testroot
dh_prep
dh_installdirs
- cp debian/logrotate debian/tomcat7/etc/logrotate.d/tomcat7
binary-indep: build install
dh_testdir
diff --git a/debian/tomcat7.install b/debian/tomcat7.install
index 0ccf965..682ec66 100644
--- a/debian/tomcat7.install
+++ b/debian/tomcat7.install
@@ -5,3 +5,5 @@ debian/policy/*.policy /etc/tomcat7/policy.d/
debian/default_root /usr/share/tomcat7-root/
debian/defaults.template /usr/share/tomcat7/
debian/defaults.md5sum /usr/share/tomcat7/
+debian/logrotate.template /usr/share/tomcat7/
+debian/logrotate.md5sum /usr/share/tomcat7/
diff --git a/debian/tomcat7.postinst b/debian/tomcat7.postinst
index 3ed42fa..ef339db 100644
--- a/debian/tomcat7.postinst
+++ b/debian/tomcat7.postinst
@@ -4,6 +4,8 @@ set -e
. /usr/share/debconf/confmodule
TEMPLATE="/usr/share/tomcat7/defaults.template"
CONFFILE="/etc/default/tomcat7"
+LR_TEMPLATE="/usr/share/tomcat7/logrotate.template"
+LR_CONFFILE="/etc/logrotate.d/tomcat7"
JAVA_OPTS="-Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC"
case "$1" in
@@ -36,11 +38,12 @@ case "$1" in
chown -R $TOMCAT7_USER:adm /var/log/tomcat7 /var/cache/tomcat7
chmod 750 /var/log/tomcat7 /var/cache/tomcat7
- # replace the TOMCAT7USER token in /etc/logrotate.d/tomcat7
- LOGROTATE_TOKEN="@@@TOMCAT7USER@@@"
- if grep -q "$LOGROTATE_TOKEN" /etc/logrotate.d/tomcat7 ; then
- sed --in-place "s/$LOGROTATE_TOKEN/$TOMCAT7_USER/" /etc/logrotate.d/tomcat7
- fi
+ # populate /etc/logrotate.d/tomcat7
+ tmpfile=`mktemp /tmp/tomcat7.XXXXXXXXXX`
+ chmod 644 $tmpfile
+ cat $LR_TEMPLATE | sed "s%create 640 tomcat7 adm%create 640 $TOMCAT7_USER adm%" >> $tmpfile
+ ucf --debconf-ok --sum-file /usr/share/tomcat7/logrotate.md5sum $tmpfile $LR_CONFFILE
+ rm -f $tmpfile
# configuration files should not be modifiable by tomcat7 user, as this can be a security issue
# (an attacker may insert code in a webapp and have access to all tomcat configuration)
diff --git a/debian/tomcat7.postrm.in b/debian/tomcat7.postrm.in
index 1d451c3..de35c3a 100644
--- a/debian/tomcat7.postrm.in
+++ b/debian/tomcat7.postrm.in
@@ -4,6 +4,7 @@ set -e
#DEBHELPER#
CONFFILE=/etc/default/tomcat7
+LR_CONFFILE=/etc/logrotate.d/tomcat7
# Remove cached files and auto-generated catalina.policy
rm -rf /var/cache/tomcat7/*
@@ -47,8 +48,9 @@ case "$1" in
set +e
if [ -x "/usr/bin/ucf" ]; then
ucf --purge $CONFFILE
+ ucf --purge $LR_CONFFILE
fi
- rm -rf /var/log/tomcat7 /var/lib/tomcat7/temp $CONFFILE
+ rm -rf /var/log/tomcat7 /var/lib/tomcat7/temp $CONFFILE $LR_CONFFILE
if [ -d "/var/lib/tomcat7" ] ; then
rmdir --ignore-fail-on-non-empty /var/lib/tomcat7
fi
--
tomcat7: Servlet and JSP engine
More information about the pkg-java-commits
mailing list