<?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: chkconfig issue in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/chkconfig-issue/m-p/6458082#M54602</link>
    <description>&lt;P&gt;hello.&lt;/P&gt;&lt;P&gt;I didn't understant your request :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1- link file for start/stop is created in &lt;STRONG&gt;/etc/rc.d/rc.*&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2- but when I run chkconfig tomcat on&lt;/P&gt;&lt;P&gt;link file for only startis created in &lt;STRONG&gt;/etc/rc.d/rc.*&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3- after that I ran chkconfig tomcat --add&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this time link file for start/stop is created in &lt;STRONG&gt;/etc/rc.d/rc.*&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/etc/rc.d/rc.*&lt;/STRONG&gt; ? It's not same place in three cases ?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 25 Apr 2014 19:44:28 GMT</pubDate>
    <dc:creator>boukari</dc:creator>
    <dc:date>2014-04-25T19:44:28Z</dc:date>
    <item>
      <title>chkconfig issue</title>
      <link>https://community.hpe.com/t5/operating-system-linux/chkconfig-issue/m-p/6457800#M54601</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;start/stop scripts are placed in /etc/init.d.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when I run chkconfig activemq on&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;link file for start/stop is created in /etc/rc.d/rc.*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but when I run chkconfig tomcat on&lt;/P&gt;&lt;P&gt;link file for only startis created in /etc/rc.d/rc.*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;after that I ran chkconfig tomcat --add&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this time link file for start/stop is created in /etc/rc.d/rc.*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;why there is difference in chkconfig for activemq and tomcat.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;both activemq and tomcat services are not running before executing chkconfig.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Apr 2014 14:27:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/chkconfig-issue/m-p/6457800#M54601</guid>
      <dc:creator>tempsample</dc:creator>
      <dc:date>2014-04-25T14:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: chkconfig issue</title>
      <link>https://community.hpe.com/t5/operating-system-linux/chkconfig-issue/m-p/6458082#M54602</link>
      <description>&lt;P&gt;hello.&lt;/P&gt;&lt;P&gt;I didn't understant your request :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1- link file for start/stop is created in &lt;STRONG&gt;/etc/rc.d/rc.*&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2- but when I run chkconfig tomcat on&lt;/P&gt;&lt;P&gt;link file for only startis created in &lt;STRONG&gt;/etc/rc.d/rc.*&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3- after that I ran chkconfig tomcat --add&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this time link file for start/stop is created in &lt;STRONG&gt;/etc/rc.d/rc.*&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/etc/rc.d/rc.*&lt;/STRONG&gt; ? It's not same place in three cases ?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Apr 2014 19:44:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/chkconfig-issue/m-p/6458082#M54602</guid>
      <dc:creator>boukari</dc:creator>
      <dc:date>2014-04-25T19:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: chkconfig issue</title>
      <link>https://community.hpe.com/t5/operating-system-linux/chkconfig-issue/m-p/6458292#M54603</link>
      <description>&lt;P&gt;Which Linux distribution are you using?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For chkconfig to work correctly, the script in /etc/init.d must contain some special comments at the beginning of the script (before any other non-comment lines)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For distributions using traditional SysVinit-style boot, the minimum requirements are:&lt;/P&gt;&lt;PRE&gt;# chkconfig: &amp;lt;runlevels&amp;gt; &amp;lt;start-value&amp;gt; &amp;lt;end-value&amp;gt;
# description: &amp;lt;description-text&amp;gt;&lt;/PRE&gt;&lt;UL&gt;&lt;LI&gt;&amp;nbsp;&amp;lt;runlevels&amp;gt; is the set of runlevels where the script will be enabled by default after you run "chkconfig --add". If the service shold be disabled by default, this can be just a dash "-".&lt;/LI&gt;&lt;LI&gt;&amp;lt;start-value&amp;gt; and &amp;lt;stop-value&amp;gt; will be the start/stop order values used when creating the links&lt;/LI&gt;&lt;LI&gt;&amp;lt;description-text&amp;gt; is just some text you can write freely: the only requirement is that the line must exist.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Newer Linux distributions (e.g. RHEL 6) may use dependency-based booting, which&amp;nbsp; requires a different style of comment block. Example:&lt;/P&gt;&lt;PRE&gt;### BEGIN INIT INFO
# Provides: &amp;lt;service-name&amp;gt;
# Required-Start: &amp;lt;services that must be running before this service can start&amp;gt;
# Required-Stop: &amp;lt;services that this service requires when stopping&amp;gt;
# Short-Description: &amp;lt;one-line description-text&amp;gt;
# Description: &amp;lt;multi-line description-text&amp;gt;
### END INIT INFO&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;With this, the startup/shutdown order numbers can be changed automatically whenever the chkconfig command is used, so that the Required-Start and Required-Stop lines will be satisfied.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both comment blocks can be present in the same service script: in that case, the new-style block will override the old one if the Linux distribution supports the new style. Otherwise, the new-style block will be ignored.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My guess is that satisfying the Required-Stop line in your tomcat startup/shutdown script required some adjustment of priority values, and "chkconfig tomcat stop" could not do that. But when you run "chkconfig --add tomcat", chkconfig is allowed to make more extensive changes, so it could create the stop link too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By the way, if you are creating your own start/stop scripts or modifying some third-party generic SysVinit scripts for RHEL 6, there is another thing you should be aware of.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Even if the stop link is present, the RHEL 6 /etc/rc.d/rc script (= the script that uses the start/stop links to run the service scripts in the correct order) will check for the presence of a marker file in /var/lock/subsys. So, if your service script is named "tomcat", the service script should create a file named either /var/lock/subsys/tomcat or /var/lock/subsys/tomcat.init when starting the service, and remove it when stopping the service. Otherwise, the /etc/rc.d/rc script will assume that the service has already been shut down manually and will skip stopping the service.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the part of RHEL 6 /etc/rc.d/rc script that is responsible for this logic:&lt;/P&gt;&lt;PRE&gt;[...]
# First, run the KILL scripts.
for i in /etc/rc$runlevel.d/K* ; do

        # Check if the subsystem is already up.
        subsys=${i#/etc/rc$runlevel.d/K??}
        [ -f /var/lock/subsys/$subsys -o -f /var/lock/subsys/$subsys.init ] || continue&lt;BR /&gt;[...] &lt;/PRE&gt;</description>
      <pubDate>Sat, 26 Apr 2014 08:27:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/chkconfig-issue/m-p/6458292#M54603</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2014-04-26T08:27:37Z</dc:date>
    </item>
  </channel>
</rss>

