Hi all,
Here's another one thrown into the mix for good measure. Been used on RHEL
(4,5,6) for the last 7 years or so. Probably not the most elegant, but it works.
Cheers,
Gary
> -----Original Message-----
> From: Christian Völker [mailto:[email protected]]
> Sent: Wednesday, 9 May 2012 7:14 AM
> To: dspace-tech Tech
> Subject: [Dspace-tech] handle server init script anybody?
>
> Hello,
>
> I just moved our DSpace to a new machine. This ment moving from Debian
> etch to squeeze. And I believe a server is not completely configured if
> I cant run shutdown -r now without all services coming up again in an
> orderly fashion.
>
> For tomcat and postgres, this is out of the box functionality on any
> decent distribution, but not so for the handle server. CNRI does not
> deliver something useful for this purpose together with their software
> and well, if you read their docs, then say clearly, this software is
> not ment to be ready to run, so I am on my own.
>
> On my old machine I had tweaked something resembling an init script,
> called it handled and placed it in /etc/init.d/. It worked for several
> years. When I copied it to the new machine it ceased working. No real
> wonder, blame me a conman if I call myself an admin, but I admit I am
> not good at coding and not even at writing simple shell scripts. It
> happens to rarely that I have to do it in my everyday work, so it is a
> real teadious task for me.
>
> If youd ask me what exactly I did in the old script, well basically I
> called start-handle-server as the tomcat unix user when run with start
> as argument. As the official way to stop the handle server is to find
> out the process id and kill it, I just forgot about it and made stop be
> an empty method. Reload was the same as start which probably would not
> do its job but I did not care. Thats all.
> It had a description section at the start which made it possible to run
> update-rc.d handled default, which is the usual way to create the
> appropriate links within all rc?.d folders on debian. Quick and dirty
> you might call that but it did exactly what I was looking for.
>
> Now, my question is, am I the only one who is looking for something
> like this? Am I the only one who thinks it is a weird thing to invent
> it myself because there are probably so many more out there who had to
> solve the same issue before? What is your solution, everybody?
>
> Thanks for answers, thanks for posting a ready made init script, that
> safes me the headaches from fiddling myself with #!/bin/sh.
>
> Bye, Christian
>
> PS: Is the use of version 7.0 of handle.jar endorsed or may I stay with
> version 6.2 and still feel like a pro?
> -----------------------------------------------------------------------
> -------
> 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
#!/bin/sh
#
# chkconfig: 345 86 14
# description: Starts and stops the handle service
#
# Source function library.
if [ -f /etc/init.d/functions ] ; then
. /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ] ; then
. /etc/rc.d/init.d/functions
else
exit 0
fi
start() {
KIND="handle"
su - dspace -c /data/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 $?
------------------------------------------------------------------------------
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