Your message dated Sat, 25 May 2013 17:53:10 +0300 (EEST)
with message-id <[email protected]>
and subject line Closing old bugs filed against tomcat5.5 (or related packages)
has caused the Debian Bug report #412489,
regarding tomcat5.5: multiple instances could be supported better
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
412489: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=412489
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: tomcat5.5
Version: 5.5.20-4
Severity: minor

When following the instructions in
/usr/share/doc/tomcat5.5/RUNNING.txt.gz, there are a few minor niggles
with the current init.d script.

I have written a script to clone one instance (creates the directories
etc) which I've attached to this bug report.  The sensible thing
to do is to change the NAME in the init.d script, however then the
CATALINA_HOME variable points to the wrong location.   It would be
nice to have it set separately.  Conversely, CATALINA_BASE is
hardcoded to /var/lib/tomcat5.5 and should be set from NAME :-)


Adrian 
-- 
Adrian Bridgett - [email protected]
GPG key available on public key servers
#!/bin/sh

# Clone tomcat instance so we get another JVM
# Written by Adrian Bridgett <[email protected]>, Opsera Ltd.


SOURCE=tomcat5.5
USERNAME=tomcat55

main()
{
  name="$1" || die "Usage: `basename $0` clone-name"
  name="$SOURCE-$name"

  # sanity checking
  valid_name "$name"
  check_existing "$name"
  confirm "$name"
  
  # creation
  create_init "$name"
  create_etc "$name"
  create_var "$name"

  # not required unless you really want to be seperate
  #create_usrshare "$name"
  
  print_todo "$name"
}

die()
{
  echo "$@"
  exit 1
}

valid_name()
{
  local name="$1"
  [ "$name" ] || die "No name given"
  rejected=`echo "$1" | tr -d -- '-_\.[a-z][A-Z][0-9]'`
  [ "$rejected" ] && die "Invalid characters \"$rejected\" in name"
  return 0
}

check_existing()
{
  local name="$1"
  if [ -e "/var/lib/$name" ]; then
    die "Pre-existing tomcat instance \"$name\""
  fi
  return 0
}

confirm()
{
  local name="$1"
  echo -n "Are you sure you wish to create a new tomcat instance \"$name\"? 
[Yn] "
  read ans
  if [ "$ans" = "" ] || [ "$ans" = "y" ] || [ "$ans" = "Y" ] || [ "$ans" = 
"yes" ]; then
    return 0 
  fi
  echo "Aborting at user request"
  exit 1
}

create_init()
{
  local name="$1"
  # CATALINA_HOME must be set to /usr/share/tomcat5.5
  # CATALINA_BASE is set per instance to /var/lib/$name
  # change NAME, CATALINA_BASE, /etc/init.d/$SOURCE (usage statement)
  sed "s,^NAME=.*$,NAME=$name,g 
       s,^CATALINA_BASE=.*$,CATALINA_BASE=/var/lib/\$NAME,g 
       s,^CATALINA_HOME=.*$,CATALINA_HOME=/usr/share/tomcat5.5,g 
       s,\(/etc/init.d/\)$SOURCE,\1$name,g" \
       < /etc/init.d/$SOURCE > "/etc/init.d/$name"
  chmod 755 "/etc/init.d/$name"
  update-rc.d "$name" defaults 92
}

create_etc()
{
  local name="$1"
  cp -a /etc/$SOURCE "/etc/$name"
  cp /etc/default/$SOURCE "/etc/default/$name"
}
  
create_var()
{
  local name="$1"

  install -d "/var/cache/$name" -o $USERNAME -g adm -m700
  install -d "/var/log/$name" -o $USERNAME -g root -m750
  install -d "/var/lib/$name" -o root -g root -m755

  cd "/var/lib/$name" || die "Unable to cd \"/var/lib/$name\""
  
  ln -s "../../log/$name" logs
  install -d temp -o $USERNAME -g root -m 755
  cp -a "/var/lib/$SOURCE/shared" shared
  cp -a "/var/lib/$SOURCE/webapps" webapps
  ln -s "../../cache/$name" work

  cp -a "/var/lib/$SOURCE/conf" conf
  # change symlinks
  for file in server.xml web.xml \
    jk2.properties workers2.properties workers.properties; do
    if [ -e "/etc/$name/$file" ]; then
      ln -sf "/etc/$name/$file" "conf/$file"
    fi
  done
}

create_usrshare()
{
  local name="$1"
  install -d "/usr/share/$name" -o root -g root -m755
  for dir in conf logs temp webapps work ; do
    ln -s "/var/lib/$name/$dir" "/usr/share/$name/$dir"
  done
  for dir in bin common docs server shared; do
    ln -s "/usr/share/$SOURCE/$dir" "/usr/share/$name/$dir"
  done
}

print_todo()
{
  local name="$1"
  cat << EOF

  Automated cloning finished.   Some items left todo:
  
    - change passwords in /var/lib/$name/conf/tomcat-users.xml
    - change shutdown password in /etc/$name/server.xml
    - change ports in /etc/$name/server.xml
    - remove any unwanted webapps from /var/lib/$name/conf/ 

  Upon pressing return, an editor will start to allow you to do this

EOF
  read dummy
  editor "/var/lib/$name/conf/tomcat-users.xml" "/etc/$name/server.xml"
}

main "$@"

--- End Message ---
--- Begin Message ---
Version: 5.5.26-5

Hello,

Some (long) time ago you filed this bug against tomcat5.5 or a related 
package. In the meantime the tomcat5.5 package has been renamed and this 
bug was "lost". Since the bug is already quite old now it is being 
closed.

If the issue you encountered is still present in recent tomcat packages 
(as released with Debian 7.0 wheezy for example) the maintainer(s) would 
very much appreciate a fresh report using:

    reportbug <package>

You should also mention the number of this bug if you think it contains 
valuable information.

Please note that further information sent to this bug is likely to 
remain unread, because the bug is currently not assigned to any existing 
package.


Thank you for for trying to improve Debian by reporting bugs.

Kind regards,
Andrei (with no relation to tomcat maintenance)

--- End Message ---

Reply via email to