Tomcat shutdown error

not sure if this is the right forum but im having problem with tomcat restart.
i have a regular user that when he login it will go directly to a menu options (a. stop tomcat, start tomcat,). if he selects start it would should show that tomcat has been restarted. if the user press X, he will automatically log out in putty.

Problem is when he logsout , tomcat shutdown as well. See logs below. The error is not happening if i login as root and login as the regular user. I noticed that it only happens when a user is logging in directlty and press X. is this tomcat issue or just a shell issue?

log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.
log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.
(context.ServletUtil                 151 ) Removing TilesContext for context: org.apache.catalina.core.ApplicationContextFacade
log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.
log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.
log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.
1 Like

How about this: 'RE: tomcat stops when logout' - MARC

thank you. I tried this but the problem now is i got "/usr/bin/nohup: /usr/bin/nohup: cannot execute binary file". I already changed ownserhips of nohup to root but still the same.

part of the code
BINDIR=/home/tomcat/apache/bin
HOME=/home/tomcat

stoptom() {
        echo "Stopping Tomcat "
        sudo su - tomcat nohup $BINDIR/shutdown.sh
        echo "Press enter to continue."
        read enterkey
        $HOME/tom_menu.sh
}

ls -al nohup
-r-xr-xr-x 1 bin bin 26264 2008-04-04 22:22 nohup

sudoers file
tomcat ALL=(ALL) ALL

user3 ALL=(tomcat) /home/tomcat5/apache/bin/startup.sh
user3 ALL=(tomcat) /home/tomcat5/apache/bin/shutdown.sh
user3 ALL=(tomcat) /usr/bin/nohup
user3 ALL=(root)   /bin/su

---------- Post updated at 11:02 AM ---------- Previous update was at 10:08 AM ----------

if i will change the code

the error now is

Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program

Jre_home is already defined though on tomcat and user
really confused now. thaks

---------- Post updated at 02:52 PM ---------- Previous update was at 11:02 AM ----------

this is now ok. the JRE_HOME should be on ths shutdown/startup.sh instead of the restart script I created.

thank you for the help :slight_smile: