Bug 137391

Summary: /etc/rc.d/init.d/functions action() function invalid path /etc/rhgb/temp/rhgb-console
Product: [Fedora] Fedora Reporter: Adam Jenkins <adam>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 3CC: harald, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 7.93.2-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-28 02:28:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Adam Jenkins 2004-10-28 00:30:17 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3)
Gecko/20040929
package is initscripts-7.86-1

Description of problem:
In /etc/rc.d/init.d/functions, line 438, in the action() function, is
where the error occurs, due to the script trying to write to an
invalid path when a step fails in the initscripts.  The code is part
of an if statement.  Here is the statement.

      if [ "$rc" = "0" ]; then
        echo_success > /etc/rhgb/temp/rhgb-console
      else
        echo_failed > /etc/rhgb/tmp/rhgb-console
        [ -x /usr/bin/rhgb-client ] && /usr/bin/rhgb-client --details=yes
      fi

Notice that the path being written to in the else block is different
from the path in the if block, but the should be the same.  The if
block is correct.  In the else block, "tmp" should be replaced with
"temp".

Version-Release number of selected component (if applicable):
initscripts-7.86-1

How reproducible:
Always

Steps to Reproduce:
1. You need to arrange for some initscript to fail for some reason
during bootup.  For example, if your computer is configured to
automatically bring up your ethernet connection using DHCP, then just
unplug your ethernet cable and boot.  When it runs the
/etc/init.d/network script, the ifup eth0 step will fail, and you'll
see an error message printed to your screen about an error at line 438
in /etc/rc.d/init.d/functions.
    

Additional info:

To fix the problem, simply substitute "temp" for "tmp" in the above
snippet.  Here's the correct code that should be in the action() function.

      if [ "$rc" = "0" ]; then
        echo_success > /etc/rhgb/temp/rhgb-console
      else
        echo_failed > /etc/rhgb/temp/rhgb-console
        [ -x /usr/bin/rhgb-client ] && /usr/bin/rhgb-client --details=yes
      fi

Comment 1 Bill Nottingham 2004-10-28 02:27:23 UTC
Fixed in 7.93.2-1, thanks!

Comment 2 Bill Nottingham 2004-10-28 14:22:35 UTC
*** Bug 137427 has been marked as a duplicate of this bug. ***