Question

I made a service called oracleforms to start Oracle Forms Server, now I want to write a script to be called by crontab to check if the oracle forms server is running everyday, but I don't know what is the process name for Forms Server. *WLS_FORMS* seems doesn't work, Here is my script:

#!/bin/bash
if [ -z "$(pgrep WLS_FORMS)" ]; then
  echo "Process is not running."
  service oracleforms start
else
  echo "Process is running."
fi

ps aux | grep WLS_FORMS returns some long string like below:

oracle 4518 1.4 13.1 1434532 533068 ? Sl 15:39 1:08 /usr/java/jdk1.6.0_3 9/bin/java -server -Xms256m -Xmx512m -XX:MaxPermSize=512m -Dweblogic.Name=WLS_FORMS - Djava.security.policy=/home/oracle/Oracle/Middleware/wlserver_10.3/server/lib/weblogi c.policy -Dweblogic.ProductionModeEnabled=true -Dweblogic.security.SSL.trustedCAKeySt....

Was it helpful?

Solution 2

I found that the forms server is started by java with Dweblogic.Name=WLS_FORMS as a parameter. Since ps aux | grep WLS_FORMS can detect the info, so I changed the script as below, it works fine now

#!/bin/bash
if [ $( ps aux | grep WLS_FORMS |wc -l) -eq 1 ]
then
  echo "Process is not running."
  service oracleforms start
else
  echo "Process is running."
fi

OTHER TIPS

I am do not use linux, but you can try command:

service --status-all

To get all running services. Then try to find oracle forms service. If you can't find it. Save list of services. Kill WLS_FORMS and try to find which service is gone. Then use:

service someservice status
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top