Installing the Talend CommandLine service on RedHat/CentOS 6 Systems

Talend Big Data Platform Installation Guide for Linux

EnrichVersion
6.5
EnrichProdName
Talend Big Data Platform
task
Installation and Upgrade
EnrichPlatform
Talend Artifact Repository
Talend JobServer
Talend Administration Center
Talend Installer
Talend Data Preparation
Talend Data Stewardship
Talend SAP RFC Server
Talend Activity Monitoring Console
Talend Runtime
Talend CommandLine
Talend Log Server
Talend DQ Portal
Talend Identity and Access Management
Talend Repository Manager
Talend Studio

Procedure

  1. Create/Copy the following script to the /etc/init.d/commandline file:
    #!/bin/sh
    ### BEGIN INIT INFO
    # Default-Start:     2 3 4 5
    # Default-Stop:      S 0 1 6
    # Short-Description: Example initscript
    # Description:       This file should be used to construct scripts to be placed in /etc/init.d.
    ### END INIT INFO
    
    # Author: jsd03
    
    # Do NOT "set -e"
    
    # PATH should only include /usr/* if it runs after the mountnfs.sh script
    PATH=/usr/sbin:/usr/bin:/sbin:/bin
    COMMANDLINE=/oa/talend/commandline303
    CMD_WORKSPACE=$COMMANDLINE"/commandline-workspace"
    STARTUP=commandline.sh
    USER=cxp
    NAME=commandline
    PORT=10004
    
    
    # Read configuration variable file if present
    [ -r /etc/default/$NAME ] && . /etc/default/$NAME
    
    # Load the VERBOSE setting and other rcS variables
    [ -f /etc/default/rcS ] && . /etc/default/rcS
    
    # Define LSB log_* functions.
    # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
    . /lib/lsb/init-functions
    
    #
    # Function that starts the daemon/service
    #
    do_start()
    {
    echo -n $"Starting commandline service: "
     su - $USER -c "rm -Rf $CMD_WORKSPACE"
     su - $USER -c "cd $COMMANDLINE && screen -dmS cmdLine ./$STARTUP"
    #screen -dmS cmdLine $DAEMON_START
     RETVAL=$?
     echo
    
    }
    
    #
    # Function that stops the daemon/service
    #
    do_stop()
    {
     echo -n $"Stopping commandline service: "
     su - $USER -c "( echo 'stopServer' ; sleep 2 ) | telnet localhost $PORT"
     RETVAL=$?
     echo
    
    }
    
    case "$1" in
    start)
    do_start
     ;;
    stop)
     do_stop
     ;;
    *)
     echo $"Usage: $0 {start|stop}"
     exit 1
    esac
    
    exit 0
  2. Edit the USER and COMMANDLINE variable values in the script (with the dedicated user to run Talend CommandLine, and the Talend CommandLine path respectively).
  3. Make sure that the script is executable by typing the following command:
    chmod 0755 /etc/init.d/commandline
  4. Type in the following commands to add the service to your system:
    chkconfig --list
    chkconfig --add commandline