2

i am on ubuntu 10.04 server, having tomcat6. because of some reasons i had to un-install it so i used

apt-get purge tomcat6

it removed tomcat and config files.

now i am trying to install tomcat6 again, using

apt-get install tomcat6

it says

Setting up tomcat6 (6.0.24-2ubuntu1.9) ...
Adding system user `tomcat6' (UID 109) ...
Adding new user `tomcat6' (UID 109) with group `tomcat6' ...
Not creating home directory `/usr/share/tomcat6'.
* Starting Tomcat servlet engine tomcat6            [fail]
invoke-rc.d: initscript tomcat6, action "start" failed.

looked into log

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
java.util.logging.ErrorManager: 1: FileHandler is closed or not yet initialized, unable to log [Dec 2, 2011 7:39:08 AM org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080

I am not tomcat expert, so not sure should i have to reboot server to install tomcat6 again. can anyone please help?

[EDIT] - as suggested by Erick Robertson i uploaded same question on stackfault. As i am looking my answer as soon as possible, you can answer at any location

[EDIT-2] - i have deleted its duplicate on serverfault. Got it working, as mentioned by Mike, i was missing 1 step of killing processes kill -9 pid1 pid2 . Thanks very much Mike

bee
  • 121
  • 3
  • 6
    Voted to move to serverfault. – Erick Robertson Dec 02 '11 at 13:50
  • 2
    @bee You don't need to cross-post your question; moderators have the ability to migrate your question from one StackExchange site to another. – Mike Dec 02 '11 at 14:10
  • 1
    You should have a line earlier in the log stating the error, the log fragment in your question does not include the root cause. –  Dec 02 '11 at 14:14
  • 1
    @Mike- Thanks for sharing, i did not know that great feature. So you mean i should delete my question from stackfault – bee Dec 02 '11 at 14:21

1 Answers1

3

If I were looking into this myself, I would run sudo apt-get remove --purge tomcat6 (again). Once that was completed, I would run ps -eaf | grep tomcat | grep -v -e grep to check for any stray running Tomcat processes. Once I had confirmed that Tomcat was no longer running, I would reinstall: sudo apt-get install tomcat6.

Mike
  • 190
  • 1
  • 9
  • don't you think tomcat processes should be grepped as `grep java`? – Oleg Mikheev Dec 02 '11 at 14:00
  • i used
     apt-get remove --purge tomcat6 
    it says The group `code` tomcat6 does not exist. dpkg: warning: while removing tomcat6, directory '/etc/tomcat6/Catalina/localhost' not empty so not removed. dpkg: warning: while removing tomcat6, directory '/etc/tomcat6/Catalina' not empty so not removed. dpkg: warning: while removing tomcat6, directory '/etc/tomcat6' not empty so not removed.`code`. Should i run `code`rm -Rf /etc/tomcat6`code`
    – bee Dec 02 '11 at 14:03
  • 1
    @Oleg: No, in fact, I do not think that tomcat processes should be grepped as java from experience... @bee: Yes, I would `rm -rf /etc/tomcat6` in that case. – Mike Dec 02 '11 at 14:08
  • I used **rm -rf /etc/tomcat6**. bit when i run **ps -eaf | grep tomcat | grep -v -e grep** it gives so many processes – bee Dec 02 '11 at 14:13
  • e.g. `/usr/bin/java -Djava.util.logging.config.file=/usr/share/tomcat6/conf/logging.properties` `-Dcatalina.home=/usr/share/tomcat6 -Djava.io.tmpdir=/usr/share/tomcat6/temp org.apache.catalina.startup.Bootstrap start` .............. – bee Dec 02 '11 at 14:16
  • 2
    If you do not have the `tomcat6` package installed anymore, yet you still have processes running, you should kill them. The above `grep` command will get you their pids (second column of the grep output). Just run `sudo kill -9 pid1 pid2` etc (replace pid1 and pid2 with your actual pids. You can put as many pids on the line as you want.) – Mike Dec 02 '11 at 14:17
  • 1
    @Mike - thanks very much, your killing method ( `kill -9 pid1 pid2` ) was great its working. Thanks again – bee Dec 02 '11 at 14:32