On 16 February 2010 13:19, Evans, Kevin <[email protected]> wrote:
> Can someone point me to a good Unix script to auto start handle(s) after a
> Tomcat reboot?
Gary Brown posted this a while ago ... I don't *think* I've made any
modifications to his original. Anyway, this works well for me on
Ubuntu Linux, so it may be worth adding to the wiki:
#!/bin/sh
#
# description: Starts and stops the handle service
#
start() {
KIND="handle"
su - dspace -c /dspace/bin/start-handle-server 2>&1 > /dev/null
RETVAL=$?
echo -n $"Starting $KIND services: "
return $RETVAL
}
stop() {
echo "Stopping handle server..."
PID=`/bin/ps -ef | grep java | grep log4j-handle | grep -v
'grep' | awk '{print $2}'`
if [ ! -z "$PID" ] ; then
for process in ${PID}
do
/bin/kill $process
echo "Killed process $process"
done
fi
}
restart() {
stop
start
}
status() {
PID=`/bin/ps -ef | grep java | grep log4j-handle | grep -v
'grep' | awk '{print $2}'`
if [ ! -z "$PID" ] ; then
echo "Handle server service is running (PID $PID)."
else
echo "Handle server service is stopped."
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
status)
status
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
exit 1
esac
exit $?
--
Sean Carte
esAL Library Systems Manager
+27 72 898 8775
+27 31 373 2490
fax: 0866741254
http://esal.dut.ac.za/
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech