Starting the Servers At Boot Time On Linux
This procedure assumes that you will be running your BI Server, DI Server, and
Pentaho Enterprise Console server under the pentaho local user account, as
recommended by Pentaho and explained earlier in this guide. If you are using a different
account to start these services, use it in place of the pentaho user account in the
script below.
You can start and stop the BI and DI Servers at any time by running the start-pentaho.sh and stop-pentaho.sh scripts in the /pentaho/server/biserver-ee/ and /pentaho/server/data-integration-server/ directories, respectively, or
you can start and stop the entire stack -- MySQL, Tomcat, DI Server, and the Pentaho
Enterprise Console -- with the provided ctlscript.sh script in the /pentaho/
directory. To start the Tomcat server automatically at boot time, and stop automatically
during shutdown, follow the below procedure.
-
With root permissions, create a file in /etc/init.d/
called pentaho.
-
Using a text editor, copy the following content into the new pentaho script,
changing mysql to the name of the init script for your database if it is
running on the remote machine, or remove mysql entirely if you are using
a remote database. Secondly, you must adjust the paths to the BI Server, DI
Server, and Pentaho Enterprise Console scripts to match your situation.
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: pentaho
# Required-Start: networking
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Pentaho BI Server
### END INIT INFO
case "$1" in
"start")
su - pentaho -c "/home/pentaho/pentaho/mysql/scripts/ctl.sh start"
su - pentaho -c "/home/pentaho/pentaho/server/biserver-ee/start-pentaho.sh"
su - pentaho -c "/home/pentaho/pentaho/server/data-integration-server/start-pentaho.sh"
su - pentaho -c "cd /home/pentaho/pentaho/server/enterprise-console && ./start-pec.sh"
;;
"stop")
su - pentaho -c "/home/pentaho/pentaho/mysql/scripts/ctl.sh stop"
su - pentaho -c "/home/pentaho/pentaho/server/biserver-ee/stop-pentaho.sh"
su - pentaho -c "/home/pentaho/pentaho/server/data-integration-server/stop-pentaho.sh"
su - pentaho -c "cd /home/pentaho/pentaho/server/enterprise-console && ./stop-pec.sh"
;;
*)
echo "Usage: $0 { start | stop }"
;;
esac
exit 0
-
Save the file and close the text editor.
-
Make the init script executable.
chmod +x /etc/init.d/pentaho
-
Add the pentaho init script to the standard runlevels so that it will run when
the system starts, and stop when the system is shut down or rebooted, by using
the update-rc.d command.
This command may not exist on your computer if it is not Debian-based. If that
is the case, consult your distribution documentation or contact your
distribution's support department to determine how to add init scripts to the
default runlevels.
update-rc.d pentaho defaults
The Pentaho BI Server will now start at boot time, and shut down when the system
stops or restarts.