Linux crontab script needs help fixing an application support issue

Dear Experts,

I am in need to figure why an application that we support Markview has to be restarted every Monday so it can work again.

The application runs from two servers we'll call it Boston3 and Boston4.

Boston 3:

##################################################################################
# XDEV - Markview/SQL*Flow OC4Js (created 07/23/2014 by ME)
##################################################################################
  00 04  *  *  6 ksh /markview/mvasdocs/oc4j_xdev/j2ee/home/bbStartStop.sh stop
  30 04  *  *  6 ksh /markview/mvasdocs/oc4j_xdev/j2ee/home/bbStartStop.sh start
##################################################################################

Boston 4

##################################################################################
# XDEV - Markview/SQL*Flow OC4Js (created 07/23/2014 ME)
##################################################################################
  00 04  *  *  6 ksh /markview/mvxpress/oc4j_xdev/j2ee/home/bbStartStop.sh stop
  35 04  *  *  6 ksh /markview/mvxpress/oc4j_xdev/j2ee/home/bbStartStop.sh start
##################################################################################

I am wondering if this old configuration is the problem. The Linux version was upgraded to 5.5 and it may not like the ksh in front  calling the schedule commands. This is a 2004 installation that has had patching and upgrades. The crontab does work when is supposed to.

Boston4 has to have the process manually bounce so it can work again.

Also here you have some errors:

> ksh /markview/mvasdocs/oc4j_xdev/j2ee/home/bbStartStop.sh stop
Stopping 170 MarkView Application Server Viewer Module at Tue Jul 29 10:53:30 CDT 2014
tail: cannot open `+2' for reading: No such file or directory
tail: cannot open `+2' for reading: No such file or directory
Stopping 170 MarkView Application Server Graphics Module at Tue Jul 29 10:53:32 CDT 2014
tail: cannot open `+2' for reading: No such file or directory
tail: cannot open `+2' for reading: No such file or directory
Stopping 170 MarkView Application Server Barcode Generator at Tue Jul 29 10:53:33 CDT 2014
tail: cannot open `+2' for reading: No such file or directory
tail: cannot open `+2' for reading: No such file or directory
Stopping 170 MarkView Application Server Document Transport Module at Tue Jul 29 10:53:34 CDT 2014
tail: cannot open `+2' for reading: No such file or directory
tail: cannot open `+2' for reading: No such file or directory
Stopping 170 SQL*Flow Monitor Web Edition at Tue Jul 29 10:53:35 CDT 2014
tail: cannot open `+2' for reading: No such file or directory
tail: cannot open `+2' for reading: No such file or directory

