You are on page 1of 4

Survey: Docpath process

Current situation:

Currently there are 2 demons related to Docpath:

1) Demon related to the Docpath Controller, for the generation of print / pdf, which detects .dat files in
the unix: / jetform / data / queue1

2) Demon related to the copy of the .dat / .end in unix, from / jetform / text / queue1 and / jetform /
text / queue2 to / jetform / data / queue1

1. Demonio Controller

Demon 1 can be raised and lowered from the operations menu (located in / home / operator /
opermenu / menu-am2hm135 / menu-adm-spool):

With point 9, the docpath controller starts. When the process is lifted (dpctrlsrv), a pid file is generated
in unix. In this way, if you try to run point 9 again, it is verified that there is that pid file and the new
invocation is ended, otherwise, if the pid file exists, the demon is raised.
At the same time with point 10, when the demon goes down, the pid file is deleted, so when you try to
raise the demon, you can do it without problems.

Next I indicate the code of each point of the menu:

9) clear
threw out "************************************************ ******************* "
echo "` hostname` $ {bold} START DOCPATH $ {offbold} "
threw out "************************************************ ******************* "
threw out
/ bin / su - docpath -c /home/docpath/jobs/start.sh
echo "\ n \ n I finish the DocPath boot process ..."
echo "$ {bold} Press ENTER to continue ... $ {offbold}"; read x
;;
10) clear
threw out "************************************************ ******************* "
echo "` hostname` $ {bold} DOWNLOAD DOCPATH $ {offbold} "
threw out "************************************************ ********************
"
threw out
/ bin / su - docpath -c /home/docpath/jobs/stop.sh
echo "\ n \ n I finish the DocPath download process ..."
echo "$ {bold} Press ENTER to continue ... $ {offbold}"; read x

We note that point 9 invokes the start.sh script. It has the following code:

cd / apps / JDE900 / docpath

StartCtrl.sh

Finally the script ArranqueCtrl.sh, is the one that raises the demon:

dpctrlsrv -s -fwdir.

We note that point 10 invokes the stop.sh script. It has the following code:

cd / apps / JDE900 / docpath

StopCtrl.sh

Finally the script StopCtrl.sh, is the one that lowers the daemon:

dpctrlsrv -t -fwdir.
2. Demon that moves .dat

The daemon that moves the .dat is invoked as a chrone job every one minute. The execution sentence is
like the following:

/root/jobs/Doc_Print_DV.sh X JET-START

In turn, the Doc_print_DV.sh script has a condition to validate if there is no other process already
running:

if [`ps -ef | grep $ 2 | grep -v grep | grep -v $$ | wc -l` = 0]; then

If the condition is validated, the script enters an infinite loop, which checks every 5 seconds, if there are
.dat / .end files to move to the docpath process folder.

While this condition seems correct, both Sebastian Balza and support of T-System (Teng, Kong Keong)
we observed that it may fail at times because it is a chron job. In fact, Sebastian was able to reproduce a
case:
root @ am2hm135: / root / jobs # ps -ef | grep Doc

root 5767576 4325574 0 16:21:00 - 0:32 sh /root/jobs/Doc_Print.sh X JET-START

root 8767576 4325574 0 17:21:00 - 0:32 sh /root/jobs/Doc_Print.sh X JET-START

root 12714494 30147034 0 10:07:14 pts / 32 0:00 grep Doc

root @ am2hm135: / root / jobs #

Proposed solution

It is necessary to replace the current condition with another condition that refers to the existence of a
pid file. For example:

PIDFile = "/ docpath / doc_print.pid"

if [-f "$ PIDFile"]; then

In this way, if the pid file exists, the invocation of the process is ended, otherwise it is initialized.
What we do not have for this demon, is some script that can be used to download / eliminate the
process. This is done directly by command line. Consequently, it is also necessary to have a script that
eliminates the process and eliminates the pid file.

The sentence to remove the pid file is like the following:


rm -f "$ PIDFile"

exit 0

You can also handle the option to remove the demon from the cron job, and add 2 points to the menu
to manage the high / low of this demon.

You might also like