- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- kill and restart a cobol daemon
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-13-2006 07:08 AM
тАО07-13-2006 07:08 AM
I have a script I am working on and it works fine when the daemon isnt running just to restart it, but when I have to kill the running daemon and then start it again it abends b/c of the kill command.
I issue a kill command in the script but it then terminates my script without trying to start the daemon again.
# ./mflm_manager.sh
LMF-common is missing. Running...
killing mflm_manager...
Terminated
I cant seem to get around this issue...
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-13-2006 07:12 AM
тАО07-13-2006 07:12 AM
Re: kill and restart a cobol daemon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-13-2006 07:18 AM
тАО07-13-2006 07:18 AM
Re: kill and restart a cobol daemon
Is this intended to run from cron or interactively?
Are you merely trying to 'bounce' the lmf?
If this isn't interactive, then perhaps a pair of scripts one to stop and the other to stop. Or, maybe you need to trap the return code from your kill process and then issue the start command.
thoughts.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-13-2006 07:43 AM
тАО07-13-2006 07:43 AM
Re: kill and restart a cobol daemon
============================================
MFLM_PID=$!
MFLM_PID=`ps -aef |grep mflm_manager |grep -v grep |awk '{ print $2 }'`
# If the cobol manager isnt running then kill the tmp lockfile and restart it.
if [ `ps -aef |grep mflm_manager |grep -v grep|wc -l` -ne 1 ]
then
echo "Restarting MFLMMAN... "
kill $MFLM_PID
rm /var/tmp/LMF-common
cd /opt/cobol/mflmf;./mflmman
fi
# if /var/tmp/LMF-common is not present then kill the daemon and restart it via
the mflmman.
if [ `find /var/tmp/ -name LMF-common|wc -l` -ne 1 ]
then
echo "LMF-common is missing. Running..."
echo "killing mflm_manager..."
kill $MFLM_PID
cd /opt/cobol/mflmf;./mflmman
else
echo "MLFM_manger is running, exiting..."
fi
===========================================
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-13-2006 07:52 AM
тАО07-13-2006 07:52 AM
Re: kill and restart a cobol daemon
Jeff Traigle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-13-2006 08:28 AM
тАО07-13-2006 08:28 AM
SolutionWhat is the name of this script, does it happen to have a name that is a substring of "mflm_manager"?
Also the following line:
if [ `ps -aef |grep mflm_manager |grep -v grep|wc -l` -ne 1 ]
then
echo "Restarting MFLMMAN... "
kill $MFLM_PID
reads to me that if mflm_manager isn't up - then echo a line, and then - "kill my own pid" - because it didn't exist at the top of script for the parameter assignment...
BUT... if it is already dead, then why do you want to kill anything, why not just remove the kill command, and go?
Or, if you still wanted the above line to work - change the "-ne 1" to "-ne 0".
right?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-13-2006 08:33 AM
тАО07-13-2006 08:33 AM
Re: kill and restart a cobol daemon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-13-2006 08:38 AM
тАО07-13-2006 08:38 AM
Re: kill and restart a cobol daemon
`UNIX95= ps-fC mflm_manager| wc -l`
instead.
Cleaner more reliable, more energy efficient, and much less likely to give you problems from searches that end up being accidently true from other fields of the "ps" command line output.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-13-2006 08:38 AM
тАО07-13-2006 08:38 AM
Re: kill and restart a cobol daemon
`UNIX95= ps -fC mflm_manager| wc -l`
instead.
Cleaner more reliable, more energy efficient, and much less likely to give you problems from searches that end up being accidently true from other fields of the "ps" command line output.