Tomcat <defunct> process using phusion/baseimage

307 views
Skip to first unread message

Oded Gold

unread,
Mar 26, 2015, 6:41:42 AM3/26/15
to passenge...@googlegroups.com
Hi all

Has anyone used phusion/baseimage to run tomcat7? I am new to phusion/baseimage and trying to install tomcat7  using "apt-get install tomcat7" but get the following issues:

Running service tomcat7 restart
1. Restarting the service says it stops successfully but does not and when it starts up again it says failed but actually creates another instance of the tomcat process
2. Trying to kill the service with pkill java or kill -9 PID either does nothing of <defunct>s the process 

I think this is a known issues with tomat and docker has anyone had success in fixing tomcat issues with docker 

Yonsy Solis

unread,
Mar 26, 2015, 10:10:14 AM3/26/15
to passenge...@googlegroups.com, passenge...@googlegroups.com


On Thu, Mar 26, 2015 at 5:41 AM, Oded Gold <oded...@signalsgroup.com>
wrote:
> Hi all
>
> Has anyone used phusion/baseimage to run tomcat7? I am new to
> phusion/baseimage and trying to install tomcat7 using "apt-get
> install tomcat7" but get the following issues:

tomcat 6 and tomcat7 in my case.
my Dockerfile was (this was for Tomcat6, same applies to Tomcat7)

================================================
FROM phusion/baseimage:0.9.9
MAINTAINER yonsy...@scytl.com

RUN apt-get update
RUN apt-get install python-software-properties -y
RUN apt-add-repository ppa:webupd8team/java -y
RUN apt-get update
RUN apt-get dist-upgrade -y

RUN echo oracle-java6-installer shared/accepted-oracle-license-v1-1
select true | /usr/bin/debconf-set-selections
RUN apt-get install oracle-java6-installer oracle-java6-set-default
tomcat6 tomcat6-admin -y

RUN sed -i "s#</tomcat-users>##g" /etc/tomcat6/tomcat-users.xml; \
echo ' <role rolename="manager-gui"/>' >>
/etc/tomcat6/tomcat-users.xml; \
echo ' <role rolename="manager"/>' >> /etc/tomcat6/tomcat-users.xml;
\
echo ' <role rolename="admin"/>' >> /etc/tomcat6/tomcat-users.xml; \
echo ' <user username="admin" password="admin" roles="admin, manager,
manager-gui"/>' >> /etc/tomcat6/tomcat-users.xml; \
echo '</tomcat-users>' >> /etc/tomcat6/tomcat-users.xml

EXPOSE 8080

RUN echo 'export JAVA_HOME="/usr/lib/jvm/java-6-oracle"' >> ~/.bashrc
RUN echo "JAVA_HOME=/usr/lib/jvm/java-6-oracle" >> /etc/default/tomcat6
ENV JAVA_HOME /usr/lib/jvm/java-6-oracle
RUN update-java-alternatives -s java-6-oracle

ENV CATALINA_HOME /usr/share/tomcat6
RUN echo 'export CATALINA_HOME="/usr/share/tomcat6"' >> .bashrc
RUN echo 'CATALINA_HOME=/usr/share/tomcat6' >> /etc/default/tomcat6

ENV CATALINA_BASE /var/lib/tomcat6
RUN echo 'export CATALINA_BASE="/var/lib/tomcat6"' >> .bashrc
RUN echo 'CATALINA_BASE=/var/lib/tomcat6' >> /etc/default/tomcat6

CMD /sbin/my_init

ADD tomcat6.sh /etc/my_init.d/tomcat6.sh
RUN chmod +x /etc/my_init.d/tomcat6.sh
==================================

and tomcat6.sh file was

===============
#!/bin/bash

/etc/init.d/tomcat6 start
===============

well, you have an idea how works for me (with GlassFish was A LOT
easier)

Yonsy Solis

Message has been deleted

Oded Gold

unread,
Mar 26, 2015, 10:40:54 AM3/26/15
to passenge...@googlegroups.com
Thanks for the help but it still did not work for me I tried it using tomcat7 and java8 using your docker file and just changing tomcat6 to 7 and the java version to 8 but my problem continues with the defunct processes 

root       147     0  0 14:28 ?        00:00:00 [start-stop-daem] <defunct>
tomcat7    149     0  0 14:28 ?        00:00:00 [bash] <defunct>
tomcat7    156     0 12 14:28 ?        00:00:05 /usr/lib/jvm/default-java/bin/java -Djava.util.logging.config.file=/var/lib/tomcat7/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.awt.head
root       212     0  0 14:29 ?        00:00:00 [start-stop-daem] <defunct>
tomcat7    214     0  3 14:29 ?        00:00:00 [bash] <defunct>
tomcat7    221     0 59 14:29 ?        00:00:04 [java] <defunct>

-----------------------------


------------------------------




--
You received this message because you are subscribed to a topic in the Google Groups "passenger-docker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/passenger-docker/kOSXJLLghc4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to passenger-docker+unsubscribe@googlegroups.com.
To post to this group, send email to passenger-docker@googlegroups.com.
Visit this group at http://groups.google.com/group/passenger-docker.
To view this discussion on the web visit https://groups.google.com/d/msgid/passenger-docker/1427379007.3829.1%40smtp.gmail.com.

For more options, visit https://groups.google.com/d/optout.


Hongli Lai

unread,
Apr 23, 2015, 6:30:53 AM4/23/15
to passenge...@googlegroups.com
Defunct processes are zombie processes, as described in this blog
post: https://blog.phusion.nl/2015/01/20/docker-and-the-pid-1-zombie-reaping-problem/

Are you running everything under my_init? Without my_init, zombie
processes are not reaped.
>>> passenger-dock...@googlegroups.com.
>>> To post to this group, send email to passenge...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/passenger-docker.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/passenger-docker/1427379007.3829.1%40smtp.gmail.com.
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "passenger-docker" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to passenger-dock...@googlegroups.com.
> To post to this group, send email to passenge...@googlegroups.com.
> Visit this group at http://groups.google.com/group/passenger-docker.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/passenger-docker/CAKSBPeVHr6ETLNVLaknS%3DM%2B2kjkWH-%2B_fy-Sr4dR-wMtkd1gpg%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.



--
Phusion | Web Application deployment, scaling, and monitoring solutions

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)
Reply all
Reply to author
Forward
0 new messages