Starting Datameer at Boot Time

Starting Datameer at Boot Time

The following describes how to edit and set up the attached Datameer X startup script in CentOS 5.6. These should work the same on other Linux distributions.

An example of shell script code is below:

Prerequisites

Datameer X should be installed and running successfully. (i.e., <path to das>/bin/conductor.sh start)

Datameer

  1. Create the script on the Linux machine.

  2. Move the das.server script to /etc/init.d/Note: These scripts should be owned by root:

  3. Edit the das.server script:

    1. Change the value of DAS_HOME to the correct path

      1. export DAS_HOME=/opt/das

    2. Change DAS_USER to the same user that owns /opt/das directory and has been previously defined in das-env.sh

      1. export DAS_USER=datameer

    3. Change PID_PATH to a location where the das pid file can be stored.

      1. export PID_PATH=/var/lock/subsys

  4. Add das server to the list of available services in Linux:

    1. chkconfig --add das.server

  5. Check what init levels are active for Das:

    1. chkconfig --list |grep das.server (Notice init 3,4,5 have das “on”)

                das.server      0:off   1:off   2:off   3:on    4:on    5:on    6:off

This automates the start of Datameer X at bootup.

#!/bin/bash #set -x # # Starts a Datameer X Server # chkconfig: 345 90 10 # description: DAS Server export DAS_HOME=/opt/das export DAS_USER=das export PID_PATH=/var/lock/subsys #Source Function Library . /etc/rc.d/init.d/functions RETVAL=0 PIDFILE="/var/lock/subsys/das.pid" desc="DAS Server daemon" ####################################################################### start() {   echo -n $"Starting $desc (DAS): "   daemon --user $DAS_USER $DAS_HOME/bin/conductor.sh start /dev/null2>&1   RETVAL=$?   echo   [ $RETVAL -eq 0 ] && touch $PID_PATH/das   return $RETVAL } stop() {   echo -n $"Stopping $desc (DAS): "   daemon --user $DAS_USER $DAS_HOME/bin/conductor.sh stop   RETVAL=$?   sleep 5   echo   [ $RETVAL -eq 0 ] && rm -f $PID_PATH/das $PIDFILE } checkstatus(){   ps |grep das } restart() {   stop   start } case "$1" in   start)     start     ;;   stop)     stop     ;;   status)     checkstatus     ;;   restart)     restart     ;;   *)     echo $"Usage: $0 {start|stop|status|restart}"     exit 1 esac exit $RETVAL