That looks pretty straightforward.
My only other question is the openbdjam has paramters I have to key in
console.
/opt/openbdjam/openbdjam start (to start it)
&
/opt/openbdjam/openbdjam stop (to stop it)
How would I configure the script file to handle this?
Would it be like?
#!/bin/bash
#
# Init file for OpenBDJam server
#
# chkconfig: 2345 55 25
# description: OpenBDJam server
#
# Source function library.
. /etc/init.d/functions
RUN_AS_USER=root # Adjust run user here
OPENBDJAM_HOME=/opt/openbdjam
start() {
echo "Starting OpenBDJam: "
if [ "x$USER" != "x$RUN_AS_USER" ]; then
su - $RUN_AS_USER -c "$OPENBDJAM_HOME/openbdjam start"
else
$OPENBDJAM_HOME/openbdjam start
fi
echo "done."
}
stop() {
echo "Shutting down OpenBDJam: "
if [ "x$USER" != "x$RUN_AS_USER" ]; then
su - $RUN_AS_USER -c "$OPENBDJAM_HOME/openbdjam stop"
else
$OPENBDJAM_HOME/openbdjam stop
fi
echo "done."
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
sleep 10
#echo "Hard killing any remaining threads.."
#kill -9 `cat $OPENBDJAM_HOME/work/catalina.pid`
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
esac
exit 0
On Dec 6, 7:11 pm, Matthew Woodward <[email protected]> wrote:
> On Mon, Dec 6, 2010 at 4:06 PM, Mike Slizewski <[email protected]> wrote:
> > I am running CentOS and was wondering how to configure OpenBDJam to
> > start on boot. I have it configured and it is running if I manually
> > start it, but I would like to have it start on boot.
>
> I haven't used OpenBDJAM specifically but basically you just need to write a
> little script that you put in /etc/init.d and then either add symlinks to
> the appropriate additional runlevel directories or use chkconfig to handle
> that piece of things.
>
> If you go to this
> page:http://wiki.openbluedragon.org/wiki/index.php/Apache_Tomcat_on_CentOS...
>
> Then scroll down to "Configure Tomcat to run on startup," that would be the
> gist of what you have to do. The specific command will just differ.
>
> Let me know if you need help getting this rolling.
>
> --
> Matthew Woodward
> [email protected]http://blog.mattwoodward.com
> identi.ca / Twitter: @mpwoodward
>
> Please do not send me proprietary file formats such as Word, PowerPoint,
> etc. as attachments.http://www.gnu.org/philosophy/no-word-attachments.html
--
Open BlueDragon Public Mailing List
http://www.openbluedragon.org/ http://twitter.com/OpenBlueDragon
official manual: http://www.openbluedragon.org/manual/
Ready2Run CFML http://www.openbluedragon.org/openbdjam/
mailing list - http://groups.google.com/group/openbd?hl=en