Init Scripts

One Star

Init Scripts

I am a system's administor for an insurance company. Some developers threw over the wall the responsibility to create 3 init scripts for components of Talend SW. I have no idea what your software does. I will be investigating it over the next few days, but in the meantime I was wondering if someone had written a known working init script that works on RHEL 5. I read the manual and saw the example in the guide. I started with commandline.sh. I got the service running, but it logs out when I log out and the stop function fails to connect to the port listed in the example script. The port is listed in the script as 10004. I was looking through the code and it looks like when the program starts it uses 8002 (I think). All these things can be solved, but it takes time and I am short on time. So I was wondering if someone had a working script I could use while I learn about Talend.
Community Manager

Re: Init Scripts

Hello
I don't understand your request well, are you using TOS or paid subscription TIS? Do you want to install the commandline as service?
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Init Scripts

Sorry about the lack of detail. I have only had a few min. to work on this issue. The version is probably the TOS version. The developers told me there was no paid support and sent me a nicely done pdf with installation instructions. In the manual there are three init scripts. The commandline.sh init script is the one I am working on at the moment.
#!/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/TIS/commandline303
COMMANDLINE=/usr/pservices/springsource/tcServer-6.0/Talend/CommandLine/
CMD_WORKSPACE=$COMMANDLINE"/commandline-workspace"
STARTUP=commandline.sh
USER=webopt
NAME=commandline
PORT=10004
# Read configuration variable file if present
&& . /etc/default/$NAME
# Load the VERBOSE setting and other rcS variables
&& . /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
I appreciate the script, but when it starts the process runs until I logout. The stop script gives an error message: connection refused.
I go to the talend directory and cat the commandline -sh and it reads:
./TalendDataQuality-linux-gtk-x86 -nosplash -application org.talend.commandline.CommandLine -consoleLog -data cworkspace startServer -p 8002
I assume that means it is starting on port 8002.
This is as far as I have gotten trying to figure out what is going on. I am on a tight time schedule and this came in ad hoc so I have not had time to dive into the issues. So I was hoping someone that had it working would post it so I could get this working immediatly and work on the details later.
Employee

Re: Init Scripts

Hi echeadle.
In fact you're using a paid version since you're trying to start "TalendDataQuality-linux-gtk-x86" which is definately not part of TOS (just like the CommandLine also). So it means that you have a valid license and you can open a ticket to the support. They will probably give you scripts that works on REHL.
One Star

Re: Init Scripts

Thank you for the information. I will go back and talk to the developers and find out what is going on.