Here is where the error and the problem is I think:
 tail: cannot open `+2' for reading: No such file or directory

when it comes up or starts:

>ksh /markview/mvasdocs/oc4j_xdev/j2ee/home/bbStartStop.sh start
Starting 170 MarkView Application Server Viewer Module at Tue Jul 29 10:55:09 CDT 2014
Starting 170 MarkView Application Server Graphics Module at Tue Jul 29 10:55:10 CDT 2014
Starting 170 MarkView Application Server Bar Code Generator Module at Tue Jul 29 10:55:10 CDT 2014
Starting 170 MarkView Application Server Document Transport Module at Tue Jul 29 10:55:10 CDT 2014
Starting 170 SQL*Flow Monitor Web Edition at Tue Jul 29 10:55:10 CDT 2014

This happens on both servers.

ps -ef | grep -i $USER | grep -i xdev
mvasdocs 23595     1  0 12:43 pts/1    00:00:02 java -Djava.awt.headless=true -jar oc4j.jar -config config-mvas-vm/server.xml -out log/mvas-vm.xdev.out -err log/mvas-vm.err
mvasdocs 23600     1  0 12:43 pts/1    00:00:02 java -Djava.awt.headless=true -jar oc4j.jar -config config-graphics/server.xml -out log/graphics.xdev.out -err log/graphics.err
mvasdocs 23605     1  0 12:43 pts/1    00:00:02 java -Djava.awt.headless=true -jar oc4j.jar -config config-mvas-bcg/server.xml -out log/mvas-bcg.xdev.out -err log/mvas-bcg.err
mvasdocs 23618     1  0 12:43 pts/1    00:00:04 java -Djava.awt.headless=true -jar oc4j.jar -config config-mvas-dtm/server.xml -out log/mvas-dtm.xdev.out -err log/mvas-dtm.err
mvasdocs 23639     1  0 12:43 pts/1    00:00:04 java -Djava.awt.headless=true -jar oc4j.jar -config config-sfas-mm/server.xml -out ./log/sfas-mm.xdev.out -err ./log/sfas-mm.err

There are a lot of error that I am not sure we need. I am sure is the script that is the problem.

I have upload an edited EE version script for your review.
bbStartStop3.sh
bbStartStop4.sh
marceloNYCMiddle-Tier AdministratorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ThomasMcA2Commented:
Those scripts are just "helper" scripts that launch other scripts based on the parameter that is passed in. In other words, when crontab launches bbStartStop.sh  with "start" as a parameter, bbStartStop.sh launches each of these:

start-mvas-vm.sh        
start-mvas-vm2.sh       
start-mvas-vm3.sh       
start-mvas-vue.sh       
start-graphics.sh       
start-mvas-bcg.sh       
start-mvas-dtm.sh       
start-mvas-vm-monitor.sh
start-sfas-mm.sh       

Open in new window



Your errors are coming from those scripts, not from bbStartStop.sh itself.
0
marceloNYCMiddle-Tier AdministratorAuthor Commented:
yes, correct. Where should I look into those scripts? The strange thing is that other process are working fine with the same scripts.

How do I figure this out when stopping the process:

Stopping 170 MarkView Application Server Document Transport Module at Tue Jul 29 10:53:34 CDT 2014
tail: cannot open `+2' for reading: No such file or directory
tail: cannot open `+2' for reading: No such file or directory
0
ThomasMcA2Commented:
Sorry, I should have been more clear. Please attach those scripts so an expert can evaluate them.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

marceloNYCMiddle-Tier AdministratorAuthor Commented:
Cool I found this in start-mvas-vue.sh:

# If the pid file exists check to see if the process exists.  If so, throw an error, otherwise remove the old pid file.
if [ -s $pid_file ]; then
      if ( ps -fp `cat $pid_file` | tail +2 | grep . >/dev/null); then
            echo "Error: Application server is already running." >&2
            exit 4
      else
            echo "Info: Removing old pid file and continuing startup." >&2
            rm -f $pid_file
      fi
fi

nohup java -Xincgc -Xms1g -Xmx1g -Xss1m -Djava.awt.headless=true -DMvDataSourceLocation=jdbc/OracleDS -XX:NewSize=256m -XX:MaxNewSize=512m -Dmv.log.dir=log -jar oc4j.jar -config config-$app_name/server.xml -out $log_dir/$app_name.out -err $log_dir/$app_name.err >$log_dir/$app_name.nohup 2>&1 &
start-mvas-vue.sh
start-all.sh
0
marceloNYCMiddle-Tier AdministratorAuthor Commented:
...and here are the stop:
stop-mvas-vue.sh
stop-all.sh
0
ThomasMcA2Commented:
I'm not sure how it was able to work previously, but that "tail +2" in the script should be "tail -n +2".

You'll need to change that in every stop-* and start-* script.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
marceloNYCMiddle-Tier AdministratorAuthor Commented:
roger that, will change soon and test.
0
marceloNYCMiddle-Tier AdministratorAuthor Commented:
Like this without the "tail -n +2".

if ( ps -fp `cat $pid_file` | tail -n +2 | grep . >/dev/null); then
0
marceloNYCMiddle-Tier AdministratorAuthor Commented:
excellent and thank you so very much:

mvasdocs on boston3.esc.gov> ksh /markview/mvasdocs/oc4j_sitx/j2ee/home/bbStartStop.sh stop
Stopping 170 MarkView Application Server Viewer Module at Tue Jul 29 15:37:58 CDT 2014
tail: cannot open `+2' for reading: No such file or directory
tail: cannot open `+2' for reading: No such file or directory
Stopping 170 MarkView Application Server Graphics Module at Tue Jul 29 15:37:59 CDT 2014
tail: cannot open `+2' for reading: No such file or directory
tail: cannot open `+2' for reading: No such file or directory
Stopping 170 MarkView Application Server Barcode Generator at Tue Jul 29 15:38:00 CDT 2014
tail: cannot open `+2' for reading: No such file or directory
tail: cannot open `+2' for reading: No such file or directory
Stopping 170 MarkView Application Server Document Transport Module at Tue Jul 29 15:38:01 CDT 2014
tail: cannot open `+2' for reading: No such file or directory
tail: cannot open `+2' for reading: No such file or directory
Stopping 170 SQL*Flow Monitor Web Edition at Tue Jul 29 15:38:02 CDT 2014
tail: cannot open `+2' for reading: No such file or directory
tail: cannot open `+2' for reading: No such file or directory
mvasdocs on boston3.esc.gov> ksh /markview/mvasdocs/oc4j_sitx/j2ee/home/bbStartStop.sh start
Starting 170 MarkView Application Server Viewer Module at Tue Jul 29 15:38:13 CDT 2014
Starting 170 MarkView Application Server Graphics Module at Tue Jul 29 15:38:13 CDT 2014
Starting 170 MarkView Application Server Bar Code Generator Module at Tue Jul 29 15:38:13 CDT 2014
Starting 170 MarkView Application Server Document Transport Module at Tue Jul 29 15:38:13 CDT 2014
Starting 170 SQL*Flow Monitor Web Edition at Tue Jul 29 15:38:13 CDT 2014

After fixing the scripts (plural) entry

mvasdocs on boston3.esc.gov> ksh /markview/mvasdocs/oc4j_sitx/j2ee/home/bbStartStop.sh stop
Stopping 170 MarkView Application Server Viewer Module at Tue Jul 29 15:44:43 CDT 2014
Stopping 170 MarkView Application Server Graphics Module at Tue Jul 29 15:44:44 CDT 2014
Stopping 170 MarkView Application Server Barcode Generator at Tue Jul 29 15:44:45 CDT 2014
Stopping 170 MarkView Application Server Document Transport Module at Tue Jul 29 15:44:46 CDT 2014
Stopping 170 SQL*Flow Monitor Web Edition at Tue Jul 29 15:44:47 CDT 2014
mvasdocs on boston3.esc.gov> ksh /markview/mvasdocs/oc4j_sitx/j2ee/home/bbStartStop.sh start
Starting 170 MarkView Application Server Viewer Module at Tue Jul 29 15:44:55 CDT 2014
Starting 170 MarkView Application Server Graphics Module at Tue Jul 29 15:44:55 CDT 2014
Starting 170 MarkView Application Server Bar Code Generator Module at Tue Jul 29 15:44:55 CDT 2014
Starting 170 MarkView Application Server Document Transport Module at Tue Jul 29 15:44:55 CDT 2014
Starting 170 SQL*Flow Monitor Web Edition at Tue Jul 29 15:44:55 CDT 2014
mvasdocs on boston3.esc.gov>
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.