Operating System - HP-UX
1834627 Members
3135 Online
110069 Solutions
New Discussion

Ghost Process. Want to know the reason.

 
Chen Yingjie
Frequent Advisor

Ghost Process. Want to know the reason.

There is 1 ghost process when the target
script was executed by cron job.

The log is below.
# more oraarc1368.log
oracle8 1373 1368 0 13:15:01 ? 0:00 /usr/sbin/sh /PRODUCTS/oracle8/ARCH/oraarc_press.sh
oracle8 1368 1365 0 13:15:00 ? 0:00 /usr/sbin/sh /PRODUCTS/oracle8/ARCH/oraarc_press.sh
oracle8 1365 1274 0 13:15:00 ? 0:00 sh -c $HOME/ARCH/oraarc_press.sh
#

As my understanding PROCESS ID 1373 may the ghost process. This situation is not occoured every time.

Hope someone give me advise.
Thank you very much.

Chen
4 REPLIES 4
David Andrews_1
Advisor

Re: Ghost Process. Want to know the reason.

Chen,

I believe you are misreading the information.

This looks like output from the following command:
`ps -ef|grep oraarc_press`

Process Id 1373 is a child process of 1368
Process Id 1368 is a child process of 1365
Process Id 1365 is the initial call of:
sh -c $HOME/ARCH/oraarc_press.sh

Without the code for "oraarc_press.sh" that's about all I can tell.

Are you running this from cron?
If so is it the root cron or does oracle have it's own?

Hope this helps,

Dave
Chen Yingjie
Frequent Advisor

Re: Ghost Process. Want to know the reason.

Yes, we are running it from the cron of
oracle8.

I will upload a part of the script later.

Chen
Chen Yingjie
Frequent Advisor

Re: Ghost Process. Want to know the reason.

Below is part of the script (very beginning of it).

This is called from oracle8's cron every 30 minutes, to avoid duplicate execution, check to see whether there is already the process which has same name running or not.

I wonder why this (script itself forks another process ) happens.


/usr/bin/ps -ef | /usr/bin/grep ${MYNAME} | /usr/bin/grep -v grep > ${PROCFILE}
PNUM=`cat ${PROCFILE} | /usr/bin/wc -l `
if [ $PNUM -gt 2 ]; then
echo "${MYNAEM} already executed."
ERRORCODE=3
exit ${ERRORCODE}
fi

Notice:

${RPOCFILE} is predefined working filename.

${MYNAME} is got from `basename $0` - ie.)oraarc_press.sh .

Chen
Steve Steel
Honored Contributor

Re: Ghost Process. Want to know the reason.

Hi


You should look at a problem in the environment causing the process to clone itself which doesnt happen when run from a command line


Put set -x in the statup script and look for an email after the run


Steve STeel
If you want truly to understand something, try to change it. (Kurt Lewin)