Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Corona Europa"
m |
|||
Line 16: | Line 16: | ||
* [[Corona HowTo: Installing Corona Client|Instructions for Corona Client]] | * [[Corona HowTo: Installing Corona Client|Instructions for Corona Client]] | ||
* [[Corona HowTo: Installing Corona Server|Instructions for Corona Server]] | * [[Corona HowTo: Installing Corona Server|Instructions for Corona Server]] | ||
+ | |||
+ | ---- | ||
+ | #!/bin/sh | ||
+ | # | ||
+ | # Skeleton sh script suitable for starting and stopping | ||
+ | # wrapped Java apps on the Solaris platform. | ||
+ | # | ||
+ | # Make sure that PIDFILE points to the correct location, | ||
+ | # if you have changed the default location set in the | ||
+ | # wrapper configuration file. | ||
+ | # | ||
+ | #----------------------------------------------------------------------------- | ||
+ | #CWJBOSS_HOME=/opt/Compuware/CWJBoss2.2 | ||
+ | #CWJAVA_HOME=/usr/java/j2sdk1.4.2_05 | ||
+ | |||
+ | #define SERVER_NAME | ||
+ | SERVER_NAME="cpwr" | ||
+ | if [ "$1" = "run" -a "$2" != "" ] ; then | ||
+ | SERVER_NAME="$2" | ||
+ | fi | ||
+ | echo "Defining SERVER_NAME as $SERVER_NAME" | ||
+ | |||
+ | #----------------------------------------------------------------------------- | ||
+ | # These settings can be modified to fit the needs of your application | ||
+ | # | ||
+ | # Application | ||
+ | APP_NAME="CompuwareOpenServer" | ||
+ | APP_LONG_NAME="Compuware Open Server" | ||
+ | # | ||
+ | # | ||
+ | # Priority at which to run the wrapper. See "man nic/usr/java/j2sdk1.4.2_05e" for valid priorities. | ||
+ | # nice is only used if a priority is specified. | ||
+ | PRIORITY= | ||
+ | # | ||
+ | # Location of the pid file. | ||
+ | PIDDIR="./" | ||
+ | # | ||
+ | # Do not modify anything beyond this point | ||
+ | #----------------------------------------------------------------------------- | ||
+ | # | ||
+ | # Get the fully qualified path to the script | ||
+ | case $0 in | ||
+ | /*) | ||
+ | SCRIPT="$0" | ||
+ | ;; | ||
+ | *) | ||
+ | PWD=`pwd` | ||
+ | SCRIPT="$PWD/$0" | ||
+ | ;; | ||
+ | esac | ||
+ | # | ||
+ | # Change spaces to ":" so the tokens can be parsed. | ||
+ | SCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'` | ||
+ | # Get the real path to this script, resolving any symbolic links | ||
+ | TOKENS=`echo $SCRIPT | sed -e 's;/; ;g'` | ||
+ | REALPATH= | ||
+ | for C in $TOKENS; do | ||
+ | REALPATH="$REALPATH/$C" | ||
+ | while [ -h "$REALPATH" ] ; do | ||
+ | LS="`ls -ld "$REALPATH"`" | ||
+ | LINK="`expr "$LS" : '.*-> \(.*\)$'`" | ||
+ | if expr "$LINK" : '/.*' > /dev/null; then | ||
+ | REALPATH="$LINK" | ||
+ | else | ||
+ | REALPATH="`dirname "$REALPATH"`""/$LINK" | ||
+ | fi | ||
+ | done | ||
+ | done | ||
+ | # Change ":" chars back to spaces. | ||
+ | REALPATH=`echo $REALPATH | sed -e 's;:; ;g'` | ||
+ | REALPATH=`echo $REALPATH | sed 's/\/\.\//\//g'` | ||
+ | # | ||
+ | # Change the current directory to the location of the script | ||
+ | echo REALPATH = $REALPATH | ||
+ | # REALPATH = fully qualified command for the shell script: /blah/blah/cos.sh | ||
+ | cd "`dirname "$REALPATH"`" | ||
+ | |||
+ | BINPATH=`dirname $REALPATH` | ||
+ | |||
+ | ###################################### | ||
+ | # Set COS variables relative to $REALPATH | ||
+ | |||
+ | if [ ! -d "$CWJBOSS_HOME" ] | ||
+ | then | ||
+ | CWJBOSS_HOME=`dirname $BINPATH` | ||
+ | echo Defining CWJBOSS_HOME as $CWJBOSS_HOME | ||
+ | fi | ||
+ | |||
+ | #Set CWJAVA_HOME relative to the location of $CWJBOSS_HOME | ||
+ | #if it hasn't already been set | ||
+ | |||
+ | if [ ! -d "$CWJAVA_HOME" ] | ||
+ | then | ||
+ | CWJAVA_HOME=$CWJBOSS_HOME/tools/JDK | ||
+ | echo Defining CWJAVA_HOME as $CWJAVA_HOME | ||
+ | fi | ||
+ | |||
+ | JBOSS_HOME=$CWJBOSS_HOME | ||
+ | JAVA_HOME=$CWJAVA_HOME | ||
+ | |||
+ | export CWJBOSS_HOME | ||
+ | export CWJAVA_HOME | ||
+ | export JAVA_HOME | ||
+ | export JBOSS_HOME | ||
+ | |||
+ | #alias java='$CWJAVA_HOME/bin/java' | ||
+ | ######################################### | ||
+ | |||
+ | # Wrapper | ||
+ | WRAPPER_CMD="$JBOSS_HOME/bin/cos" | ||
+ | WRAPPER_CONF="$JBOSS_HOME/configuration/cos-wrapper.conf" | ||
+ | |||
+ | # Equinox bundle name (- .jar) | ||
+ | EQUINOX_SYS="org.eclipse.osgi_3.3.0.v20070321" | ||
+ | |||
+ | # Process ID | ||
+ | if [ $SERVER_NAME = "cpwr" ] ; then | ||
+ | PIDFILE="$PIDDIR/$APP_NAME.pid" | ||
+ | else | ||
+ | PIDFILE="$PIDDIR/$APP_NAME.$SERVER_NAME.pid" | ||
+ | fi | ||
+ | |||
+ | pid="" | ||
+ | # | ||
+ | # Resolve the location of the 'ps' command | ||
+ | PSEXE="/usr/bin/ps" | ||
+ | if [ ! -x $PSEXE ] | ||
+ | then | ||
+ | PSEXE="/bin/ps" | ||
+ | if [ ! -x $PSEXE ] | ||
+ | then | ||
+ | echo "Unable to locate 'ps'." | ||
+ | echo "Please report this with the location on your system." | ||
+ | exit 1 | ||
+ | fi | ||
+ | fi | ||
+ | # | ||
+ | # Build the nice clause | ||
+ | if [ "X$PRIORITY" = "X" ] | ||
+ | then | ||
+ | CMDNICE="" | ||
+ | else | ||
+ | CMDNICE="nice -$PRIORITY" | ||
+ | fi | ||
+ | # | ||
+ | getpid() { | ||
+ | if [ -f $PIDFILE ] | ||
+ | then | ||
+ | if [ -r $PIDFILE ] | ||
+ | then | ||
+ | pid=`cat $PIDFILE` | ||
+ | if [ "X$pid" != "X" ] | ||
+ | then | ||
+ | # Verify that a process with this pid is still running. | ||
+ | pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '/^.+$/{s = $1} END{print s}'` | ||
+ | if [ "X$pid" = "X" ] | ||
+ | then | ||
+ | # This is a stale pid file. | ||
+ | rm -f $PIDFILE | ||
+ | echo "Removed stale pid file: $PIDFILE" | ||
+ | fi | ||
+ | fi | ||
+ | else | ||
+ | echo "Cannot read $PIDFILE." | ||
+ | exit 1 | ||
+ | fi | ||
+ | fi | ||
+ | } | ||
+ | # | ||
+ | testpid() { | ||
+ | pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '/^.+$/{s = $1} END{print s}'` | ||
+ | if [ "X$pid" = "X" ] | ||
+ | then | ||
+ | # Process is gone so remove the pid file. | ||
+ | rm -f $PIDFILE | ||
+ | fi | ||
+ | } | ||
+ | # | ||
+ | console() { | ||
+ | echo "Running $APP_LONG_NAME..." | ||
+ | unix_version | ||
+ | getpid | ||
+ | if [ "X$pid" = "X" ] | ||
+ | then | ||
+ | exec $CMDNICE $WRAPPER_CMD $WRAPPER_CONF wrapper.pidfile=$PIDFILE | ||
+ | else | ||
+ | echo "$APP_LONG_NAME is already running." | ||
+ | exit 1 | ||
+ | fi | ||
+ | } | ||
+ | # | ||
+ | unix_version() { | ||
+ | # This section defines machine dependent variables. | ||
+ | SUPPORTED_ARCHS="solaris hpux aix linux" | ||
+ | RH_DISTRO=0 | ||
+ | SU_DISTRO=0 | ||
+ | |||
+ | # These variables are set to default values | ||
+ | OS_BITS=32 | ||
+ | LIB_DIR=lib | ||
+ | ARCH=unknown | ||
+ | HT_UPDATE_RCFILE=replace | ||
+ | HAS_ECOSYS=0 | ||
+ | NEW_AGT=n | ||
+ | EXISTING_AGT=necho | ||
+ | |||
+ | tmpVAR=`uname -a` | ||
+ | HOST=`echo ${tmpVAR} | awk '{print $2}'` | ||
+ | ARCH=`echo ${tmpVAR} | awk '{print $1}'` | ||
+ | OS_NAME=`echo ${tmpVAR} | awk '{print $1}'` | ||
+ | OS_REL=`echo ${tmpVAR} | awk '{print $3}'` | ||
+ | OS_VER=`echo ${OS_REL} | awk -F. '{print $2}'` | ||
+ | CUR_OS_MODE=32 | ||
+ | |||
+ | # determine the ARCH and OS_BITS variables | ||
+ | case $ARCH in | ||
+ | Linux) # Linux | ||
+ | DISTRO=`cat /proc/version` | ||
+ | DISTRO_CK=`egrep -c -e "Red Hat" /proc/version` | ||
+ | if [ "$DISTRO_CK" = 0 ]; then | ||
+ | DISTRO_CK=`egrep -c -e "SuSE" /proc/version` | ||
+ | if [ "$DISTRO_CK" = 0 ]; then | ||
+ | echo "Unsupported Linux distribution: " |tee -a $DBGFILE | ||
+ | echo "$DISTRO" |tee -a $DBGFILE | ||
+ | echo "Aborting installation!" |tee -a $DBGFILE | ||
+ | exit 1 | ||
+ | else | ||
+ | SU_DISTRO=1 | ||
+ | fi | ||
+ | else | ||
+ | RH_DISTRO=1 | ||
+ | fi | ||
+ | echo "Attempting install on $DISTRO" |tee -a $DBGFILE | ||
+ | #OS_BITS=`file /proc/kcore | cut -d" " -f3 | cut -d"-" -f1` # Get OS Bitness (Lame!!!!) | ||
+ | OS_BITS="32" | ||
+ | OS_MAJOR=`echo ${OS_REL} | awk -F. '{print $1}'` ## Get Major Version | ||
+ | OS_MINOR=`echo ${OS_REL} | awk -F. '{print $2}'` ## Get Minor Version | ||
+ | OS_PATCH_T=`echo ${OS_REL} | awk -F. '{print $3}'` ## Get Patch Version | ||
+ | OS_PATCH=`echo ${OS_PATCH_T} | sed 's/-/ /' | awk '{print $1}'` ## Get Patch Version | ||
+ | if [ $OS_MAJOR -lt 2 ]; then | ||
+ | echo "Product is currently tested with only kernel version 2 and above" |tee -a $DBGFILE | ||
+ | cleanup | ||
+ | elif [ $OS_MAJOR -eq 2 -a "$OS_MINOR" -lt 4 ]; then | ||
+ | echo "Product is currently tested with only kernel version 2.4 and above" |tee -a $DBGFILE | ||
+ | cleanup | ||
+ | elif [ $OS_MAJOR -eq 2 -a "$OS_MINOR" -eq 4 -a $OS_PATCH -lt 20 ]; then | ||
+ | echo "Product is currently tested with only kernel version 2.4.20 and above" |tee -a $DBGFILE | ||
+ | cleanup | ||
+ | else | ||
+ | HAS_ECOSYS=0 | ||
+ | ARCH=linux | ||
+ | ARCH_NAME=Linux | ||
+ | fi | ||
+ | |||
+ | # Check for glibc and net-snmp | ||
+ | GLIBC_VERSION=`rpm -qa | grep -i "^glibc-[0-9]" | cut -d"-" -f2` | ||
+ | GLIBC_NUMBER=`echo $GLIBC_VERSION|awk -F"." '{print $1*1000 + $2*100 +$3}'` | ||
+ | if [ $GLIBC_NUMBER -lt 2302 ]; then | ||
+ | echo "Your glibc version is $GLIBC_VERSION" | tee -a $DBGFILE | ||
+ | echo "glibc versions less than 2.3.2 are not supported." |tee -a $DBGFILE | ||
+ | cleanup | ||
+ | fi | ||
+ | if [ "`rpm -qa | grep -i "net-snmp"`" = "" ]; then | ||
+ | echo "The rpm for net-snmp was not installed on this system." |tee -a $DBGFILE | ||
+ | cleanup | ||
+ | fi | ||
+ | |||
+ | ;; | ||
+ | |||
+ | SunOS) # SunOS | ||
+ | if [ "$OS_NAME" = SunOS -a "$OS_VER" -ge 5 ]; then | ||
+ | HAS_ECOSYS=1 | ||
+ | ARCH=solaris | ||
+ | ARCH_NAME=Solaris32 | ||
+ | if [ "$OS_VER" -ge 7 ]; then | ||
+ | OS_BITS=`isainfo -b` | ||
+ | fi | ||
+ | fi | ||
+ | case $OS_BITS in | ||
+ | 32) | ||
+ | ARCH_NAME=Solaris32 | ||
+ | ;; | ||
+ | 64) | ||
+ | ARCH_NAME=Solaris64 | ||
+ | ;; | ||
+ | esac | ||
+ | |||
+ | ;; | ||
+ | |||
+ | HP-UX) # HP-UX | ||
+ | if [ "$OS_NAME" = HP-UX -a "$OS_VER" -ge 10 ]; then # change this line if 10.X is not supported! | ||
+ | HAS_ECOSYS=1 | ||
+ | ARCH=hpux | ||
+ | ARCH_NAME=HPUX32 | ||
+ | if [ "$OS_VER" -ge 11 ]; then | ||
+ | OS_BITS=`getconf KERNEL_BITS` | ||
+ | OS_MINOR_VER=`uname -r | awk -F. '{print $3}'` | ||
+ | if [ "$OS_MINOR_VER" -ge 11 ]; then ## test for HPUX11i | ||
+ | OS_VER=$OS_VER"."$OS_MINOR_VER | ||
+ | fi | ||
+ | fi | ||
+ | case $OS_BITS in | ||
+ | 32) | ||
+ | ARCH_NAME=HPUX32 | ||
+ | ;; | ||
+ | 64) | ||
+ | ARCH_NAME=HPUX64 | ||
+ | ;; | ||
+ | esac | ||
+ | |||
+ | |||
+ | fi | ||
+ | ;; | ||
+ | |||
+ | AIX) # AIX | ||
+ | if [ "$OS_NAME" = AIX ]; then | ||
+ | HAS_ECOSYS=1 | ||
+ | ARCH=aix | ||
+ | ARCH_NAME=AIX | ||
+ | os_ver=`uname -v` | ||
+ | os_rel=`uname -r` | ||
+ | OS_VER=`echo $os_ver.$os_rel` | ||
+ | fi | ||
+ | ;; | ||
+ | unknown) # the second test checks for an ARCH that this script supports, | ||
+ | # but that is not yet a supported ARCH | ||
+ | if [ "$ARCH" = unknown -o "`echo "$SUPPORTED_ARCHS" | grep "$ARCH"`" = "" ]; then | ||
+ | echo | ||
+ | echo "ERROR: `uname -s` `uname -r` is not supported." | ||
+ | echo "CAUSE: The machine architectures and operating systems that $SV_DISPLAYNAME supports " | ||
+ | echo " are listed in the $SV_DISPLAYNAME Installation Guide. Check to make sure your " | ||
+ | echo " machine and operating system are among those listed." | ||
+ | echo "RESOLUTION: Contact $SV_DISPLAYNAME Technical Support." | ||
+ | cleanup | ||
+ | fi | ||
+ | ;; | ||
+ | esac | ||
+ | |||
+ | # Resolve the architecture | ||
+ | DIST_ARCH=`uname -p | tr [:upper:] [:lower:] | tr -d [:blank:]` | ||
+ | if [ "$DIST_ARCH" = "unknown" ] | ||
+ | then | ||
+ | DIST_ARCH=`uname -m | tr [:upper:] [:lower:] | tr -d [:blank:]` | ||
+ | fi | ||
+ | case "$DIST_ARCH" in | ||
+ | 'amd64' | 'athlon' | 'ia32' | 'ia64' | 'i386' | 'i486' | 'i586' | 'i686' | 'x86_64') | ||
+ | DIST_ARCH="x86" | ||
+ | ;; | ||
+ | 'ip27') | ||
+ | DIST_ARCH="mips" | ||
+ | ;; | ||
+ | 'power' | 'powerpc' | 'power_pc' | 'ppc64') | ||
+ | DIST_ARCH="ppc" | ||
+ | ;; | ||
+ | 'pa_risc' | 'pa-risc') | ||
+ | DIST_ARCH="parisc" | ||
+ | ;; | ||
+ | 'sun4u' | 'sparcv9') | ||
+ | DIST_ARCH="sparc" | ||
+ | ;; | ||
+ | '9000/800') | ||
+ | DIST_ARCH="parisc" | ||
+ | ;; | ||
+ | esac | ||
+ | |||
+ | |||
+ | #fix the wrapper command | ||
+ | WRAPPER_CMD="$WRAPPER_CMD-$ARCH-$DIST_ARCH-$OS_BITS" | ||
+ | } | ||
+ | install() { | ||
+ | echo "Install $APP_LONG_NAME" #..." | ||
+ | |||
+ | case $ARCH_NAME in | ||
+ | Linux) | ||
+ | |||
+ | # add init link for cos shell script | ||
+ | ln -fs $REALPATH /etc/init.d/cos | ||
+ | |||
+ | # add kill links for daemon mode | ||
+ | ln -s /etc/init.d/cos /etc/rc.d/rc0.d/K34cos | ||
+ | ln -s /etc/init.d/cos /etc/rc.d/rc1.d/K34cos | ||
+ | ln -s /etc/init.d/cos /etc/rc.d/rc2.d/K34cos | ||
+ | ln -s /etc/init.d/cos /etc/rc.d/rc6.d/K34cos | ||
+ | |||
+ | # add start links for daemon mode | ||
+ | ln -s /etc/init.d/cos /etc/rc.d/rc3.d/S92cos | ||
+ | ln -s /etc/init.d/cos /etc/rc.d/rc4.d/S92cos | ||
+ | ln -s /etc/init.d/cos /etc/rc.d/rc5.d/S92cos | ||
+ | ;; | ||
+ | |||
+ | Solaris32) | ||
+ | |||
+ | # add init link for cos shell script | ||
+ | ln -fs $REALPATH /etc/init.d/cos | ||
+ | |||
+ | # add kill links for daemon mode | ||
+ | ln -s /etc/init.d/cos /etc/rcS.d/K34cos | ||
+ | ln -s /etc/init.d/cos /etc/rc0.d/K34cos | ||
+ | ln -s /etc/init.d/cos /etc/rc1.d/K34cos | ||
+ | |||
+ | # add start links for daemon mode | ||
+ | ln -s /etc/init.d/cos /etc/rc2.d/S92cos | ||
+ | ;; | ||
+ | |||
+ | Solaris64) | ||
+ | |||
+ | # add init link for cos shell script | ||
+ | ln -fs $REALPATH /etc/init.d/cos | ||
+ | |||
+ | # add kill links for daemon mode | ||
+ | ln -s /etc/init.d/cos /etc/rcS.d/K34cos | ||
+ | ln -s /etc/init.d/cos /etc/rc0.d/K34cos | ||
+ | ln -s /etc/init.d/cos /etc/rc1.d/K34cos | ||
+ | |||
+ | # add start links for daemon mode | ||
+ | ln -s /etc/init.d/cos /etc/rc2.d/S92cos | ||
+ | ;; | ||
+ | |||
+ | HPUX32) | ||
+ | |||
+ | # add init link for cos shell script | ||
+ | ln -fs $REALPATH /sbin/init.d/cos | ||
+ | |||
+ | # add kill links for daemon mode | ||
+ | ln -s /sbin/init.d/cos /sbin/rc1.d/K92cos | ||
+ | |||
+ | # add start links for daemon mode | ||
+ | ln -s /sbin/init.d/cos /sbin/rc2.d/S92cos | ||
+ | |||
+ | ;; | ||
+ | |||
+ | HPUX64) | ||
+ | |||
+ | # add init link for cos shell script | ||
+ | ln -fs $REALPATH /sbin/init.d/cos | ||
+ | |||
+ | # add kill links for daemon mode | ||
+ | ln -s /sbin/init.d/cos /sbin/rc1.d/K34cos | ||
+ | |||
+ | # add start links for daemon mode | ||
+ | ln -s /sbin/init.d/cos /sbin/rc2.d/S92cos | ||
+ | |||
+ | ;; | ||
+ | |||
+ | AIX) | ||
+ | |||
+ | # add init link for cos shell script | ||
+ | ln -fs $REALPATH /etc/rc.d/init.d/cos | ||
+ | |||
+ | # add kill links for daemon mode | ||
+ | ln -s /etc/rc.d/init.d/cos /etc/rc.d/rc2.d/K34cos | ||
+ | |||
+ | # add start links for daemon mode | ||
+ | ln -s /etc/rc.d/init.d/cos /etc/rc.d/rc2.d/S92cos | ||
+ | ;; | ||
+ | esac | ||
+ | |||
+ | } | ||
+ | ## | ||
+ | uninstall() { | ||
+ | echo "Uninstall $APP_LONG_NAME" #...on $ARCH_NAME" | ||
+ | |||
+ | case $ARCH_NAME in | ||
+ | Linux) | ||
+ | |||
+ | # remove kill links for daemon mode | ||
+ | rm /etc/rc.d/rc0.d/K34cos | ||
+ | rm /etc/rc.d/rc1.d/K34cos | ||
+ | rm /etc/rc.d/rc2.d/K34cos | ||
+ | rm /etc/rc.d/rc6.d/K34cos | ||
+ | |||
+ | # remove start links for daemon mode | ||
+ | rm /etc/rc.d/rc3.d/S92cos | ||
+ | rm /etc/rc.d/rc4.d/S92cos | ||
+ | rm /etc/rc.d/rc5.d/S92cos | ||
+ | |||
+ | # remove script link for daemon mode | ||
+ | rm /etc/init.d/cos | ||
+ | |||
+ | ;; | ||
+ | |||
+ | Solaris32) | ||
+ | |||
+ | # remove kill links for daemon mode | ||
+ | rm /etc/rcS.d/K34cos | ||
+ | rm /etc/rc0.d/K34cos | ||
+ | rm /etc/rc1.d/K34cos | ||
+ | |||
+ | # remove start links for daemon mode | ||
+ | rm /etc/rc2.d/S92cos | ||
+ | |||
+ | # remove script link for daemon mode | ||
+ | rm /etc/init.d/cos | ||
+ | |||
+ | ;; | ||
+ | |||
+ | Solaris64) | ||
+ | |||
+ | # remove kill links for daemon mode | ||
+ | rm /etc/rcS.d/K34cos | ||
+ | rm /etc/rc0.d/K34cos | ||
+ | rm /etc/rc1.d/K34cos | ||
+ | |||
+ | # remove start links for daemon mode | ||
+ | rm /etc/rc2.d/S92cos | ||
+ | |||
+ | # remove script link for daemon mode | ||
+ | rm /etc/init.d/cos | ||
+ | |||
+ | ;; | ||
+ | |||
+ | HPUX32) | ||
+ | # remove kill links for daemon mode | ||
+ | rm /sbin/rc1.d/K92cos | ||
+ | |||
+ | # remove start links for daemon mode | ||
+ | rm /sbin/rc2.d/S92cos | ||
+ | |||
+ | # remove script link for daemon mode | ||
+ | rm /sbin/init.d/cos | ||
+ | |||
+ | ;; | ||
+ | |||
+ | HPUX64) | ||
+ | # remove kill links for daemon mode | ||
+ | rm /sbin/rc1.d/K92cos | ||
+ | |||
+ | # remove start links for daemon mode | ||
+ | rm /sbin/rc2.d/S92cos | ||
+ | |||
+ | # remove script link for daemon mode | ||
+ | rm /sbin/init.d/cos | ||
+ | |||
+ | ;; | ||
+ | |||
+ | AIX) | ||
+ | |||
+ | # remove kill links for daemon mode | ||
+ | rm /etc/rc.d/rc2.d/K34cos | ||
+ | |||
+ | # remove start links for daemon mode | ||
+ | rm /ect/rc.d/rc2.d/S92cos | ||
+ | |||
+ | # remove script link for daemon mode | ||
+ | rm /etc/rc.d/init.d/cos | ||
+ | |||
+ | ;; | ||
+ | esac | ||
+ | |||
+ | } | ||
+ | # | ||
+ | startConsole() { | ||
+ | # | ||
+ | DAEMON_WRAPPER=wrapper.daemonize=FALSE | ||
+ | export DAEMON_WRAPPER | ||
+ | # | ||
+ | startCWJBoss | ||
+ | } | ||
+ | |||
+ | startDaemon(){ | ||
+ | # | ||
+ | DAEMON_WRAPPER=wrapper.daemonize=TRUE | ||
+ | export DAEMON_WRAPPER | ||
+ | # | ||
+ | startCWJBoss | ||
+ | } | ||
+ | |||
+ | startCWJBoss() { | ||
+ | echo "Starting $APP_LONG_NAME..." | ||
+ | unix_version | ||
+ | getpid | ||
+ | |||
+ | # echo DAEMON_WRAPPER=$DAEMON_WRAPPER | ||
+ | |||
+ | if [ "X$pid" = "X" ] | ||
+ | then | ||
+ | # echo Starting | ||
+ | echo WRAPPER_CMD=$WRAPPER_CMD | ||
+ | echo WRAPPER_CONF=$WRAPPER_CONF | ||
+ | echo wrapper.java.command=$CWJAVA_HOME/bin/java | ||
+ | # echo wrapper.java.classpath.2=$CWJAVA_HOME/lib/tools.jar | ||
+ | # echo wrapper.java.library.path.1=$JBOSS_HOME/bin | ||
+ | # echo wrapper.java.classpath.3=$JBOSS_HOME/bin/run.jar | ||
+ | # echo wrapper.java.classpath.1=$JBOSS_HOME/lib/CWJBossSrv.jar | ||
+ | # echo wrapper.logfile=$JBOSS_HOME/server/$SERVER_NAME/log/CWJBossSrv.log | ||
+ | |||
+ | #AIX does not support hotspot | ||
+ | if [ "$OS_NAME" = AIX ]; then | ||
+ | #no hot spot, set wrapper.java.additional.1= | ||
+ | exec $CMDNICE $WRAPPER_CMD $WRAPPER_CONF "wrapper.java.command=$CWJAVA_HOME/bin/java" "wrapper.java.library.path.1=$JBOSS_HOME/bin/lib" "wrapper.java.classpath.1=$JBOSS_HOME/bin/lib/wrapper.jar" "wrapper.java.classpath.2=$CWJAVA_HOME/lib/tools.jar" "wrapper.java.classpath.3=$JBOSS_HOME/plugins/$EQUINOX_SYS.jar" "wrapper.java.classpath.4=$JBOSS_HOME/bin/lib/cos-main.jar" wrapper.java.additional.3= "wrapper.java.additional.1=-Dosgi.framework=$JBOSS_HOME/plugins/$EQUINOX_SYS.jar" "wrapper.java.additional.2=-Dosgi.install.area=$JBOSS_HOME" "wrapper.pidfile=$PIDFILE" "$DAEMON_WRAPPER" | ||
+ | else | ||
+ | exec $CMDNICE $WRAPPER_CMD $WRAPPER_CONF "wrapper.java.command=$CWJAVA_HOME/bin/java" "wrapper.java.library.path.1=$JBOSS_HOME/bin/lib" "wrapper.java.classpath.1=$JBOSS_HOME/bin/lib/wrapper.jar" "wrapper.java.classpath.2=$CWJAVA_HOME/lib/tools.jar" "wrapper.java.classpath.3=$JBOSS_HOME/plugins/$EQUINOX_SYS.jar" "wrapper.java.classpath.4=$JBOSS_HOME/bin/lib/cos-main.jar" "wrapper.java.additional.1=-Dosgi.framework=$JBOSS_HOME/plugins/$EQUINOX_SYS.jar" "wrapper.java.additional.2=-Dosgi.install.area=$JBOSS_HOME" "wrapper.pidfile=$PIDFILE" "$DAEMON_WRAPPER" | ||
+ | fi | ||
+ | else | ||
+ | echo "$APP_LONG_NAME is already running." | ||
+ | exit 1 | ||
+ | fi | ||
+ | } | ||
+ | # | ||
+ | stopit() { | ||
+ | echo "Stopping $APP_LONG_NAME..." | ||
+ | getpid | ||
+ | if [ "X$pid" = "X" ] | ||
+ | then | ||
+ | echo "$APP_LONG_NAME was not running." | ||
+ | else | ||
+ | # Running so try to stop it. | ||
+ | kill $pid | ||
+ | if [ $? -ne 0 ] | ||
+ | then | ||
+ | # An explanation for the failure should have been given | ||
+ | echo "Unable to stop $APP_LONG_NAME." | ||
+ | exit 1 | ||
+ | fi | ||
+ | |||
+ | # We can not predict how long it will take for the wrapper to | ||
+ | # actually stop as it depends on settings in wrapper.conf. | ||
+ | # Loop until it does. | ||
+ | savepid=$pid | ||
+ | CNT=0 | ||
+ | TOTCNT=0 | ||
+ | while [ "X$pid" != "X" ] | ||
+ | do | ||
+ | # Loop for up to 5 minutes | ||
+ | if [ "$TOTCNT" -lt "300" ] | ||
+ | then | ||
+ | if [ "$CNT" -lt "5" ] | ||
+ | then | ||
+ | CNT=`expr $CNT + 1` | ||
+ | else | ||
+ | echo "Waiting for $APP_LONG_NAME to exit..." | ||
+ | CNT=0 | ||
+ | fi | ||
+ | TOTCNT=`expr $TOTCNT + 1` | ||
+ | |||
+ | sleep 1 | ||
+ | |||
+ | testpid | ||
+ | else | ||
+ | pid= | ||
+ | fi | ||
+ | done | ||
+ | |||
+ | pid=$savepid | ||
+ | testpid | ||
+ | if [ "X$pid" != "X" ] | ||
+ | then | ||
+ | echo "Timed out waiting for $APP_LONG_NAME to exit." | ||
+ | echo " Attempting a forced exit..." | ||
+ | kill -9 $pid | ||
+ | fi | ||
+ | |||
+ | pid=$savepid | ||
+ | testpid | ||
+ | if [ "X$pid" != "X" ] | ||
+ | then | ||
+ | echo "Failed to stop $APP_LONG_NAME." | ||
+ | exit 1 | ||
+ | else | ||
+ | echo "Stopped $APP_LONG_NAME." | ||
+ | fi | ||
+ | fi | ||
+ | } | ||
+ | # | ||
+ | addtest() { | ||
+ | echo "addtest" | ||
+ | cp -r $JBOSS_HOME/test $JBOSS_HOME/server/$SERVER_NAME/data/CWJBoss/admin/Test | ||
+ | } | ||
+ | # | ||
+ | removetest() { | ||
+ | echo "removetest" | ||
+ | rm -r $JBOSS_HOME/server/$SERVER_NAME/data/CWJBoss/admin/Test | ||
+ | } | ||
+ | # | ||
+ | support() { | ||
+ | echo "support" | ||
+ | # | ||
+ | JBOSS_SUPPORT_CLASSPATH=$JBOSS_HOME/server/$SERVER_NAME/data/CWJBoss/admin/Server/CWJBossSupport:$JBOSS_HOME/server/$SERVER_NAME/lib/CWJBossAdmin.jar:$JBOSS_HOME/server/$SERVER_NAME/lib/log4j.jar:$JBOSS_HOME/server/$SERVER_NAME/lib/CWUtil.jar:$JBOSS_HOME/lib/jboss-jmx.jar | ||
+ | export JBOSS_SUPPORT_CLASSPATH | ||
+ | # echo $JBOSS_SUPPORT_CLASSPATH | ||
+ | # | ||
+ | JAVA_OPTS=-Djboss.server.home.dir=$JBOSS_HOME/server/$SERVER_NAME | ||
+ | export JAVA_OPTS | ||
+ | |||
+ | |||
+ | if [ "X$1" = "X" ] | ||
+ | then | ||
+ | if [ -d '/tmp' ] | ||
+ | then | ||
+ | ### if ! [ -d '/tmp/CWSupport' ] | ||
+ | if [ ! -d '/tmp/CWSupport' ] | ||
+ | then | ||
+ | mkdir /tmp/CWSupport | ||
+ | fi | ||
+ | JBOSS_SUPPORT_DIR_LOCATION=/tmp/CWSupport | ||
+ | # export JBOSS_SUPPORT_DIR_LOCATION | ||
+ | else | ||
+ | JBOSS_SUPPORT_DIR_LOCATION=/opt/Compuware/CWJBoss/server/$SERVER_NAME/log | ||
+ | # export JBOSS_SUPPORT_DIR_LOCATION | ||
+ | fi | ||
+ | else | ||
+ | if [ -d $1 ] | ||
+ | then | ||
+ | JBOSS_SUPPORT_DIR_LOCATION=$1 | ||
+ | # export JBOSS_SUPPORT_DIR_LOCATION | ||
+ | else | ||
+ | ### if ! [ -d $1 ] | ||
+ | if [ ! -d $1 ] | ||
+ | then | ||
+ | mkdir $1 | ||
+ | fi | ||
+ | JBOSS_SUPPORT_DIR_LOCATION=$1 | ||
+ | # export JBOSS_SUPPORT_DIR_LOCATION | ||
+ | fi | ||
+ | fi | ||
+ | |||
+ | export JBOSS_SUPPORT_DIR_LOCATION | ||
+ | |||
+ | java $JAVA_OPTS -classpath $JBOSS_SUPPORT_CLASSPATH com.compuware.jboss.admin.support.CWSupportAction $JBOSS_SUPPORT_DIR_LOCATION $JBOSS_HOME/server/$SERVER_NAME/data | ||
+ | # | ||
+ | echo "The support package is located in this directory: $JBOSS_SUPPORT_DIR_LOCATION" | ||
+ | } | ||
+ | # | ||
+ | status() { | ||
+ | |||
+ | getpid | ||
+ | if [ "X$pid" = "X" ] | ||
+ | then | ||
+ | echo "$APP_LONG_NAME is not running." | ||
+ | exit 1 | ||
+ | else | ||
+ | echo "$APP_LONG_NAME is running ($pid)." | ||
+ | exit 0 | ||
+ | fi | ||
+ | } | ||
+ | # | ||
+ | dump() { | ||
+ | echo "Dumping $APP_LONG_NAME..." | ||
+ | getpid | ||
+ | if [ "X$pid" = "X" ] | ||
+ | then | ||
+ | echo "$APP_LONG_NAME was not running." | ||
+ | |||
+ | else | ||
+ | kill -3 $pid | ||
+ | |||
+ | if [ $? -ne 0 ] | ||
+ | then | ||
+ | echo "Failed to dump $APP_LONG_NAME." | ||
+ | exit 1 | ||
+ | else | ||
+ | echo "Dumped $APP_LONG_NAME." | ||
+ | fi | ||
+ | fi | ||
+ | } | ||
+ | # | ||
+ | resetmq() { | ||
+ | $JAVA_HOME/bin/java -jar $CWJBOSS_HOME/client/MqDoctor.jar -deletemsg -all | ||
+ | $JAVA_HOME/bin/java -jar $CWJBOSS_HOME/client/MqDoctor.jar -deletedurasub -all | ||
+ | } | ||
+ | # | ||
+ | openlog() { | ||
+ | echo "Open Log for $APP_LONG_NAME..." | ||
+ | more $JBOSS_HOME/server/$SERVER_NAME/log/server.log | ||
+ | } | ||
+ | |||
+ | get_unix_distribution(){ | ||
+ | |||
+ | if [ -f '/etc/redhat-release' ] | ||
+ | then | ||
+ | echo "redhat" | ||
+ | fi | ||
+ | |||
+ | |||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | # | ||
+ | case "$1" in | ||
+ | |||
+ | |||
+ | |||
+ | 'install') | ||
+ | unix_version | ||
+ | echo "Compuware Open Server" | ||
+ | #on '$ARCH_NAME'." | ||
+ | install | ||
+ | ;; | ||
+ | |||
+ | 'uninstall') | ||
+ | unix_version | ||
+ | echo "Compuware Open Server" | ||
+ | uninstall | ||
+ | ;; | ||
+ | |||
+ | 'start') | ||
+ | startDaemon | ||
+ | ;; | ||
+ | |||
+ | 'start_msg') | ||
+ | echo "Compuware Open Server daemon is starting." | ||
+ | ;; | ||
+ | |||
+ | 'stop') | ||
+ | stopit | ||
+ | ;; | ||
+ | |||
+ | 'stop_msg') | ||
+ | echo "Compuware Open Server daemon is stopping." | ||
+ | ;; | ||
+ | |||
+ | # 'console') | ||
+ | 'run') | ||
+ | startConsole | ||
+ | ;; | ||
+ | |||
+ | 'restart') | ||
+ | stopit | ||
+ | start | ||
+ | ;; | ||
+ | |||
+ | 'log') | ||
+ | openlog | ||
+ | ;; | ||
+ | |||
+ | 'addtest') | ||
+ | addtest | ||
+ | ;; | ||
+ | |||
+ | 'removetest') | ||
+ | removetest | ||
+ | ;; | ||
+ | |||
+ | 'support') | ||
+ | support $2 | ||
+ | ;; | ||
+ | |||
+ | 'status') | ||
+ | status | ||
+ | ;; | ||
+ | |||
+ | 'dump') | ||
+ | dump | ||
+ | ;; | ||
+ | |||
+ | 'resetmq') | ||
+ | resetmq | ||
+ | ;; | ||
+ | |||
+ | # test code remove | ||
+ | 'version') | ||
+ | unix_version | ||
+ | ;; | ||
+ | |||
+ | *) | ||
+ | echo "==========================================================================================" | ||
+ | echo "= =" | ||
+ | # echo "= Usage: $0 { install | uninstall | start | stop | run | log | restart | status | dump } =" | ||
+ | echo "= Usage: $0 { start | stop | run | log | restart | status | dump | resetmq } =" | ||
+ | # echo "= install option is used to install COS daemon and start it =" | ||
+ | # echo "= uninstall option is used to stop and remove the COS daemon =" | ||
+ | echo "= start option is used to start COS daemon, it must be installed =" | ||
+ | echo "= stop option is used to stop does not remove the COS service =" | ||
+ | echo "= run option is used to start COS in a console =" | ||
+ | echo "= log option is used to display log using more =" | ||
+ | echo "= addtest option is used to deploy test components into COS =" | ||
+ | echo "= removetest option is used to un-deploy test component in COS =" | ||
+ | echo "= support option is used to create a zip file with config info for review =" | ||
+ | echo "= resetmq unsubscribe all durable subscribers except =" | ||
+ | echo "= CWMRMsgLogger, also clear all messages =" | ||
+ | echo "= =" | ||
+ | echo "= Copyright 2003-2004, Compuware Corporation =" | ||
+ | echo "==========================================================================================" | ||
+ | exit 1 | ||
+ | ;; | ||
+ | esac | ||
+ | # | ||
+ | exit 0 | ||
+ | ---- | ||
[[Category:Corona]] | [[Category:Corona]] |
Revision as of 15:03, 11 April 2007
Eclipse Home | Wiki Home | Plan |
Europa Release Information
This page is dedicated to the functionality provided in the Europa release of Corona schedule for June 29, 2007.
Exemplary Implementation
The Exemplary Implementation allows a user to experience Corona without having to install the server component
Corona Client & Server Downloads
- !/bin/sh
- Skeleton sh script suitable for starting and stopping
- wrapped Java apps on the Solaris platform.
- Make sure that PIDFILE points to the correct location,
- if you have changed the default location set in the
- wrapper configuration file.
- -----------------------------------------------------------------------------
- CWJBOSS_HOME=/opt/Compuware/CWJBoss2.2
- CWJAVA_HOME=/usr/java/j2sdk1.4.2_05
- define SERVER_NAME
SERVER_NAME="cpwr" if [ "$1" = "run" -a "$2" != "" ] ; then SERVER_NAME="$2" fi echo "Defining SERVER_NAME as $SERVER_NAME"
- -----------------------------------------------------------------------------
- These settings can be modified to fit the needs of your application
- Application
APP_NAME="CompuwareOpenServer" APP_LONG_NAME="Compuware Open Server"
- Priority at which to run the wrapper. See "man nic/usr/java/j2sdk1.4.2_05e" for valid priorities.
- nice is only used if a priority is specified.
PRIORITY=
- Location of the pid file.
PIDDIR="./"
- Do not modify anything beyond this point
- -----------------------------------------------------------------------------
- Get the fully qualified path to the script
case $0 in
/*) SCRIPT="$0" ;; *) PWD=`pwd` SCRIPT="$PWD/$0" ;;
esac
- Change spaces to ":" so the tokens can be parsed.
SCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'`
- Get the real path to this script, resolving any symbolic links
TOKENS=`echo $SCRIPT | sed -e 's;/; ;g'` REALPATH= for C in $TOKENS; do
REALPATH="$REALPATH/$C" while [ -h "$REALPATH" ] ; do LS="`ls -ld "$REALPATH"`" LINK="`expr "$LS" : '.*-> \(.*\)$'`" if expr "$LINK" : '/.*' > /dev/null; then REALPATH="$LINK" else REALPATH="`dirname "$REALPATH"`""/$LINK" fi done
done
- Change ":" chars back to spaces.
REALPATH=`echo $REALPATH | sed -e 's;:; ;g'` REALPATH=`echo $REALPATH | sed 's/\/\.\//\//g'`
- Change the current directory to the location of the script
echo REALPATH = $REALPATH
- REALPATH = fully qualified command for the shell script: /blah/blah/cos.sh
cd "`dirname "$REALPATH"`"
BINPATH=`dirname $REALPATH`
- Set COS variables relative to $REALPATH
if [ ! -d "$CWJBOSS_HOME" ] then CWJBOSS_HOME=`dirname $BINPATH` echo Defining CWJBOSS_HOME as $CWJBOSS_HOME fi
- Set CWJAVA_HOME relative to the location of $CWJBOSS_HOME
- if it hasn't already been set
if [ ! -d "$CWJAVA_HOME" ] then CWJAVA_HOME=$CWJBOSS_HOME/tools/JDK echo Defining CWJAVA_HOME as $CWJAVA_HOME fi
JBOSS_HOME=$CWJBOSS_HOME JAVA_HOME=$CWJAVA_HOME
export CWJBOSS_HOME export CWJAVA_HOME export JAVA_HOME export JBOSS_HOME
- alias java='$CWJAVA_HOME/bin/java'
- Wrapper
WRAPPER_CMD="$JBOSS_HOME/bin/cos" WRAPPER_CONF="$JBOSS_HOME/configuration/cos-wrapper.conf"
- Equinox bundle name (- .jar)
EQUINOX_SYS="org.eclipse.osgi_3.3.0.v20070321"
- Process ID
if [ $SERVER_NAME = "cpwr" ] ; then PIDFILE="$PIDDIR/$APP_NAME.pid" else PIDFILE="$PIDDIR/$APP_NAME.$SERVER_NAME.pid" fi
pid=""
- Resolve the location of the 'ps' command
PSEXE="/usr/bin/ps" if [ ! -x $PSEXE ] then
PSEXE="/bin/ps" if [ ! -x $PSEXE ] then echo "Unable to locate 'ps'." echo "Please report this with the location on your system." exit 1 fi
fi
- Build the nice clause
if [ "X$PRIORITY" = "X" ] then
CMDNICE=""
else
CMDNICE="nice -$PRIORITY"
fi
getpid() {
if [ -f $PIDFILE ] then if [ -r $PIDFILE ] then pid=`cat $PIDFILE` if [ "X$pid" != "X" ] then # Verify that a process with this pid is still running. pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '/^.+$/{s = $1} END{print s}'` if [ "X$pid" = "X" ] then # This is a stale pid file. rm -f $PIDFILE echo "Removed stale pid file: $PIDFILE" fi fi else echo "Cannot read $PIDFILE." exit 1 fi fi
}
testpid() {
pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '/^.+$/{s = $1} END{print s}'` if [ "X$pid" = "X" ] then # Process is gone so remove the pid file. rm -f $PIDFILE fi
}
console() {
echo "Running $APP_LONG_NAME..." unix_version getpid if [ "X$pid" = "X" ] then exec $CMDNICE $WRAPPER_CMD $WRAPPER_CONF wrapper.pidfile=$PIDFILE else echo "$APP_LONG_NAME is already running." exit 1 fi
}
unix_version() {
- This section defines machine dependent variables.
SUPPORTED_ARCHS="solaris hpux aix linux" RH_DISTRO=0 SU_DISTRO=0
# These variables are set to default values OS_BITS=32 LIB_DIR=lib ARCH=unknown HT_UPDATE_RCFILE=replace HAS_ECOSYS=0 NEW_AGT=n EXISTING_AGT=necho
tmpVAR=`uname -a` HOST=`echo ${tmpVAR} | awk '{print $2}'` ARCH=`echo ${tmpVAR} | awk '{print $1}'` OS_NAME=`echo ${tmpVAR} | awk '{print $1}'` OS_REL=`echo ${tmpVAR} | awk '{print $3}'` OS_VER=`echo ${OS_REL} | awk -F. '{print $2}'` CUR_OS_MODE=32
# determine the ARCH and OS_BITS variables case $ARCH in Linux) # Linux DISTRO=`cat /proc/version` DISTRO_CK=`egrep -c -e "Red Hat" /proc/version` if [ "$DISTRO_CK" = 0 ]; then DISTRO_CK=`egrep -c -e "SuSE" /proc/version` if [ "$DISTRO_CK" = 0 ]; then echo "Unsupported Linux distribution: " |tee -a $DBGFILE echo "$DISTRO" |tee -a $DBGFILE echo "Aborting installation!" |tee -a $DBGFILE exit 1 else SU_DISTRO=1 fi else RH_DISTRO=1 fi echo "Attempting install on $DISTRO" |tee -a $DBGFILE #OS_BITS=`file /proc/kcore | cut -d" " -f3 | cut -d"-" -f1` # Get OS Bitness (Lame!!!!) OS_BITS="32" OS_MAJOR=`echo ${OS_REL} | awk -F. '{print $1}'` ## Get Major Version OS_MINOR=`echo ${OS_REL} | awk -F. '{print $2}'` ## Get Minor Version OS_PATCH_T=`echo ${OS_REL} | awk -F. '{print $3}'` ## Get Patch Version OS_PATCH=`echo ${OS_PATCH_T} | sed 's/-/ /' | awk '{print $1}'` ## Get Patch Version if [ $OS_MAJOR -lt 2 ]; then echo "Product is currently tested with only kernel version 2 and above" |tee -a $DBGFILE cleanup elif [ $OS_MAJOR -eq 2 -a "$OS_MINOR" -lt 4 ]; then echo "Product is currently tested with only kernel version 2.4 and above" |tee -a $DBGFILE cleanup elif [ $OS_MAJOR -eq 2 -a "$OS_MINOR" -eq 4 -a $OS_PATCH -lt 20 ]; then echo "Product is currently tested with only kernel version 2.4.20 and above" |tee -a $DBGFILE cleanup else HAS_ECOSYS=0 ARCH=linux ARCH_NAME=Linux fi
# Check for glibc and net-snmp GLIBC_VERSION=`rpm -qa | grep -i "^glibc-[0-9]" | cut -d"-" -f2` GLIBC_NUMBER=`echo $GLIBC_VERSION|awk -F"." '{print $1*1000 + $2*100 +$3}'` if [ $GLIBC_NUMBER -lt 2302 ]; then
echo "Your glibc version is $GLIBC_VERSION" | tee -a $DBGFILE
echo "glibc versions less than 2.3.2 are not supported." |tee -a $DBGFILE cleanup fi if [ "`rpm -qa | grep -i "net-snmp"`" = "" ]; then echo "The rpm for net-snmp was not installed on this system." |tee -a $DBGFILE cleanup fi
;;
SunOS) # SunOS if [ "$OS_NAME" = SunOS -a "$OS_VER" -ge 5 ]; then HAS_ECOSYS=1 ARCH=solaris ARCH_NAME=Solaris32 if [ "$OS_VER" -ge 7 ]; then OS_BITS=`isainfo -b` fi fi case $OS_BITS in
32)
ARCH_NAME=Solaris32 ;;
64)
ARCH_NAME=Solaris64
;; esac
;;
HP-UX) # HP-UX if [ "$OS_NAME" = HP-UX -a "$OS_VER" -ge 10 ]; then # change this line if 10.X is not supported! HAS_ECOSYS=1 ARCH=hpux ARCH_NAME=HPUX32 if [ "$OS_VER" -ge 11 ]; then OS_BITS=`getconf KERNEL_BITS` OS_MINOR_VER=`uname -r | awk -F. '{print $3}'` if [ "$OS_MINOR_VER" -ge 11 ]; then ## test for HPUX11i OS_VER=$OS_VER"."$OS_MINOR_VER fi fi case $OS_BITS in
32)
ARCH_NAME=HPUX32 ;;
64)
ARCH_NAME=HPUX64
;; esac
fi ;;
AIX) # AIX if [ "$OS_NAME" = AIX ]; then HAS_ECOSYS=1 ARCH=aix ARCH_NAME=AIX os_ver=`uname -v` os_rel=`uname -r` OS_VER=`echo $os_ver.$os_rel` fi ;; unknown) # the second test checks for an ARCH that this script supports, # but that is not yet a supported ARCH if [ "$ARCH" = unknown -o "`echo "$SUPPORTED_ARCHS" | grep "$ARCH"`" = "" ]; then echo echo "ERROR: `uname -s` `uname -r` is not supported." echo "CAUSE: The machine architectures and operating systems that $SV_DISPLAYNAME supports " echo " are listed in the $SV_DISPLAYNAME Installation Guide. Check to make sure your " echo " machine and operating system are among those listed." echo "RESOLUTION: Contact $SV_DISPLAYNAME Technical Support." cleanup fi ;; esac
- Resolve the architecture
DIST_ARCH=`uname -p | tr [:upper:] [:lower:] | tr -d [:blank:]` if [ "$DIST_ARCH" = "unknown" ] then
DIST_ARCH=`uname -m | tr [:upper:] [:lower:] | tr -d [:blank:]`
fi case "$DIST_ARCH" in
'amd64' | 'athlon' | 'ia32' | 'ia64' | 'i386' | 'i486' | 'i586' | 'i686' | 'x86_64') DIST_ARCH="x86" ;; 'ip27') DIST_ARCH="mips" ;; 'power' | 'powerpc' | 'power_pc' | 'ppc64') DIST_ARCH="ppc" ;; 'pa_risc' | 'pa-risc') DIST_ARCH="parisc" ;; 'sun4u' | 'sparcv9') DIST_ARCH="sparc" ;; '9000/800') DIST_ARCH="parisc" ;;
esac
- fix the wrapper command
WRAPPER_CMD="$WRAPPER_CMD-$ARCH-$DIST_ARCH-$OS_BITS" } install() {
echo "Install $APP_LONG_NAME" #..."
case $ARCH_NAME in
Linux)
- add init link for cos shell script
ln -fs $REALPATH /etc/init.d/cos
- add kill links for daemon mode
ln -s /etc/init.d/cos /etc/rc.d/rc0.d/K34cos ln -s /etc/init.d/cos /etc/rc.d/rc1.d/K34cos ln -s /etc/init.d/cos /etc/rc.d/rc2.d/K34cos ln -s /etc/init.d/cos /etc/rc.d/rc6.d/K34cos
- add start links for daemon mode
ln -s /etc/init.d/cos /etc/rc.d/rc3.d/S92cos ln -s /etc/init.d/cos /etc/rc.d/rc4.d/S92cos ln -s /etc/init.d/cos /etc/rc.d/rc5.d/S92cos
Solaris32)
- add init link for cos shell script
ln -fs $REALPATH /etc/init.d/cos
- add kill links for daemon mode
ln -s /etc/init.d/cos /etc/rcS.d/K34cos ln -s /etc/init.d/cos /etc/rc0.d/K34cos ln -s /etc/init.d/cos /etc/rc1.d/K34cos
- add start links for daemon mode
ln -s /etc/init.d/cos /etc/rc2.d/S92cos
Solaris64)
- add init link for cos shell script
ln -fs $REALPATH /etc/init.d/cos
- add kill links for daemon mode
ln -s /etc/init.d/cos /etc/rcS.d/K34cos ln -s /etc/init.d/cos /etc/rc0.d/K34cos ln -s /etc/init.d/cos /etc/rc1.d/K34cos
- add start links for daemon mode
ln -s /etc/init.d/cos /etc/rc2.d/S92cos
HPUX32)
- add init link for cos shell script
ln -fs $REALPATH /sbin/init.d/cos
- add kill links for daemon mode
ln -s /sbin/init.d/cos /sbin/rc1.d/K92cos
- add start links for daemon mode
ln -s /sbin/init.d/cos /sbin/rc2.d/S92cos
HPUX64)
- add init link for cos shell script
ln -fs $REALPATH /sbin/init.d/cos
- add kill links for daemon mode
ln -s /sbin/init.d/cos /sbin/rc1.d/K34cos
- add start links for daemon mode
ln -s /sbin/init.d/cos /sbin/rc2.d/S92cos
AIX)
- add init link for cos shell script
ln -fs $REALPATH /etc/rc.d/init.d/cos
- add kill links for daemon mode
ln -s /etc/rc.d/init.d/cos /etc/rc.d/rc2.d/K34cos
- add start links for daemon mode
ln -s /etc/rc.d/init.d/cos /etc/rc.d/rc2.d/S92cos
esac
}
uninstall() {
echo "Uninstall $APP_LONG_NAME" #...on $ARCH_NAME"
case $ARCH_NAME in
Linux)
- remove kill links for daemon mode
rm /etc/rc.d/rc0.d/K34cos rm /etc/rc.d/rc1.d/K34cos rm /etc/rc.d/rc2.d/K34cos rm /etc/rc.d/rc6.d/K34cos
- remove start links for daemon mode
rm /etc/rc.d/rc3.d/S92cos rm /etc/rc.d/rc4.d/S92cos rm /etc/rc.d/rc5.d/S92cos
- remove script link for daemon mode
rm /etc/init.d/cos
Solaris32)
- remove kill links for daemon mode
rm /etc/rcS.d/K34cos rm /etc/rc0.d/K34cos rm /etc/rc1.d/K34cos
- remove start links for daemon mode
rm /etc/rc2.d/S92cos
- remove script link for daemon mode
rm /etc/init.d/cos
Solaris64)
- remove kill links for daemon mode
rm /etc/rcS.d/K34cos rm /etc/rc0.d/K34cos rm /etc/rc1.d/K34cos
- remove start links for daemon mode
rm /etc/rc2.d/S92cos
- remove script link for daemon mode
rm /etc/init.d/cos
HPUX32)
- remove kill links for daemon mode
rm /sbin/rc1.d/K92cos
- remove start links for daemon mode
rm /sbin/rc2.d/S92cos
- remove script link for daemon mode
rm /sbin/init.d/cos
HPUX64)
- remove kill links for daemon mode
rm /sbin/rc1.d/K92cos
- remove start links for daemon mode
rm /sbin/rc2.d/S92cos
- remove script link for daemon mode
rm /sbin/init.d/cos
AIX)
- remove kill links for daemon mode
rm /etc/rc.d/rc2.d/K34cos
- remove start links for daemon mode
rm /ect/rc.d/rc2.d/S92cos
- remove script link for daemon mode
rm /etc/rc.d/init.d/cos
esac
}
startConsole() {
DAEMON_WRAPPER=wrapper.daemonize=FALSE export DAEMON_WRAPPER
startCWJBoss
}
startDaemon(){
DAEMON_WRAPPER=wrapper.daemonize=TRUE export DAEMON_WRAPPER
startCWJBoss
}
startCWJBoss() {
echo "Starting $APP_LONG_NAME..." unix_version getpid
- echo DAEMON_WRAPPER=$DAEMON_WRAPPER
if [ "X$pid" = "X" ] then
- echo Starting
echo WRAPPER_CMD=$WRAPPER_CMD echo WRAPPER_CONF=$WRAPPER_CONF echo wrapper.java.command=$CWJAVA_HOME/bin/java
- echo wrapper.java.classpath.2=$CWJAVA_HOME/lib/tools.jar
- echo wrapper.java.library.path.1=$JBOSS_HOME/bin
- echo wrapper.java.classpath.3=$JBOSS_HOME/bin/run.jar
- echo wrapper.java.classpath.1=$JBOSS_HOME/lib/CWJBossSrv.jar
- echo wrapper.logfile=$JBOSS_HOME/server/$SERVER_NAME/log/CWJBossSrv.log
#AIX does not support hotspot if [ "$OS_NAME" = AIX ]; then #no hot spot, set wrapper.java.additional.1= exec $CMDNICE $WRAPPER_CMD $WRAPPER_CONF "wrapper.java.command=$CWJAVA_HOME/bin/java" "wrapper.java.library.path.1=$JBOSS_HOME/bin/lib" "wrapper.java.classpath.1=$JBOSS_HOME/bin/lib/wrapper.jar" "wrapper.java.classpath.2=$CWJAVA_HOME/lib/tools.jar" "wrapper.java.classpath.3=$JBOSS_HOME/plugins/$EQUINOX_SYS.jar" "wrapper.java.classpath.4=$JBOSS_HOME/bin/lib/cos-main.jar" wrapper.java.additional.3= "wrapper.java.additional.1=-Dosgi.framework=$JBOSS_HOME/plugins/$EQUINOX_SYS.jar" "wrapper.java.additional.2=-Dosgi.install.area=$JBOSS_HOME" "wrapper.pidfile=$PIDFILE" "$DAEMON_WRAPPER" else exec $CMDNICE $WRAPPER_CMD $WRAPPER_CONF "wrapper.java.command=$CWJAVA_HOME/bin/java" "wrapper.java.library.path.1=$JBOSS_HOME/bin/lib" "wrapper.java.classpath.1=$JBOSS_HOME/bin/lib/wrapper.jar" "wrapper.java.classpath.2=$CWJAVA_HOME/lib/tools.jar" "wrapper.java.classpath.3=$JBOSS_HOME/plugins/$EQUINOX_SYS.jar" "wrapper.java.classpath.4=$JBOSS_HOME/bin/lib/cos-main.jar" "wrapper.java.additional.1=-Dosgi.framework=$JBOSS_HOME/plugins/$EQUINOX_SYS.jar" "wrapper.java.additional.2=-Dosgi.install.area=$JBOSS_HOME" "wrapper.pidfile=$PIDFILE" "$DAEMON_WRAPPER" fi
else echo "$APP_LONG_NAME is already running." exit 1 fi
}
stopit() {
echo "Stopping $APP_LONG_NAME..." getpid if [ "X$pid" = "X" ] then echo "$APP_LONG_NAME was not running." else # Running so try to stop it. kill $pid if [ $? -ne 0 ] then # An explanation for the failure should have been given echo "Unable to stop $APP_LONG_NAME." exit 1 fi
# We can not predict how long it will take for the wrapper to # actually stop as it depends on settings in wrapper.conf. # Loop until it does. savepid=$pid CNT=0 TOTCNT=0 while [ "X$pid" != "X" ] do # Loop for up to 5 minutes if [ "$TOTCNT" -lt "300" ] then if [ "$CNT" -lt "5" ] then CNT=`expr $CNT + 1` else echo "Waiting for $APP_LONG_NAME to exit..." CNT=0 fi TOTCNT=`expr $TOTCNT + 1`
sleep 1
testpid else pid= fi done
pid=$savepid testpid if [ "X$pid" != "X" ] then echo "Timed out waiting for $APP_LONG_NAME to exit." echo " Attempting a forced exit..." kill -9 $pid fi
pid=$savepid testpid if [ "X$pid" != "X" ] then echo "Failed to stop $APP_LONG_NAME." exit 1 else echo "Stopped $APP_LONG_NAME." fi fi
}
addtest() {
echo "addtest" cp -r $JBOSS_HOME/test $JBOSS_HOME/server/$SERVER_NAME/data/CWJBoss/admin/Test
}
removetest() {
echo "removetest" rm -r $JBOSS_HOME/server/$SERVER_NAME/data/CWJBoss/admin/Test
}
support() {
echo "support"
JBOSS_SUPPORT_CLASSPATH=$JBOSS_HOME/server/$SERVER_NAME/data/CWJBoss/admin/Server/CWJBossSupport:$JBOSS_HOME/server/$SERVER_NAME/lib/CWJBossAdmin.jar:$JBOSS_HOME/server/$SERVER_NAME/lib/log4j.jar:$JBOSS_HOME/server/$SERVER_NAME/lib/CWUtil.jar:$JBOSS_HOME/lib/jboss-jmx.jar export JBOSS_SUPPORT_CLASSPATH
- echo $JBOSS_SUPPORT_CLASSPATH
JAVA_OPTS=-Djboss.server.home.dir=$JBOSS_HOME/server/$SERVER_NAME export JAVA_OPTS
if [ "X$1" = "X" ] then if [ -d '/tmp' ] then
- if ! [ -d '/tmp/CWSupport' ]
if [ ! -d '/tmp/CWSupport' ] then mkdir /tmp/CWSupport fi JBOSS_SUPPORT_DIR_LOCATION=/tmp/CWSupport
- export JBOSS_SUPPORT_DIR_LOCATION
else JBOSS_SUPPORT_DIR_LOCATION=/opt/Compuware/CWJBoss/server/$SERVER_NAME/log
- export JBOSS_SUPPORT_DIR_LOCATION
fi else if [ -d $1 ] then JBOSS_SUPPORT_DIR_LOCATION=$1
- export JBOSS_SUPPORT_DIR_LOCATION
else
- if ! [ -d $1 ]
if [ ! -d $1 ] then mkdir $1 fi JBOSS_SUPPORT_DIR_LOCATION=$1
- export JBOSS_SUPPORT_DIR_LOCATION
fi fi
export JBOSS_SUPPORT_DIR_LOCATION
java $JAVA_OPTS -classpath $JBOSS_SUPPORT_CLASSPATH com.compuware.jboss.admin.support.CWSupportAction $JBOSS_SUPPORT_DIR_LOCATION $JBOSS_HOME/server/$SERVER_NAME/data
echo "The support package is located in this directory: $JBOSS_SUPPORT_DIR_LOCATION"
}
status() {
getpid if [ "X$pid" = "X" ] then echo "$APP_LONG_NAME is not running." exit 1 else echo "$APP_LONG_NAME is running ($pid)." exit 0 fi
}
dump() {
echo "Dumping $APP_LONG_NAME..." getpid if [ "X$pid" = "X" ] then echo "$APP_LONG_NAME was not running."
else kill -3 $pid
if [ $? -ne 0 ] then echo "Failed to dump $APP_LONG_NAME." exit 1 else echo "Dumped $APP_LONG_NAME." fi fi
}
resetmq() { $JAVA_HOME/bin/java -jar $CWJBOSS_HOME/client/MqDoctor.jar -deletemsg -all $JAVA_HOME/bin/java -jar $CWJBOSS_HOME/client/MqDoctor.jar -deletedurasub -all }
openlog() {
echo "Open Log for $APP_LONG_NAME..." more $JBOSS_HOME/server/$SERVER_NAME/log/server.log
}
get_unix_distribution(){
if [ -f '/etc/redhat-release' ] then echo "redhat" fi
}
case "$1" in
'install') unix_version echo "Compuware Open Server"
- on '$ARCH_NAME'."
install ;;
'uninstall') unix_version echo "Compuware Open Server" uninstall ;;
'start') startDaemon ;;
'start_msg') echo "Compuware Open Server daemon is starting." ;;
'stop') stopit ;;
'stop_msg') echo "Compuware Open Server daemon is stopping." ;;
- 'console')
'run') startConsole ;;
'restart') stopit start ;;
'log') openlog ;;
'addtest') addtest ;;
'removetest') removetest ;;
'support') support $2 ;;
'status') status ;;
'dump') dump ;;
'resetmq') resetmq ;;
- test code remove
'version') unix_version ;;
*) echo "==========================================================================================" echo "= ="
- echo "= Usage: $0 { install | uninstall | start | stop | run | log | restart | status | dump } ="
echo "= Usage: $0 { start | stop | run | log | restart | status | dump | resetmq } ="
- echo "= install option is used to install COS daemon and start it ="
- echo "= uninstall option is used to stop and remove the COS daemon ="
echo "= start option is used to start COS daemon, it must be installed =" echo "= stop option is used to stop does not remove the COS service =" echo "= run option is used to start COS in a console =" echo "= log option is used to display log using more =" echo "= addtest option is used to deploy test components into COS =" echo "= removetest option is used to un-deploy test component in COS =" echo "= support option is used to create a zip file with config info for review =" echo "= resetmq unsubscribe all durable subscribers except =" echo "= CWMRMsgLogger, also clear all messages =" echo "= =" echo "= Copyright 2003-2004, Compuware Corporation =" echo "==========================================================================================" exit 1 ;;
esac
exit 0