<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: kill and restart a cobol daemon in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/kill-and-restart-a-cobol-daemon/m-p/3823315#M100352</link>
    <description>Shouldn't you grep for mflmman instead of mlfm_manager to set MLFM_PID? You are indeed killing your script as it stands now.</description>
    <pubDate>Thu, 13 Jul 2006 14:52:23 GMT</pubDate>
    <dc:creator>Jeff_Traigle</dc:creator>
    <dc:date>2006-07-13T14:52:23Z</dc:date>
    <item>
      <title>kill and restart a cobol daemon</title>
      <link>https://community.hpe.com/t5/operating-system-linux/kill-and-restart-a-cobol-daemon/m-p/3823311#M100348</link>
      <description>guys,&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;I issue a kill command in the script but it then terminates my script without trying to start the daemon again.&lt;BR /&gt;&lt;BR /&gt;# ./mflm_manager.sh &lt;BR /&gt;LMF-common is missing. Running...&lt;BR /&gt;killing mflm_manager...&lt;BR /&gt;Terminated&lt;BR /&gt;&lt;BR /&gt;I cant seem to get around this issue...</description>
      <pubDate>Thu, 13 Jul 2006 14:08:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/kill-and-restart-a-cobol-daemon/m-p/3823311#M100348</guid>
      <dc:creator>Todd McDaniel_1</dc:creator>
      <dc:date>2006-07-13T14:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: kill and restart a cobol daemon</title>
      <link>https://community.hpe.com/t5/operating-system-linux/kill-and-restart-a-cobol-daemon/m-p/3823312#M100349</link>
      <description>Can you post to us the actual script?</description>
      <pubDate>Thu, 13 Jul 2006 14:12:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/kill-and-restart-a-cobol-daemon/m-p/3823312#M100349</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2006-07-13T14:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: kill and restart a cobol daemon</title>
      <link>https://community.hpe.com/t5/operating-system-linux/kill-and-restart-a-cobol-daemon/m-p/3823313#M100350</link>
      <description>A little context -- &lt;BR /&gt;Is this intended to run from cron or interactively?&lt;BR /&gt;Are you merely trying to 'bounce' the lmf? &lt;BR /&gt;&lt;BR /&gt;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. &lt;BR /&gt;&lt;BR /&gt;thoughts. &lt;BR /&gt;&lt;BR /&gt;Mark</description>
      <pubDate>Thu, 13 Jul 2006 14:18:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/kill-and-restart-a-cobol-daemon/m-p/3823313#M100350</guid>
      <dc:creator>Mark Fenton</dc:creator>
      <dc:date>2006-07-13T14:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: kill and restart a cobol daemon</title>
      <link>https://community.hpe.com/t5/operating-system-linux/kill-and-restart-a-cobol-daemon/m-p/3823314#M100351</link>
      <description>here you go...&lt;BR /&gt;&lt;BR /&gt;============================================&lt;BR /&gt;MFLM_PID=$!&lt;BR /&gt;MFLM_PID=`ps -aef |grep mflm_manager |grep -v grep |awk '{ print $2 }'`&lt;BR /&gt;&lt;BR /&gt;# If the cobol manager isnt running then kill the tmp lockfile and restart it.&lt;BR /&gt;if [ `ps -aef |grep mflm_manager |grep -v grep|wc -l` -ne 1 ]&lt;BR /&gt;    then &lt;BR /&gt;    echo "Restarting MFLMMAN... "&lt;BR /&gt;    kill $MFLM_PID&lt;BR /&gt;    rm /var/tmp/LMF-common&lt;BR /&gt;    cd /opt/cobol/mflmf;./mflmman&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;# if /var/tmp/LMF-common is not present then kill the daemon and restart it via &lt;BR /&gt;the mflmman.&lt;BR /&gt;if [ `find /var/tmp/ -name LMF-common|wc -l` -ne 1 ]&lt;BR /&gt;        then&lt;BR /&gt;        echo "LMF-common is missing. Running..."&lt;BR /&gt;        echo "killing mflm_manager..."&lt;BR /&gt;        kill $MFLM_PID&lt;BR /&gt;        cd /opt/cobol/mflmf;./mflmman&lt;BR /&gt;        else &lt;BR /&gt;        echo "MLFM_manger is running, exiting..." &lt;BR /&gt;fi&lt;BR /&gt;===========================================</description>
      <pubDate>Thu, 13 Jul 2006 14:43:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/kill-and-restart-a-cobol-daemon/m-p/3823314#M100351</guid>
      <dc:creator>Todd McDaniel_1</dc:creator>
      <dc:date>2006-07-13T14:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: kill and restart a cobol daemon</title>
      <link>https://community.hpe.com/t5/operating-system-linux/kill-and-restart-a-cobol-daemon/m-p/3823315#M100352</link>
      <description>Shouldn't you grep for mflmman instead of mlfm_manager to set MLFM_PID? You are indeed killing your script as it stands now.</description>
      <pubDate>Thu, 13 Jul 2006 14:52:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/kill-and-restart-a-cobol-daemon/m-p/3823315#M100352</guid>
      <dc:creator>Jeff_Traigle</dc:creator>
      <dc:date>2006-07-13T14:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: kill and restart a cobol daemon</title>
      <link>https://community.hpe.com/t5/operating-system-linux/kill-and-restart-a-cobol-daemon/m-p/3823316#M100353</link>
      <description>The way I see it is that MFLM_PID is still set to $!, and the next assignment doesn't make it.  So, you're killing your own script.&lt;BR /&gt;&lt;BR /&gt;What is the name of this script, does it happen to have a name that is a substring of "mflm_manager"?  &lt;BR /&gt;&lt;BR /&gt;Also the following line:&lt;BR /&gt;if [ `ps -aef |grep mflm_manager |grep -v grep|wc -l` -ne 1 ]&lt;BR /&gt;&lt;BR /&gt;then&lt;BR /&gt;echo "Restarting MFLMMAN... "&lt;BR /&gt;kill $MFLM_PID &lt;BR /&gt;&lt;BR /&gt;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...&lt;BR /&gt;&lt;BR /&gt;BUT... if it is already dead, then why do you want to kill anything, why not just remove the kill command, and go?&lt;BR /&gt;&lt;BR /&gt;Or, if you still wanted the above line to work - change the "-ne 1" to "-ne 0".&lt;BR /&gt;&lt;BR /&gt;right?</description>
      <pubDate>Thu, 13 Jul 2006 15:28:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/kill-and-restart-a-cobol-daemon/m-p/3823316#M100353</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2006-07-13T15:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: kill and restart a cobol daemon</title>
      <link>https://community.hpe.com/t5/operating-system-linux/kill-and-restart-a-cobol-daemon/m-p/3823317#M100354</link>
      <description>thanks I changed the name of my script. So it should work now. I will have to wait till Friday to test it though. when my clients come back in.</description>
      <pubDate>Thu, 13 Jul 2006 15:33:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/kill-and-restart-a-cobol-daemon/m-p/3823317#M100354</guid>
      <dc:creator>Todd McDaniel_1</dc:creator>
      <dc:date>2006-07-13T15:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: kill and restart a cobol daemon</title>
      <link>https://community.hpe.com/t5/operating-system-linux/kill-and-restart-a-cobol-daemon/m-p/3823318#M100355</link>
      <description>One more thing, instead of using the ol' "ps -ef | grep [command] | grep -v grep " type command - convert your script to use:&lt;BR /&gt;&lt;BR /&gt;`UNIX95= ps-fC mflm_manager| wc -l` &lt;BR /&gt;&lt;BR /&gt;instead.&lt;BR /&gt;&lt;BR /&gt;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.</description>
      <pubDate>Thu, 13 Jul 2006 15:38:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/kill-and-restart-a-cobol-daemon/m-p/3823318#M100355</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2006-07-13T15:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: kill and restart a cobol daemon</title>
      <link>https://community.hpe.com/t5/operating-system-linux/kill-and-restart-a-cobol-daemon/m-p/3823319#M100356</link>
      <description>One more thing, instead of using the ol' "ps -ef | grep [command] | grep -v grep " type command - convert your script to use:&lt;BR /&gt;&lt;BR /&gt;`UNIX95= ps -fC mflm_manager| wc -l` &lt;BR /&gt;&lt;BR /&gt;instead.&lt;BR /&gt;&lt;BR /&gt;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.</description>
      <pubDate>Thu, 13 Jul 2006 15:38:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/kill-and-restart-a-cobol-daemon/m-p/3823319#M100356</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2006-07-13T15:38:59Z</dc:date>
    </item>
  </channel>
</rss>

