ksh script and java problem


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ksh script and java problem
# 1  
Old 06-20-2005
ksh script and java problem

I have a problem with the execution of a ksh as deamon on linux. I explain you first the context.
We have developped a Java program that execute every minutes an external (that we don't have developped) program with a config file in parameter.
The Java program is runned as deamon with a perl ("nohup javaprogram > logfile exit(0)") program.
Java program execute every minute (with command exec) a ksh file "Epa.ksh" that contain "APIEpa.ksh $1 >> logfile". This ksh call the external program and redirect standard output of the external program to a log file.
The ksh APIEpa.ksh execute an omnimark program and make an exit(0) when execution is finished.

Our problem is that for each execution a lot of process are created and then aren't deleted when the execution is finished. Every minute more and more process are created!!!

We can't change APIEpa.ksh. I have created Epades.ksh to redirect standard output of APIEpa.ksh in a file because when a lot of message was printed on the screen the program were stopped. But my solution doesn't work :-(.
We can change Java execution, perl that launch java in deamon and Epades.ksh.
They are launched in this order:
1. startMess_nohup.pl
2. PES_MessagingServer.ksh
3. Epa.ksh
4. APIEpa.ksh

1.startMess_nohup.pl

`nohup
MessagingServer/ae2.xml/Batch/PES_MessagingServer.ksh > MessagingServer/ae2.xml/Batch/PES_MessagingServer.log &`;
exit(0);


2. PES_MessagingServer.ksh

#!/bin/ksh -x
/usr/java/java/jre/bin/java -cp lib/PES_MessagingServer.jar com.xt.pes.messaging.server.ServerManager -conf /ServerEpaMessagingProperties.xml

3. Epa.ksh

APIEpa.ksh $1 >> Messaging.log


4. APIEpa.ksh

#!/usr/bin/ksh

PARENT_DIR="/MessagingServer/ae2.xml"

# configuration des outils
. ${PARENT_DIR}/Cfg/Epa.cfg

${OMNIMARKBIN}/omnimark -s ${PARENT_DIR}/Omnimark/Epa.xom -d Product "${PRODUCT}" -d Data "${DATA}" -d Provider "${PROVIDER}" -d ConfigFile "${ConfigFile}" -d ConfigDtd "${ConfigDtd}" -d TplInputDtd "${TplInputDtd}" -d TplOutputDtd "${TplOutputDtd}" -i ${OMNIMARKINC}/ -i ${PARENT_DIR}/Omnimark/ -i ${PARENT_DIR}/Api/ -x ${PARENT_DIR}/Api/=L.so -x ${OMNIMARKLIB}/=L.so -brief

ReturnCode=$?
if [ ${ReturnCode} -ne 0 ];then
echo "Error with return code: ${ReturnCode}"
else
echo "Epa.ksh OK. Return Code = ${ReturnCode}"
fi
exit 0


Those are all the scripts. Can someone PLEASE help me to solve this issue?! Smilie

Thank You, Smilie

Adrian Mihai
Network Engineer

Last edited by adrian.mihai; 06-22-2005 at 06:37 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem while Invoke Shell Script function from Java Program

Hi, I have create a Shell Script, with one function. I want to call the script file in Java Program. It working fine. but the problem is the function in the Shell Script is not executed. Please suggest me, Regards, Nanthagopal A (2 Replies)
Discussion started by: nanthagopal
2 Replies

2. Shell Programming and Scripting

exit status from ksh script exec from java using runtime

how do i get the exit status from a ksh or perl script executed in a java program using Runtime? (1 Reply)
Discussion started by: twk
1 Replies

3. UNIX for Dummies Questions & Answers

problem in Executing script in ksh

Hi, I am in ksh. below mentioned 3 commands I executed at command prompt & got the expected results. csh source csh_infa <special command> Now I have to do this in the script in ksh. I entered it as it is. #!/bin/ksh csh source csh_infa <special command> Now after... (1 Reply)
Discussion started by: girish_kanak
1 Replies

4. Programming

can i have an optimal solution for this java code ? Facing Java heap space problem even at 3GB heaps

My desired output is run: for this 1 for this 2 for this 3 for this 4 for this 5 for this 1,2 1->2 for this 2,3 2->3 for this 3,4 3->4 for this 4,5 4->5 for this 1,2,3 1->2,3 (2 Replies)
Discussion started by: vaibhavkorde
2 Replies

5. Shell Programming and Scripting

Problem with script: ksh not found

Hello Guys, what is the significance of using #!/bin/sh at the start of shell script. my default shell is ksh, when i run my script i have ksh: not found error and when i use ./myscript it works. Can anyone explain me the problem please ? tnx (1 Reply)
Discussion started by: midhun_u
1 Replies

6. UNIX for Dummies Questions & Answers

script sourcing problem (ksh)

I have a script "abc.sh" in /tmp which has exit 0 as its last line when I run this script from /tmp/xyz/def.sh script as . ../abc.sh then the script executes but the control doesn't return to def.sh script for subsequent commands in def.sh but if I invoke the abc.sh from inside the... (3 Replies)
Discussion started by: rakeshou
3 Replies

7. Shell Programming and Scripting

Ksh problem in script

Hi I made a small script which uses ksh. When i run the script then i get the following error However when i run each of the commands on the commandline they get executed and provide the desired output. i cant figure out why the script is not running. Kindly Help Thanks in... (3 Replies)
Discussion started by: PradeepRed
3 Replies

8. AIX

Problem in ksh script ( String comparison )

hi , i am trying to compre two strings if ] or if ] when the length of var1 is small (around 300-400 char ) it works fine but when it is large (around 900-1000 chars) it fails is there any limitations for this type of comparison ??? (1 Reply)
Discussion started by: amarnath
1 Replies

9. Shell Programming and Scripting

Newbie problem with ksh script

Hi all, I have a directory have all of the .stat and .dat file : they are is a pipe separate flat file. Example: log-20061202.stat contain 1st line and last line of log-20061202.dat with record count of that day. Example: Total record = 240 Tom|02-12-2006|1600 W.Santa... (18 Replies)
Discussion started by: sabercats
18 Replies

10. Shell Programming and Scripting

Simple ksh script problem

This is a search script that I have developed. It finds the records that I look for. However the only thing I want the program to do now is to display a message such as 'Not Found' to appear when a record is not found. So far when a search doesn't display a record, the screen is blank. ... (14 Replies)
Discussion started by: Warrior232
14 Replies
Login or Register to Ask a Question