<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>3612</bug_id>
          
          <creation_ts>2012-12-17 06:26:34 +0000</creation_ts>
          <short_desc>sysv init scripts don&apos;t take the consistent format.</short_desc>
          <delta_ts>2013-02-27 03:27:43 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>11</classification_id>
          <classification>Runtime</classification>
          <product>System Startup</product>
          <component>system-startup</component>
          <version>1.4</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>NOTABUG</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.4 M4</target_milestone>
          <dependson>3611</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Chen Qi">Qi.Chen</reporter>
          <assigned_to name="Chen Qi">Qi.Chen</assigned_to>
          <cc>kevin.tian</cc>
    
    <cc>liezhi.yang</cc>
    
    <cc>sgw</cc>
    
    <cc>yi.zhao</cc>
    
    <cc>zhenfeng.zhao</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>28319</commentid>
    <comment_count>0</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2012-12-17 06:26:34 +0000</bug_when>
    <thetext>Init scripts in yocto don&apos;t take the consistent format. Some have do_start(), do_stop() in them, others don&apos;t. In particular, the &apos;rc&apos; program invokes these boot scripts in different ways according to their suffixes. See the code snippet below.
startup() {
  # Handle verbosity
  [ &quot;$VERBOSE&quot; = very ] &amp;&amp; echo &quot;INIT: Running $@...&quot;

  case &quot;$1&quot; in
        *.sh)
                 # Source shell script for speed.
                (
                        trap - INT QUIT TSTP
                        scriptname=$1
                        shift
                        . $scriptname
                )
                ;;
        *)
                &quot;$@&quot;
                ;;
  esac
  startup_progress
}

This is weird and inappropriate. In newer version of these sysvinit scripts, this problem has been fixed. So I think we should fix it too.

We may need a directory, e.g., /lib/init/ to keep all wrapper functions, hook functions and aux functions. We should not put these functions under /init.d because in essence, they are not init scripts or daemons, they only provide some functionalities that those initscripts may need.

For what&apos;s its worth, here&apos;s some guidelines about sysv style boot scritps stated in boot(7).
For each managed service (mail, nfs server, cron, etc.) there is a single startup script located in a specific directory (/etc/init.d in most versions of Linux). Each of these scripts accepts as a single argument the word &quot;start&quot; -- causing it to start the service, or the word &quot;stop&quot; -- causing it to stop the service. The script may optionally accept other &quot;convenience&quot; parameters (e.g: &quot;restart&quot;, to stop and then start, &quot;status&quot; do display the service status). Running the script without parameters displays the possible arguments.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>28320</commentid>
    <comment_count>1</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2012-12-17 06:28:03 +0000</bug_when>
    <thetext>I&apos;d like to mark this bug to be related to bug#3611 and bug#3435 as they all involve sysv init scripts optimization.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>28693</commentid>
    <comment_count>2</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2013-01-10 02:54:47 +0000</bug_when>
    <thetext>I changed to the milestone to 1.4M3 because it turned out that this bug should be solved as soon as possible.

Take hwclock.sh as an example.
Although there are symlinks in /etc/rc[2345].d/ like &apos;Sxxhwclock.sh -&gt; ../init.d/hwclock.sh&apos;, they actually have no real effects! And the reason is just because they end up with &apos;.sh&apos;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>30160</commentid>
    <comment_count>3</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2013-02-27 03:27:43 +0000</bug_when>
    <thetext>I made a mistake and there&apos;s no such bug.
Sorry for that.

Mark this bug as RESOLVED/NOTABUG.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>