<?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: halting some application in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/halting-some-application/m-p/3838388#M24601</link>
    <description>Hi Muhammad,&lt;BR /&gt;&lt;BR /&gt;What OS do you have....??&lt;BR /&gt;&lt;BR /&gt;If you have linux, then the best way is to put the script at the location "/etc/init.d/&amp;lt;script&amp;gt;"&lt;BR /&gt;&lt;BR /&gt;After this, go to /etc/rc.d/rc0.d/ and create a symlink to the file using the command ---&lt;BR /&gt;&lt;BR /&gt;ln -s /etc/rc.d/rc0.d/&lt;KSCRIPTNAME&gt; &lt;ABSOLUTEPATH for="" your="" script=""&gt;&lt;/ABSOLUTEPATH&gt;&lt;BR /&gt;&lt;BR /&gt;The reason behind is simple, when we halt the system, it changes the init level to 0 and after that it reads the directory rc0.d where it finds all the KILL SCRIPTS that needs to be stopped, so when it will find your script as well, it will stop that particular process/service.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;Atul&lt;/KSCRIPTNAME&gt;</description>
    <pubDate>Mon, 07 Aug 2006 08:46:45 GMT</pubDate>
    <dc:creator>Atul Gautam</dc:creator>
    <dc:date>2006-08-07T08:46:45Z</dc:date>
    <item>
      <title>halting some application</title>
      <link>https://community.hpe.com/t5/operating-system-linux/halting-some-application/m-p/3838383#M24596</link>
      <description>Hello,&lt;BR /&gt;     We want to halt some application through scripts...for example when we shutdown the server ...first it run the script and halt the application and then it shutdown the server..so i want to know where we will reside the halting script so that it works while shutting down the server</description>
      <pubDate>Mon, 07 Aug 2006 06:34:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/halting-some-application/m-p/3838383#M24596</guid>
      <dc:creator>Muhammad Shamroze</dc:creator>
      <dc:date>2006-08-07T06:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: halting some application</title>
      <link>https://community.hpe.com/t5/operating-system-linux/halting-some-application/m-p/3838384#M24597</link>
      <description>if run any command the first what system do is checking directories in PATH variable&lt;BR /&gt;&lt;BR /&gt;so make a script for shuting aplication and on the end give shutdown command....&lt;BR /&gt;&lt;BR /&gt;find where halt is, it should be in /usr/bin or  /sbin&lt;BR /&gt;&lt;BR /&gt;so make ln -s your_script /bin/halt&lt;BR /&gt;&lt;BR /&gt;now because /bin is before /usr/bin or /sbin (check PATH) so it will run your script...</description>
      <pubDate>Mon, 07 Aug 2006 06:44:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/halting-some-application/m-p/3838384#M24597</guid>
      <dc:creator>g33k</dc:creator>
      <dc:date>2006-08-07T06:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: halting some application</title>
      <link>https://community.hpe.com/t5/operating-system-linux/halting-some-application/m-p/3838385#M24598</link>
      <description>one thing more i want to tell u that im using Redhat Linux AS 4.....</description>
      <pubDate>Mon, 07 Aug 2006 06:45:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/halting-some-application/m-p/3838385#M24598</guid>
      <dc:creator>Muhammad Shamroze</dc:creator>
      <dc:date>2006-08-07T06:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: halting some application</title>
      <link>https://community.hpe.com/t5/operating-system-linux/halting-some-application/m-p/3838386#M24599</link>
      <description>Thanks for reply as u r not getting what im trying to say i want to shutdown some of my services automated mean to say when i run init 6 all my services which i mentioned in my script should also shutdown</description>
      <pubDate>Mon, 07 Aug 2006 07:56:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/halting-some-application/m-p/3838386#M24599</guid>
      <dc:creator>Muhammad Shamroze</dc:creator>
      <dc:date>2006-08-07T07:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: halting some application</title>
      <link>https://community.hpe.com/t5/operating-system-linux/halting-some-application/m-p/3838387#M24600</link>
      <description>as I said you create script with lines:&lt;BR /&gt;&lt;BR /&gt;services sshd stop&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;&lt;BR /&gt;/sbin/halt (or where is your original halt)&lt;BR /&gt;&lt;BR /&gt;and you name this script as halt and place it in /bin&lt;BR /&gt;&lt;BR /&gt;it's OK if you know your sevices and it's OK&lt;BR /&gt;&lt;BR /&gt;other way is make script which, find services you wanna stop before halting system.... &lt;BR /&gt;ps will give you list of services... then grep, and cut will help you to find PIDs of services you wanna stop and next you stop them with kill PID or (but it's not very nice kill -9 PID)&lt;BR /&gt;&lt;BR /&gt;here is documentation which will help you with scripts... &lt;A href="http://www.tldp.org/LDP/abs/html/" target="_blank"&gt;http://www.tldp.org/LDP/abs/html/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;man grep&lt;BR /&gt;man ps&lt;BR /&gt;man kill&lt;BR /&gt;&lt;BR /&gt;will help you with commands you will need...&lt;BR /&gt;anyway if something is unclear you can ask</description>
      <pubDate>Mon, 07 Aug 2006 08:30:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/halting-some-application/m-p/3838387#M24600</guid>
      <dc:creator>g33k</dc:creator>
      <dc:date>2006-08-07T08:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: halting some application</title>
      <link>https://community.hpe.com/t5/operating-system-linux/halting-some-application/m-p/3838388#M24601</link>
      <description>Hi Muhammad,&lt;BR /&gt;&lt;BR /&gt;What OS do you have....??&lt;BR /&gt;&lt;BR /&gt;If you have linux, then the best way is to put the script at the location "/etc/init.d/&amp;lt;script&amp;gt;"&lt;BR /&gt;&lt;BR /&gt;After this, go to /etc/rc.d/rc0.d/ and create a symlink to the file using the command ---&lt;BR /&gt;&lt;BR /&gt;ln -s /etc/rc.d/rc0.d/&lt;KSCRIPTNAME&gt; &lt;ABSOLUTEPATH for="" your="" script=""&gt;&lt;/ABSOLUTEPATH&gt;&lt;BR /&gt;&lt;BR /&gt;The reason behind is simple, when we halt the system, it changes the init level to 0 and after that it reads the directory rc0.d where it finds all the KILL SCRIPTS that needs to be stopped, so when it will find your script as well, it will stop that particular process/service.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;Atul&lt;/KSCRIPTNAME&gt;</description>
      <pubDate>Mon, 07 Aug 2006 08:46:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/halting-some-application/m-p/3838388#M24601</guid>
      <dc:creator>Atul Gautam</dc:creator>
      <dc:date>2006-08-07T08:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: halting some application</title>
      <link>https://community.hpe.com/t5/operating-system-linux/halting-some-application/m-p/3838389#M24602</link>
      <description>plus to atul those scripts should be executable...</description>
      <pubDate>Mon, 07 Aug 2006 09:21:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/halting-some-application/m-p/3838389#M24602</guid>
      <dc:creator>g33k</dc:creator>
      <dc:date>2006-08-07T09:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: halting some application</title>
      <link>https://community.hpe.com/t5/operating-system-linux/halting-some-application/m-p/3838390#M24603</link>
      <description>Thanks for reply&lt;BR /&gt;I tried this to put in rc0.d directory, some how it is not working. But if I put this script in rc6.d and shutdown the system with init 6 command it performs well and doing all which I mentioned in script.Do u think is there any problem in K number which number I should use.Also one thing when I tried with S number in rc0.d directory it call the script but all services goes down before activating this script so many resources it can't find which is necessary for this script.</description>
      <pubDate>Mon, 07 Aug 2006 10:22:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/halting-some-application/m-p/3838390#M24603</guid>
      <dc:creator>Muhammad Shamroze</dc:creator>
      <dc:date>2006-08-07T10:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: halting some application</title>
      <link>https://community.hpe.com/t5/operating-system-linux/halting-some-application/m-p/3838391#M24604</link>
      <description>I suggest reading the man page of init. It will clarify for you the order in which scripts are executed</description>
      <pubDate>Mon, 07 Aug 2006 19:03:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/halting-some-application/m-p/3838391#M24604</guid>
      <dc:creator>Manuel Wolfshant</dc:creator>
      <dc:date>2006-08-07T19:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: halting some application</title>
      <link>https://community.hpe.com/t5/operating-system-linux/halting-some-application/m-p/3838392#M24605</link>
      <description>Hey Muhammad,&lt;BR /&gt;&lt;BR /&gt;As you have specified that when you put S in front of this script, it is killed at the end and few other services that are needed for this script to run are killed before this one gets executed. &lt;BR /&gt;&lt;BR /&gt;So, to resolve this problem, after S try putting in a no. like 01, so that it will be the first to get executed and all other scripts will get executed after this but it may be possible that you may have to change the nos. present on other scripts as well.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;Atul</description>
      <pubDate>Tue, 08 Aug 2006 00:54:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/halting-some-application/m-p/3838392#M24605</guid>
      <dc:creator>Atul Gautam</dc:creator>
      <dc:date>2006-08-08T00:54:56Z</dc:date>
    </item>
  </channel>
</rss>

