<?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: Redhat chkconfig script: does the 'stop' ever run? in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/redhat-chkconfig-script-does-the-stop-ever-run/m-p/3971838#M27583</link>
    <description>With the "reboot" or "shutdown -r now" commands. No differences found using the first or the 2nd one....&lt;BR /&gt;/sbin/reboot is a link to halt.&lt;BR /&gt;</description>
    <pubDate>Thu, 29 Mar 2007 08:10:18 GMT</pubDate>
    <dc:creator>LBertoglio</dc:creator>
    <dc:date>2007-03-29T08:10:18Z</dc:date>
    <item>
      <title>Redhat chkconfig script: does the 'stop' ever run?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/redhat-chkconfig-script-does-the-stop-ever-run/m-p/3971834#M27579</link>
      <description>Hi all.&lt;BR /&gt;It seems that the "stop" part of some scripts listed in chkconf on my redhat AS 4.4 are never executed (but some are).&lt;BR /&gt;To show this, i created a test script, /etc/init.d/leo :&lt;BR /&gt;#!/bin/bash&lt;BR /&gt;# chkconfig: 345 99 01&lt;BR /&gt;# description: leonardo test&lt;BR /&gt;# source function library&lt;BR /&gt;. /etc/init.d/functions&lt;BR /&gt;case "$1" in&lt;BR /&gt; start)&lt;BR /&gt;        echo -n "starting leonardo"&lt;BR /&gt;        echo "$(date): $1" &amp;gt;/tmp/leo_start&lt;BR /&gt;        ;;&lt;BR /&gt; stop)&lt;BR /&gt;        echo -n "stopping leonardo"&lt;BR /&gt;        echo "$(date): $1" &amp;gt;/tmp/leo_stop&lt;BR /&gt;        ;;&lt;BR /&gt; *)&lt;BR /&gt;        echo -n "others leonardo"&lt;BR /&gt;        echo "$(date): $1" &amp;gt;/tmp/leo_others&lt;BR /&gt;        exit 1&lt;BR /&gt;esac&lt;BR /&gt;exit 0&lt;BR /&gt;#########&lt;BR /&gt;Then I did: chmod 755, chown root:root,&lt;BR /&gt;chkconfig --add leo.&lt;BR /&gt;ll /etc/rc?.d/*leo*&lt;BR /&gt;.../etc/rc6.d/K01leonardo -&amp;gt; ../init.d/leonardo&lt;BR /&gt;.../etc/rc5.d/S99leonardo -&amp;gt; ../init.d/leonardo&lt;BR /&gt;.../etc/rc4.d/S99leonardo -&amp;gt; ../init.d/leonardo&lt;BR /&gt;.../etc/rc3.d/S99leonardo -&amp;gt; ../init.d/leonardo&lt;BR /&gt;.../etc/rc1.d/K01leonardo -&amp;gt; ../init.d/leonardo&lt;BR /&gt;.../etc/rc0.d/K01leonardo -&amp;gt; ../init.d/leonardo&lt;BR /&gt;Also 'chkconfig --list leonardo' give the expected output.&lt;BR /&gt;This script works fine when is executed from the command line with start|stop|SmthingElse parameters.&lt;BR /&gt;But after a reboot of the server, I just can find a /tmp/leo_start file, and a "starting leo" line in /var/log/messages, but NEVER a /tmp/leo_stop or a "stopping leo" message, nor a mail for root, or smthing like that.&lt;BR /&gt;So it seems that the script is never executed by the system with a "stop" parameter when the server is rebooted. And that the K01leonardo links are unuseful...&lt;BR /&gt;What am I missing???&lt;BR /&gt;Many thanks in advance to everybody.&lt;BR /&gt;Leonardo.&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Mar 2007 05:25:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/redhat-chkconfig-script-does-the-stop-ever-run/m-p/3971834#M27579</guid>
      <dc:creator>LBertoglio</dc:creator>
      <dc:date>2007-03-29T05:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: Redhat chkconfig script: does the 'stop' ever run?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/redhat-chkconfig-script-does-the-stop-ever-run/m-p/3971835#M27580</link>
      <description>A typical UNIX system deletes everything in /tmp folder upon boot. Many Linux sysadmins choose to do the same with script or other means.&lt;BR /&gt;I'd recomend you to use another folder for your tests.&lt;BR /&gt;Regards.</description>
      <pubDate>Thu, 29 Mar 2007 06:45:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/redhat-chkconfig-script-does-the-stop-ever-run/m-p/3971835#M27580</guid>
      <dc:creator>Alexander Chuzhoy</dc:creator>
      <dc:date>2007-03-29T06:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: Redhat chkconfig script: does the 'stop' ever run?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/redhat-chkconfig-script-does-the-stop-ever-run/m-p/3971836#M27581</link>
      <description>No: /tmp contains also old files. Anyway I moved the files creation to /root/leo_xxx, but nothing changed: just the start file appeared after reboot.&lt;BR /&gt;Thanks anyway.&lt;BR /&gt;L.&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Mar 2007 07:46:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/redhat-chkconfig-script-does-the-stop-ever-run/m-p/3971836#M27581</guid>
      <dc:creator>LBertoglio</dc:creator>
      <dc:date>2007-03-29T07:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: Redhat chkconfig script: does the 'stop' ever run?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/redhat-chkconfig-script-does-the-stop-ever-run/m-p/3971837#M27582</link>
      <description>How do you reboot the server?</description>
      <pubDate>Thu, 29 Mar 2007 08:01:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/redhat-chkconfig-script-does-the-stop-ever-run/m-p/3971837#M27582</guid>
      <dc:creator>Jerome Forissier</dc:creator>
      <dc:date>2007-03-29T08:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: Redhat chkconfig script: does the 'stop' ever run?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/redhat-chkconfig-script-does-the-stop-ever-run/m-p/3971838#M27583</link>
      <description>With the "reboot" or "shutdown -r now" commands. No differences found using the first or the 2nd one....&lt;BR /&gt;/sbin/reboot is a link to halt.&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Mar 2007 08:10:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/redhat-chkconfig-script-does-the-stop-ever-run/m-p/3971838#M27583</guid>
      <dc:creator>LBertoglio</dc:creator>
      <dc:date>2007-03-29T08:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: Redhat chkconfig script: does the 'stop' ever run?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/redhat-chkconfig-script-does-the-stop-ever-run/m-p/3971839#M27584</link>
      <description>Ciao Leonardo,&lt;BR /&gt;&lt;BR /&gt;usually when you use chkconfig, the script is copied into /etc/init.d and configured for start/stop into rc.x level.&lt;BR /&gt;&lt;BR /&gt;Check if into /etc/init.d your script is present.&lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Thu, 29 Mar 2007 08:18:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/redhat-chkconfig-script-does-the-stop-ever-run/m-p/3971839#M27584</guid>
      <dc:creator>Alpha977</dc:creator>
      <dc:date>2007-03-29T08:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: Redhat chkconfig script: does the 'stop' ever run?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/redhat-chkconfig-script-does-the-stop-ever-run/m-p/3971840#M27585</link>
      <description>excuse me, bad read!&lt;BR /&gt;&lt;BR /&gt;Sorry&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;when you reboot the server, the tmp folder became empty.&lt;BR /&gt;When you shutdown the system, it go into runlevel 0 and have to kill all the process.&lt;BR /&gt;Your script write into tmp the "leo_stop" but this is erased at reboot, infact you can find only the start.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Try to put your start/stop result into another folder and reboot, i'm sure you can find all.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Thu, 29 Mar 2007 08:30:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/redhat-chkconfig-script-does-the-stop-ever-run/m-p/3971840#M27585</guid>
      <dc:creator>Alpha977</dc:creator>
      <dc:date>2007-03-29T08:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: Redhat chkconfig script: does the 'stop' ever run?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/redhat-chkconfig-script-does-the-stop-ever-run/m-p/3971841#M27586</link>
      <description>Hi,&lt;BR /&gt;file creation changed to /root ; and anyway /tmp is not emptyed at boot, so it seems. And yes, the script "leo" is in /etc/init.d.&lt;BR /&gt;But no good news after the reboot.&lt;BR /&gt;Some other suggestions?&lt;BR /&gt;Many thanks. &lt;BR /&gt;Leonardo.&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Mar 2007 09:05:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/redhat-chkconfig-script-does-the-stop-ever-run/m-p/3971841#M27586</guid>
      <dc:creator>LBertoglio</dc:creator>
      <dc:date>2007-03-29T09:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: Redhat chkconfig script: does the 'stop' ever run?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/redhat-chkconfig-script-does-the-stop-ever-run/m-p/3971842#M27587</link>
      <description>Hm,&lt;BR /&gt;what happens if you execute:&lt;BR /&gt;/etc/rc0.d/K01leonardo ?&lt;BR /&gt;&lt;BR /&gt;I suppose it should bring you closer to the solution, i.e. if it'll create the /tmp/leo_stop file, then (unless it's a bug of course) you should consider rewriting your script to create a file in another folder.</description>
      <pubDate>Thu, 29 Mar 2007 09:06:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/redhat-chkconfig-script-does-the-stop-ever-run/m-p/3971842#M27587</guid>
      <dc:creator>Alexander Chuzhoy</dc:creator>
      <dc:date>2007-03-29T09:06:13Z</dc:date>
    </item>
    <item>
      <title>Re: Redhat chkconfig script: does the 'stop' ever run?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/redhat-chkconfig-script-does-the-stop-ever-run/m-p/3971843#M27588</link>
      <description>Hi.&lt;BR /&gt;Running as root&lt;BR /&gt; /etc/rc0.d/K01leonardo stop&lt;BR /&gt;works fine, and create the /root/leo_stop file (as the "new" script version has /tmp changed in /root).&lt;BR /&gt;But after the 'shutdown -r now' command is completed, in /root just the leo_start exists. Nothing changed, no leo_stop file!&lt;BR /&gt;L.&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Mar 2007 09:28:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/redhat-chkconfig-script-does-the-stop-ever-run/m-p/3971843#M27588</guid>
      <dc:creator>LBertoglio</dc:creator>
      <dc:date>2007-03-29T09:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: Redhat chkconfig script: does the 'stop' ever run?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/redhat-chkconfig-script-does-the-stop-ever-run/m-p/3971844#M27589</link>
      <description>It won't run the stop scripts unless /var/lock/subsys/leonardo exists.</description>
      <pubDate>Thu, 29 Mar 2007 10:38:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/redhat-chkconfig-script-does-the-stop-ever-run/m-p/3971844#M27589</guid>
      <dc:creator>Heironimus</dc:creator>
      <dc:date>2007-03-29T10:38:08Z</dc:date>
    </item>
    <item>
      <title>Re: Redhat chkconfig script: does the 'stop' ever run?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/redhat-chkconfig-script-does-the-stop-ever-run/m-p/3971845#M27590</link>
      <description>Great !! That's it!&lt;BR /&gt;Could you please tell me how the "/var/lock/subsys" directory works?&lt;BR /&gt;Do have I to create that "leonardo" file (now disappeared) during the "start" part of the script?&lt;BR /&gt;Many thanks !!&lt;BR /&gt;Leonardo.&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Mar 2007 10:58:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/redhat-chkconfig-script-does-the-stop-ever-run/m-p/3971845#M27590</guid>
      <dc:creator>LBertoglio</dc:creator>
      <dc:date>2007-03-29T10:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: Redhat chkconfig script: does the 'stop' ever run?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/redhat-chkconfig-script-does-the-stop-ever-run/m-p/3971846#M27591</link>
      <description>Just add a "touch /var/lock/subsys/scriptname" to your start. Add "rm -f /var/lock/subsys/..." to your stop.&lt;BR /&gt;&lt;BR /&gt;For some reason Red Hat decided to have their rc script only run a stop if /var/lock/subsys/scriptname  or /var/lock/subsys/scriptname.init exists. That breaks compatibility with generic SysV-style scripts, but the truth is that most processes are safe to just kill. Most of the ones that aren't are things that people prefer to manually stop before a planned reboot anyway.</description>
      <pubDate>Thu, 29 Mar 2007 12:38:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/redhat-chkconfig-script-does-the-stop-ever-run/m-p/3971846#M27591</guid>
      <dc:creator>Heironimus</dc:creator>
      <dc:date>2007-03-29T12:38:22Z</dc:date>
    </item>
  </channel>
</rss>

