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);

  1. 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

  1. Epa.ksh

APIEpa.ksh $1 >> Messaging.log

  1. 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?! :confused:

Thank You, :slight_smile:

Adrian Mihai
Network Engineer