Skip to Main Content

Berkeley DB Family

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Recovery as root, Tomcat as tomcat

527185Sep 19 2007 — edited Sep 21 2007
Hello,

I'm having some problems with permissions when running recovery automatically. For security reasons, I've set up a script to run Tomcat as a normal user tomcat, as thus I supposed that when running recovery throgh enviroment.setRunRecovery (true) it would run as tomcat as well.

This is not happening, and there's some kind of corruption due to power failures, it does run recovery, but it generates log files with root permissions. Then, when people try to access the containers, I get permission denied to log..... and follows a PANIC run recovery etc... although everything is ok except that the log should have been created as tomcat.
My tomcat start script is as simple as this:

#!/bin/sh
#
# start/stop/restart tomcat.



case "$1" in
start)
echo -n "Starting Tomcat daemon:"
cd /usr/local/tomcat/webapps/ROOT/
su tomcat $TOMCAT_HOME/bin/startup.sh

;;
stop)
echo -n "Stopping Tomcat daemon:"
su tomcat $TOMCAT_HOME/bin/shutdown.sh
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: /etc/init.d/tomcat {start|stop|restart}"
exit 1
;;
esac

exit 0

and the output for ps shows:

tomcat 3235 6.7 27.9 704312 426596 pts/0 Sl 09:24 0:37 /usr/local/java/bin/java -Djava.library.path=/usr/src/dbxml-2.2.13/install/lib/ -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties -Dfile.encoding=UTF-8 -Djava.endorsed.dirs=/usr/local/tomcat/common/endorsed -classpath :/usr/src/dbxml-2.2.13/db.jar:/usr/src/dbxml-2.2.13/dbxml.jar:/usr/local/tomcat//webapps/delegaciainterativa-v1/WEB-INF/lib/mysql-connector-java-3.1.8-bin.jar:/usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/commons-logging-api.jar -Dcatalina.base=/usr/local/tomcat -Dcatalina.home=/usr/local/tomcat -Djava.io.tmpdir=/usr/local/tomcat/temp org.apache.catalina.startup.Bootstrap start


So, what else could be wrong for this to be happening?

cheers,

- Breno
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 19 2007
Added on Sep 19 2007
2 comments
1,277 views