PDA

View Full Version : Demo run at boot?



amccollough
03-16-2006, 01:21 PM
First off, I'm no linux admin genius.

I'm running Fedora Core 3.

I do now have pentaho-demo up and running. It looks great!

What I would like to do is have it run automatically when the server boots.


I have created a /etc/rc.d/init.d/pentaho file, which is basically doing this:


echo -n $"Starting pentaho..."
. /etc/profile.d/java.sh
cd /opt/pentaho-demo
. start-pentaho.sh &

I was hoping the "&" would make it run in the background. It doesn't work on boot.

I'm sure this is easy to do, I'm just missing the obvious. What is the recommended way to launch pentaho from boot?

bpfonte
03-20-2006, 02:02 AM
Hi,

Try redirecting to /dev/null:
. start-pentaho > /dev/null &

--
Bruno

amccollough
03-20-2006, 09:41 AM
That worked perfectly, thank you!

adam_thomas
03-22-2006, 09:30 PM
Here is the init script I wrote for our RH AS4 but which is running the demo


cat /etc/init.d//pentaho-demo
#!/bin/sh
#
# Startup script for pentaho-demo
#
# chkconfig: 345 STARTORDER STOPORDER
# description:
# processname: pentaho-demo
# pidfile: /var/run/pentaho-demo.pid


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

JAVA_HOME=/usr/java/j2sdk1.4.2_11/
PATH=$PATH:$JAVA_HOME/bin
PENTAHO_HOME=/opt/pentaho-demo

cd $PENTAHO_HOME

# See how we were called.
case "$1" in
start)
echo -n "Starting pentaho-demo: "
echo "Starting pentaho-demo `date`" >> /var/log/pentaho-demo.log
./start-pentaho.sh >> /var/log/pentaho-demo.log &
echo
touch /var/lock/subsys/pentaho-demo
;;
stop)
echo -n "Shutting down pentaho-demo: "
echo "Shutting down pentaho-demo `date`" >> /var/log/pentaho-demo.log
./stop-pentaho.sh >> /var/log/pentaho-demo.log &
echo
rm -f /var/lock/subsys/pentaho-demo
rm -f /var/run/pentaho-demo.pid
;;
status)
status pentaho-demo
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
esac

exit 0


It's based off a template I found somewhere.

adam_thomas
03-23-2006, 07:28 PM
I've made a few little changes since posting that



JAVA_HOME=/usr/java/j2sdk1.4.2_11/
PATH=$PATH:$JAVA_HOME/bin
PENTAHO_HOME=/opt/pentaho-demo
DISPLAY=localhost:0.0

export JAVA_HOME DISPLAY
cd $PENTAHO_HOME


For some bizare reason the dedicated server platform needs a running X11 server. Go figure.

The other thing was I removed the & after the ./stop-pentaho.sh line and removed the redirection because stoping the server takes a lot less time than starting it and the logging isn't very usefull.

Starting and stopping the database server evertime pentaho is started or stoped is a bit much so I will eventually split this into two scripts, one that start/stops the DB and one that starts/stops the BI platform.

pb2574
01-10-2007, 12:49 PM
And for windows which is the procedure?