Package: tomcat5.5 Version: 5.5.20-5 Severity: serious Tags: patch Justification: Policy 10.7.2
All the config files should be in /etc/tomcat5.5. The current scheme where some files are in /etc/tomcat5.5 and some are in /var/lib/tomcat5.5/conf with symlinks to the ones in /etc/tomcat5.5 is just confusing. I've included a patch which should move the conf directory to /etc/tomcat5.5 and hopefully migrate users files. It has been tested, but not heavily. -- System Information: Debian Release: lenny/sid APT prefers gutsy-updates APT policy: (500, 'gutsy-updates'), (500, 'gutsy-security'), (500, 'gutsy-backports'), (500, 'gutsy') Architecture: amd64 (x86_64) Kernel: Linux 2.6.22-8-generic (SMP w/1 CPU core) Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash
diff --git a/debian/NEWS b/debian/NEWS index 8e9d7af..27c9435 100644 --- a/debian/NEWS +++ b/debian/NEWS @@ -1,6 +1,15 @@ +tomcat5.5 (5.5.20-6) dapper; urgency=low + + * Configuration has moved from /var/lib/tomcat5.5/conf to /etc/tomcat5.5. + The maintainer scripts will attempt to migrate any config files to the + correct location in /etc/tomcat5.5, but a backup will be left in + /var/lib/tomcat5.5/conf.backup + + -- David Pashley <[EMAIL PROTECTED]> Wed, 25 Jul 2007 14:09:08 +0100 + tomcat5.5 (5.5.17-2) unstable; urgency=low - Tomcat5.5 has a new user: tomcat55. + * Tomcat5.5 has a new user: tomcat55. -- Arnaud Vandyck <[EMAIL PROTECTED]> Mon, 9 Oct 2006 16:03:21 +0200 diff --git a/debian/README.Debian b/debian/README.Debian index 4bd65bd..1085460 100644 --- a/debian/README.Debian +++ b/debian/README.Debian @@ -58,7 +58,7 @@ Apache Tomcat 5.5 for Debian - There is a webapp for basic web-based administration of Tomcat's webapps in the tomcat5.5-admin package. You need to add one of the users in - /var/lib/tomcat5.5/conf/tomcat-users.xml to the manager role and probably + /etc/tomcat5.5/tomcat-users.xml to the manager role and probably set a better password. The "Web Application Manager" can then be accessed at http://localhost:8180/manager/html. There's also a more sophisticated administration webapp called "admin" in the same package but it can't make diff --git a/debian/control b/debian/control index 7433d8d..cfedfc1 100644 --- a/debian/control +++ b/debian/control @@ -13,6 +13,7 @@ Package: tomcat5.5 Architecture: all Depends: java-gcj-compat-dev (>= 1.0.30-5) | kaffe (>= 2:1.1.6-3) | java2-runtime, libtomcat5.5-java (>= ${Source-Version}), adduser (>= 3.34), ecj-bootstrap, jsvc (>= 1.0.2~svn20061127-6) Suggests: java-virtual-machine, libapache-mod-jk | libapache2-mod-jk, tomcat5.5-webapps (>= ${Source-Version}), tomcat5.5-admin (>= ${Source-Version}) +Conflicts: tomcat5.5-admin (<= 5.5.20-5) Description: Servlet and JSP engine Apache Tomcat is the reference implementation for the Java Servlet and JavaServer Pages technologies. diff --git a/debian/tomcat5.5-admin.dirs b/debian/tomcat5.5-admin.dirs index 3b3598a..5c7ada1 100644 --- a/debian/tomcat5.5-admin.dirs +++ b/debian/tomcat5.5-admin.dirs @@ -1,3 +1,3 @@ etc/tomcat5.5/policy.d -var/lib/tomcat5.5/conf/Catalina/localhost +etc/tomcat5.5/Catalina/localhost usr/share/tomcat5.5/server diff --git a/debian/tomcat5.5-admin.install b/debian/tomcat5.5-admin.install index 3d73931..b3cf019 100644 --- a/debian/tomcat5.5-admin.install +++ b/debian/tomcat5.5-admin.install @@ -1,2 +1,2 @@ -debian/context/admin/*.xml /var/lib/tomcat5.5/conf/Catalina/localhost/ +debian/context/admin/*.xml /etc/tomcat5.5/Catalina/localhost/ build/dist/server/webapps /usr/share/tomcat5.5/server diff --git a/debian/tomcat5.5-webapps.postinst b/debian/tomcat5.5-webapps.postinst index 59fb012..522aebe 100644 --- a/debian/tomcat5.5-webapps.postinst +++ b/debian/tomcat5.5-webapps.postinst @@ -8,7 +8,7 @@ case "$1" in # New installation, not a package upgrade # create context links for context in /usr/share/tomcat5.5-webapps/*.xml; do - ln -sf $context /var/lib/tomcat5.5/conf/Catalina/localhost/ + ln -sf $context /etc/tomcat5.5/Catalina/localhost/ done if [ -x /etc/init.d/tomcat5.5 ]; then diff --git a/debian/tomcat5.5.dirs b/debian/tomcat5.5.dirs index c74185d..8ccf3be 100644 --- a/debian/tomcat5.5.dirs +++ b/debian/tomcat5.5.dirs @@ -1,8 +1,8 @@ etc/default etc/tomcat5.5/policy.d +etc/tomcat5.5/Catalina/localhost usr/share/tomcat5.5 var/cache/tomcat5.5 -var/lib/tomcat5.5/conf/Catalina/localhost var/lib/tomcat5.5/shared/classes var/lib/tomcat5.5/shared/lib var/lib/tomcat5.5/temp diff --git a/debian/tomcat5.5.install b/debian/tomcat5.5.install index 8600e87..28bde42 100644 --- a/debian/tomcat5.5.install +++ b/debian/tomcat5.5.install @@ -1,6 +1,11 @@ build/dist/bin /usr/share/tomcat5.5 -build/dist/conf /var/lib/tomcat5.5 -build/dist/conf/tomcat-users.xml /usr/share/tomcat5.5/.debian/ -build/dist/conf/web.xml /etc/tomcat5.5/ +build/dist/conf/server.xml /etc/tomcat5.5/ +build/dist/conf/logging.properties /etc/tomcat5.5/ +build/dist/conf/catalina.properties /etc/tomcat5.5/ +build/dist/conf/server-minimal.xml /etc/tomcat5.5/ +build/dist/conf/catalina.policy /etc/tomcat5.5/ +build/dist/conf/tomcat-users.xml /etc/tomcat5.5/ +build/dist/conf/context.xml /etc/tomcat5.5/ +build/dist/conf/web.xml /etc/tomcat5.5/ debian/policy/* /etc/tomcat5.5/policy.d/ debian/server.xml /etc/tomcat5.5/ diff --git a/debian/tomcat5.5.links b/debian/tomcat5.5.links index 3a656ec..45e31d6 100644 --- a/debian/tomcat5.5.links +++ b/debian/tomcat5.5.links @@ -1,4 +1,5 @@ -/var/lib/tomcat5.5/conf /usr/share/tomcat5.5/conf +/etc/tomcat5.5 /usr/share/tomcat5.5/conf +/etc/tomcat5.5 /var/lib/tomcat5.5/conf /usr/share/doc/tomcat5.5 /usr/share/tomcat5.5/doc /var/lib/tomcat5.5/logs /usr/share/tomcat5.5/logs /var/lib/tomcat5.5/work /usr/share/tomcat5.5/work @@ -6,7 +7,5 @@ /var/lib/tomcat5.5/temp /usr/share/tomcat5.5/temp /var/lib/tomcat5.5/webapps /usr/share/tomcat5.5/webapps /var/log/tomcat5.5 /var/lib/tomcat5.5/logs -/etc/tomcat5.5/server.xml /var/lib/tomcat5.5/conf/server.xml -/etc/tomcat5.5/web.xml /var/lib/tomcat5.5/conf/web.xml /var/cache/tomcat5.5 /var/lib/tomcat5.5/work /usr/share/java/mx4j.jar /usr/share/tomcat5.5/bin/jmx.jar diff --git a/debian/tomcat5.5.postinst b/debian/tomcat5.5.postinst index f269ad2..8ab786f 100644 --- a/debian/tomcat5.5.postinst +++ b/debian/tomcat5.5.postinst @@ -8,21 +8,12 @@ case "$1" in tomcat55 fi chown -R tomcat55:nogroup /var/log/tomcat5.5 /var/cache/tomcat5.5 - chown -R tomcat55:adm /var/lib/tomcat5.5/conf + chown -R tomcat55:adm /etc/tomcat5.5 chown tomcat55:adm /var/log/tomcat5.5 /var/cache/tomcat5.5 - chmod -R 770 /var/lib/tomcat5.5/conf - chmod 750 /var/log/tomcat5.5 /var/lib/tomcat5.5/conf + chmod -R 770 /etc/tomcat5.5 + chmod 750 /var/log/tomcat5.5 /etc/tomcat5.5 chmod 700 /var/cache/tomcat5.5 - if [ ! -f /var/lib/tomcat5.5/conf/tomcat-users.xml ]; then - echo "Installing /var/lib/tomcat5.5/conf/tomcat-users.xml." - install -o tomcat55 -g adm -m 600 \ - /usr/share/tomcat5.5/.debian/tomcat-users.xml \ - /var/lib/tomcat5.5/conf/ - fi - if [ -f /etc/tomcat5.5/tomcat-users.xml ]; then - mv /etc/tomcat5.5/tomcat-users.xml \ - /etc/tomcat5.5/tomcat-users.xml.dpkg-old || true - fi + ln -sf /etc/tomcat5.5 /var/lib/tomcat5.5/conf ;; esac diff --git a/debian/tomcat5.5.postrm b/debian/tomcat5.5.postrm index b9b2c86..0a0d791 100644 --- a/debian/tomcat5.5.postrm +++ b/debian/tomcat5.5.postrm @@ -3,7 +3,7 @@ #DEBHELPER# # Remove cached files and auto-generated catalina.policy -rm -rf /var/cache/tomcat5.5/* /var/lib/tomcat5.5/conf/catalina.policy +rm -rf /var/cache/tomcat5.5/* /etc/tomcat5.5/catalina.policy case "$1" in purge) @@ -11,7 +11,7 @@ case "$1" in # /var/lib/tomcat5.5 because there might be user-installed webapps) userdel tomcat55 || true rm -rf /var/log/tomcat5.5 /var/cache/tomcat5.5 \ - /var/lib/tomcat5.5/conf /var/lib/tomcat5.5/temp + /var/lib/tomcat5.5/temp rmdir --ignore-fail-on-non-empty /var/lib/tomcat5.5 || true rmdir --ignore-fail-on-non-empty /etc/tomcat5.5/policy.d /etc/tomcat5.5 || true # remove user tomcat5 if it exists, and package tomcat5 is diff --git a/debian/tomcat5.5.preinst b/debian/tomcat5.5.preinst new file mode 100644 index 0000000..3034567 --- /dev/null +++ b/debian/tomcat5.5.preinst @@ -0,0 +1,22 @@ +#!/bin/sh + +case "$1" in + upgrade) + + # Migrate any user config from /var/lib/tomcat5.5/conf to + # /etc/tomcat5.5 if the former isn't a symlink yet. + # Affects > 5.5.20-5 + if [ -e /var/lib/tomcat5.5/conf -a ! -L /var/lib/tomcat5.5/conf ]; then + cp -a /var/lib/tomcat5.5/conf /var/lib/tomcat5.5/conf.backup + for dir in $(find /var/lib/tomcat5.5/conf/ -type d); do + mkdir -p $(echo $dir | sed -e's@/var/lib/tomcat5.5/conf/@/etc/tomcat5.5/@') + done + for file in $(find /var/lib/tomcat5.5/conf/ -type f); do + mv $file $(echo $file | sed -e's@/var/lib/tomcat5.5/conf/@/etc/tomcat5.5/@') + done + rm -rf /var/lib/tomcat5.5/conf + fi + ;; +esac + +#DEBHELPER#