eis/config/baosight

62 lines
1.8 KiB
Bash

#!/bin/bash
#
# Run-level Startup script for the baosight db2 instance and dsc
#
# chkconfig: 345 91 19
# description: Startup/Shutdown baosight db2 instance and dsc
DB2_HOME="/opt/ibm/db2/V9.7/"
DB2_OWNR="db2inst1"
APP_HOME="/users/dsc/"
APP_OWNR="dsc"
DB2_NAME="appdb"
# depending on parameter -- startup, shutdown, restart
# of the instance and listener or usage display
case "$1" in
start)
echo "---start---"
# db2 instance startup
#echo -n "Starting db2: "
#su - $DB2_OWNR -c db2start
#su - $DB2_OWNR -c "db2 activate database $DB2_NAME"
#touch $DB2_HOME/logs
#dsc startup
su - $APP_OWNR -c "/iPlature/bin/iPlatureAdmin start"
su - $APP_OWNR -c "/iXComPCS/Bin/Boot_run"
su - $APP_OWNR -c "/opt/memcached/bin/memcached -d -m 1024 -p 11211 -v >> /users/dsc/log/memcached.log 2>&1"
#./opt/apache-activemq-5.15.8/bin/activemq start&
su - $APP_OWNR -c "nohup java -jar $APP_HOME/rest/dc-rest-0.0.1.jar &"
su - $APP_OWNR -c "nohup java -jar $APP_HOME/websock/dc-websocket-0.1.0.jar &"
echo "OK"
;;
stop)
#dsc stopup
echo "---stop---"
su - $APP_OWNR -c "/iXComPCS/Bin/Boot_down"
su - $APP_OWNR -c "/iPlature/bin/iPlatureAdmin stop"
#./opt/apache-activemq-5.15.8/bin/activemq stop&
kill -9 `ps aux|grep rest|grep java|grep dsc|awk '{print $2}'`
kill -9 `ps aux|grep websocket|grep java|grep dsc|awk '{print $2}'`
# db2 instance shutdown
#echo -n "Shutdown db2: "
#su - $DB2_OWNR -c "db2 force dsclication all"
#su - $DB2_OWNR -c db2stop
#rm -f $DB2_HOME/logs
echo "OK"
;;
reload|restart)
echo "---restart---"
$0 stop
$0 start
;;
*)
echo "Usage: $0 start|stop|restart|reload"
exit 1
esac
exit 0