Skip to Content.
Sympa Menu

grouper-dev - Re: [grouper-dev] grouper 1.2.0 experience

Subject: Grouper Developers Forum

List archive

Re: [grouper-dev] grouper 1.2.0 experience


Chronological Thread 
  • From: "Michael R. Gettes" <>
  • To: Grouper Dev <>
  • Subject: Re: [grouper-dev] grouper 1.2.0 experience
  • Date: Mon, 17 Sep 2007 22:45:55 -0400

Chris - thanks for sending - you saved some time - much appreciated!
I only hope I may return the favor some time.

/mrg

On Sep 16, 2007, at 21:42, Chris Hyzer wrote:


and if you read this far - does anyone have an init.d script for tomcat running
under an arbitrary user I can use without assumptions of the normal tomcat5 rpm being
installed?
I have multiple tomcats running that share one base, so here are the two files you need, but you need to change where java is, catalina_base, memory usage, etc. If you are running as a non root user, it will run as that user. If you are running as root, it will sudo to the user it should run as (e.g. start up)

[mchyzer@flash
scripts]$ more /etc/init.d/tomcat_mchyzer
#!/bin/sh
#
# Startup script for the Tomcat Server
#
# chkconfig: - 86 14
# description: Tomcat
# processname:
# pidfile:
# config:
# Tomcat
# description: Starts and stops the Tomcat
# See how we were called.
# -XX:MaxPermSize=40m
export CATALINA_BASE="/home/mchyzer/tomcat"
export TOMCAT_NAME="mchyzer"
export TOMCAT_USER=$TOMCAT_NAME
export JAVA_OPTS="-Xms160m -Xmx160m -XX:MaxPermSize=120m"
export CATALINA_HOME="/opt/tomcat5_5"
export TOMCAT_HOME="/opt/tomcat5_5"
export JAVA_HOME="/opt/java5"

/etc/init.d/tomcat5_0helper $1


[mchyzer@flash
scripts]$ more /etc/init.d/tomcat5_0helper
#!/bin/sh
#
# Helper startup script for the Tomcat Server

export PATH="$JAVA_HOME/bin:$PATH"

export JAVA_OPTS="$JAVA_OPTS -Djava.library.path=$JAVA_HOME/jre/lib/ i386:$JAVA_HOME/jre/lib/i386/native_threads/:$JAVA_HOME/jre/lib/ i386/client:/opt/java/lib/i386"

echo

cd $CATALINA_BASE


case "$1" in
start)
echo -n "Starting $TOMCAT_NAME Tomcat services: "
echo
if [ "$UID" -ne "0" ]
then
$TOMCAT_HOME/bin/startup.sh
else
sudo -u $TOMCAT_USER $TOMCAT_HOME/bin/startup.sh
fi
echo
;;
stop)
echo -n "Shutting down $TOMCAT_NAME Tomcat services: "
echo
if [ "$UID" -ne "0" ]
then
$TOMCAT_HOME/bin/shutdown.sh
else
sudo -u $TOMCAT_USER $TOMCAT_HOME/bin/shutdown.sh
fi echo
;;
status)
echo | ps ax | grep $CATALINA_BASE | grep $TOMCAT_USER
;;
restart)
echo -n "Restarting Tomcat $TOMCAT_NAME services: "
$0 stop
sleep 2
$0 start
echo "done."
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
esac
[mchyzer@flash
scripts]$





Archive powered by MHonArc 2.6.16.

Top of Page