Solved

Linux crontab script needs help fixing an application support issue

Posted on 2014-07-29
9
681 Views
Last Modified: 2014-07-29
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
0
Comment
Question by:marceloNYC
  • 6
  • 3
9 Comments
 
LVL 14

Expert Comment

by:ThomasMcA2
ID: 40227309
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
 

Author Comment

by:marceloNYC
ID: 40227369
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
 
LVL 14

Expert Comment

by:ThomasMcA2
ID: 40227390
Sorry, I should have been more clear. Please attach those scripts so an expert can evaluate them.
0
 

Author Comment

by:marceloNYC
ID: 40227434
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:marceloNYC
ID: 40227437
...and here are the stop:
stop-mvas-vue.sh
stop-all.sh
0
 
LVL 14

Accepted Solution

by:
ThomasMcA2 earned 500 total points
ID: 40227551
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
 

Author Comment

by:marceloNYC
ID: 40227677
roger that, will change soon and test.
0
 

Author Comment

by:marceloNYC
ID: 40227703
Like this without the "tail -n +2".

if ( ps -fp `cat $pid_file` | tail -n +2 | grep . >/dev/null); then
0
 

Author Closing Comment

by:marceloNYC
ID: 40227821
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

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now