Solved

Linux crontab script needs help fixing an application support issue

Posted on 2014-07-29
9
701 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

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
 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Need to combine two scripts 2 40
Connect to CentOS (in a local VMWare VM) using Putty 7 146
postfix start error! 9 53
SMTP log file for IMSVA 5 32
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Fine Tune your automatic Updates for Ubuntu / Debian
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

749 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