On dc 09 mai 2012 14:43:16 CEST, Mark H. Wood wrote:
[...]
If anyone has a good Red Hat script, I'm sure it would be appreciated.


Hi,

The attached script is the one I use for CentOS/Fedora. The path to the start-handle-server script is hard-coded though.

Cheers,
Àlex
#!/bin/sh
#
# chkconfig: 345 86 14
# description: Handle server for DSpace.
#
### BEGIN INIT INFO
# Required-Start: httpd
# Short-Description: Handle server.
# Description: Handle server for DSpace.
### END INIT INFO

# Source function library.
. /etc/rc.d/init.d/functions

start() {
        echo -n $"Starting Handle server services: "
        su --shell=/bin/bash - tomcat -c \
                /usr/local/dspace/bin/start-handle-server 2>&1 > /dev/null && 
success || failure
        RETVAL=$?
        echo ""
        return $RETVAL
}

stop() {
        echo "Stopping handle server..."
        PID=`/bin/ps ax | grep "net.handle.server.Main" | grep -v 'grep' | awk 
'{print $1}'`
        if [ ! -z "$PID" ] ; then
                for process in ${PID}
                do
                        /bin/kill $process
                echo "Killed process $process"
                done && success || failure
        fi
        echo ""
}

status() {
        PID=`/bin/ps ax | grep "net.handle.server.Main" | grep -v 'grep' | awk 
'{print $1}'`
        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)
                stop
                start
                ;;
        status)
                status
                ;;
        *)
                echo $"Usage: $0 {start|stop|restart|status}"
                exit 1
esac
exit $?
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to