<?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: Shutdown script to stop a application service in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/shutdown-script-to-stop-a-application-service/m-p/5545069#M53529</link>
    <description>&lt;P&gt;In a RHEL5 system, there is a template for startup/shutdown scripts at:&lt;/P&gt;&lt;P&gt;/usr/share/doc/initscripts-&amp;lt;version&amp;gt;/sysvinitfiles&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The file contains explanations and an example script: you'll only need to replace the parts within &amp;lt;angle brackets&amp;gt; with the commands you want. For example, here is the part that actually stops the application:&lt;/P&gt;&lt;PRE&gt;stop() {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo -n "Shutting down &amp;lt;servicename&amp;gt;: "&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;stop daemons, perhaps with the killproc function&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rm -f /var/lock/subsys/&amp;lt;servicename&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &amp;lt;return code of stopping daemon&amp;gt;&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;You would replace the &amp;lt;servicename&amp;gt; with the name of your application (which should be the same as the name of the script), and the &amp;lt;stop daemons, perhaps with the killproc function&amp;gt; part with the command given to you:&lt;/P&gt;&lt;PRE&gt;stop() {
        echo -n "Shutting down informatica: "
        /eai/apps/informatica/PowerCenter/server/tomcat/bin/infaservice.sh shutdown
        RESULT=$?
        rm -f /var/lock/subsys/informatica
        return $RESULT
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you don't actually need to start the application service, you can place a command that does nothing (or just outputs a message) in the place of the application start-up command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You should also write the tags section at the beginning of the script, for example:&lt;/P&gt;&lt;PRE&gt;# chkconfig: 345 99 01
# description: This is the shutdown script for Informatica.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;(the tags section is explained at the end of the 'sysvinitfiles' file.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then save the completed script to /etc/init.d/informatica (or whatever you chose as the service name), and run "chkconfig --add informatica" to automatically create the needed links in the /etc/rc[0-6].d directories.&lt;/P&gt;</description>
    <pubDate>Thu, 09 Feb 2012 15:30:53 GMT</pubDate>
    <dc:creator>Matti_Kurkela</dc:creator>
    <dc:date>2012-02-09T15:30:53Z</dc:date>
    <item>
      <title>Shutdown script to stop a application service</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shutdown-script-to-stop-a-application-service/m-p/5544133#M53528</link>
      <description>&lt;P&gt;Dear frieds&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;I expect your help in writing a script on rhel5 for below requirement.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;On server nxETLd21, please ensure the Informatica services are automatically halted if the server is shut down.&lt;BR /&gt;The command to halt Informatica services is:&lt;BR /&gt;/eai/apps/informatica/PowerCenter/server/tomcat/bin/infaservice.sh shutdown&lt;BR /&gt;Please add the above command to the relevant OS shutdown script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basant&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2012 21:27:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shutdown-script-to-stop-a-application-service/m-p/5544133#M53528</guid>
      <dc:creator>basant</dc:creator>
      <dc:date>2012-02-08T21:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: Shutdown script to stop a application service</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shutdown-script-to-stop-a-application-service/m-p/5545069#M53529</link>
      <description>&lt;P&gt;In a RHEL5 system, there is a template for startup/shutdown scripts at:&lt;/P&gt;&lt;P&gt;/usr/share/doc/initscripts-&amp;lt;version&amp;gt;/sysvinitfiles&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The file contains explanations and an example script: you'll only need to replace the parts within &amp;lt;angle brackets&amp;gt; with the commands you want. For example, here is the part that actually stops the application:&lt;/P&gt;&lt;PRE&gt;stop() {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo -n "Shutting down &amp;lt;servicename&amp;gt;: "&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;stop daemons, perhaps with the killproc function&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rm -f /var/lock/subsys/&amp;lt;servicename&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &amp;lt;return code of stopping daemon&amp;gt;&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;You would replace the &amp;lt;servicename&amp;gt; with the name of your application (which should be the same as the name of the script), and the &amp;lt;stop daemons, perhaps with the killproc function&amp;gt; part with the command given to you:&lt;/P&gt;&lt;PRE&gt;stop() {
        echo -n "Shutting down informatica: "
        /eai/apps/informatica/PowerCenter/server/tomcat/bin/infaservice.sh shutdown
        RESULT=$?
        rm -f /var/lock/subsys/informatica
        return $RESULT
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you don't actually need to start the application service, you can place a command that does nothing (or just outputs a message) in the place of the application start-up command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You should also write the tags section at the beginning of the script, for example:&lt;/P&gt;&lt;PRE&gt;# chkconfig: 345 99 01
# description: This is the shutdown script for Informatica.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;(the tags section is explained at the end of the 'sysvinitfiles' file.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then save the completed script to /etc/init.d/informatica (or whatever you chose as the service name), and run "chkconfig --add informatica" to automatically create the needed links in the /etc/rc[0-6].d directories.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2012 15:30:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shutdown-script-to-stop-a-application-service/m-p/5545069#M53529</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2012-02-09T15:30:53Z</dc:date>
    </item>
  </channel>
</rss>

