Wednesday, August 5, 2015

How to start Pentaho server at boot time on Linux server

Hi Friends,

In this post, I would like to give you details on how we start pentaho server at boot time on linux server.

Generally we have two scripts available under below path:

                            installation_directory/pentaho/server/biserver-ee  

start-pentaho.sh & stop-pentaho.sh

How ever we also can start pentaho server through another script called ctlscript.sh which is available in the below path:

                                     installation_directory/pentaho

Now we will see how to start pentaho server at boot time.
STEP1:
Login as a root user and create a init script in the path:  /etc/rc.d/init.d  and give any name to it. In my case I have assigned a name to init script as "pentaho"

STEP2:
Include the below code in the created file to start the server at boot time and to stop the server at OS shut down time.


#!/bin/sh
### BEGIN INIT INFO
# Provides: start-pentaho stop-pentaho
# Required-Start: networking postgresql
# Required-Stop: postgresql
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Pentaho BA Server
### END INIT INFO

case "$1" in
"start")
su - root -c "cd /opt/Pentaho/ && ./ctlscript.sh start"
#su - pentaho -c "cd /home/pentaho/pentaho/server/enterprise-console && ./start-pec.sh"
;;
"stop")
su - root -c "cd /opt/Pentaho/ && ./ctlscript.sh stop"
#su - pentaho -c "cd /home/pentaho/pentaho/server/enterprise-console && ./stop-pec.sh"
;;
*)
echo "Usage: $0 { start | stop }"
;;
esac
exit 0

STEP3:
Now save this file and give execution permission by executing the below command.
                     
                                           #chmod +x pentaho
where pentaho is name of the init script.

STEP4:
Now to add init script to default run levels, we have to execute below commands.

chkconfig -add pentaho    --  This command to add our files

NOTE: chkconfig  -  updates  and queries runlevel information for system ser-
       vices


after adding the init script we have set the script to run levels.

 syntax:  chkconfig [--level levels] name <on|off|reset>

chkconfig --level 35 pentaho on     --- This command will set the init script to run at boot time 

Thanks

























1 comment: