devalone 2013-06-09
启停weblogic脚本
#!/bin/bash
#
#chkconfig: 35 99 01
#
#description:weblogic
#
# A startup script for the Oracle Middleware Weblogic Server 12.1
#
# description: This script is used to start the weblogic server as a background process.
#
# Usage /etc/init.d/weblogic start|stop
DATE=`date +%F`
WEBLOGIC_USER=root
WEBLOGIC_BASE=/home/weblogic/user_projects/domains/EkpDev_Domain
start() {
echo -n $"Starting WebLogic... "
su $WEBLOGIC_USER -c "nohup $WEBLOGIC_BASE/bin/startWebLogic.sh >> $WEBLOGIC_BASE/logs/startWebLogic.log.${DATE} 2>&1 &"
RETVAL=$?
echo done
[ $RETVAL -eq 0 ]
#touch /var/lock/subsys/weblogic;
return $RETVAL
}
stop() {
echo -n $"Stopping WebLogic..."
su $WEBLOGIC_USER "$WEBLOGIC_BASE/bin/stopWebLogic.sh"
RETVAL=$?
echo
[ $RETVAL -eq 0 ]
#rm -f /var/lock/subsys/weblogic;
return $RETVAL
}
restart() {
stop
start
}
reload() {
echo -n $"Reloading cron daemon configuration: "
killproc crond -HUP
RETVAL=$?
echo
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
reload)
reload
;;
status)
#rhstatus
;;
condrestart)
[ restart || :
;;
*)
echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}"
exit 1
esac
============================
启停nodemanager脚本
#!/bin/bash
#
#chkconfig: 35 99 01
#
#description:nodemanager
#
# A startup script for the Oracle Middleware Weblogic Server 12.1
#
# description: This script is used to start the weblogic nodemanager as a background process.
#
# Usage /etc/init.d/nodemanager start|stop
DATE=`date +%F`
NODEMANAGER_USER=root
NODEMANAGER_BASE=/home/weblogic/wlserver_12.1/server/bin
WEBLOGIC_BASE=/home/weblogic/user_projects/domains/EkpDev_Domain
start() {
echo -n $"Starting NodeManager... "
su $NODEMANAGER_USER -c "nohup $NODEMANAGER_BASE/startNodeManager.sh >> $WEBLOGIC_BASE/logs/startNodeManager.log.${DATE} 2>&1 &"
RETVAL=$?
echo done
[ $RETVAL -eq 0 ]
#touch /var/lock/subsys/nodemanager;
return $RETVAL
}
stop() {
echo -n $"Stopping NodeManager..."
su $NODEMANAGER_USER -c "kill $(ps -ef|awk '/weblogic.NodeManager/{print $2;exit}')"
RETVAL=$?
echo
[ $RETVAL -eq 0 ]
#rm -f /var/lock/subsys/nodemanager;
return $RETVAL
}
restart() {
stop
start
}
reload() {
echo -n $"Reloading cron daemon configuration: "
killproc crond -HUP
RETVAL=$?
echo
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
reload)
reload
;;
status)
#rhstatus
;;
condrestart)
[ restart || :
;;
*)
echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}"
exit 1
esac