Bug 527701

Summary: microcode_ctl init script syntax error
Product: [Fedora] Fedora Reporter: Edward Sheldrake <ejsheldrake>
Component: microcode_ctlAssignee: Anton Arapov <anton>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 12CC: anton, frankly3d, justin, kmcmartin, mnowak, nobody, orion, ppokorny, psj, redhat-bugzilla
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 584910 (view as bug list) Environment:
Last Closed: 2010-05-26 09:31:09 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:
Bug Depends On:    
Bug Blocks: 584910    
Attachments:
Description Flags
init script with both problems fixed
none
Fix init script output
none
Alternate script that fixes an issue with AMD microcode updates not printing OK/FAILURE none

Description Edward Sheldrake 2009-10-07 12:21:29 UTC
Created attachment 363962 [details]
init script with both problems fixed

Description of problem:
[root@ejs-desktop ~]# /etc/rc.d/init.d/microcode_ctl start
/etc/rc.d/init.d/microcode_ctl: line 52: syntax error near unexpected token `}'
/etc/rc.d/init.d/microcode_ctl: line 52: `}'

Also, on fixing the syntax error, it doesn't print the "[  OK  ]" or "[FAILED]" anymore.

Version-Release number of selected component (if applicable):
microcode_ctl-1.17-1.55.fc12

How reproducible:
Always.

Steps to Reproduce:
1. (as root) service microcode_ctl start
2.
3.
  
Actual results:
Syntax error.

Expected results:
Applying Intel CPU microcode update:                       [  OK  ]

Additional info:
It looks like bash doesn't allow empty functions. The empty stop function and references to it could be removed.

Comment 1 Bug Zapper 2009-11-16 13:21:32 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle.
Changing version to '12'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 2 Edward Sheldrake 2009-11-23 20:45:35 UTC
microcode_ctl-1.17-1.55.fc12 isn't in Fedora 12 or even rawhide, only koji.

Comment 3 acount closed by user 2009-12-07 16:08:15 UTC
microcode_ctl-1.17-1.56.fc12 from updates-testing is still broken:

# /etc/init.d/microcode_ctl start
/etc/init.d/microcode_ctl: line 59: syntax error near unexpected token `}'
/etc/init.d/microcode_ctl: line 59: `}'

Comment 4 Frank Murphy 2009-12-15 11:21:39 UTC
Seems to be now fixed with:
http://koji.fedoraproject.org/koji/buildinfo?buildID=144680

Comment 5 Edward Sheldrake 2009-12-16 21:21:29 UTC
Created attachment 378853 [details]
Fix init script output

There's no syntax error in microcode_ctl-1.17-1.57.fc12, but the init script still doesn't output the [  OK  ] or [FAILED], the line that is printed is with "echo -n" so the message from whatever starts next will be printed on the same line.

Also the init script's "Usage:" line doesn't print out correctly due to a stray $ (the first one).

Comment 6 Edward Sheldrake 2009-12-16 21:38:41 UTC
Re-opening.

Comment 7 Robert Scheck 2009-12-26 16:02:48 UTC
Still busted. Note, the initscript misses a "\n" as well, it's just 2 lines
and not three as bugzilla will make it. The third line with the prompt is
directly appended to the second.

[root@tux ~]# /etc/init.d/microcode_ctl start 
Applying Intel CPU microcode update: Applying Intel CPU microcode update: [root@tux ~]#

Comment 8 Philip Pokorny 2010-04-22 17:12:20 UTC
Also an issue with Red Hat 6 beta.

Comment 9 Philip Pokorny 2010-04-22 19:15:47 UTC
Created attachment 408426 [details]
Alternate script that fixes an issue with AMD microcode updates not printing OK/FAILURE

Updated version of script that fixes logic issue where AMD updates wouldn't print OK/FAILURE

Also attached to cloned bug 584910

Comment 10 Justin Clift 2010-04-29 08:22:56 UTC
Hi Philip,

Nice that it supports both Intel and AMD.

Only one query... unsure about the hard coded exit returning 0 in the "start" section of the main case statement.

Is it possible for the start() function to return an error (ie something went wrong), and this needing to be indicated to the user as [FAILED]?

Thinking "exit $RETVAL" may achieve that?

Comment 11 Michal Nowak 2010-05-03 10:58:53 UTC
*** Bug 546594 has been marked as a duplicate of this bug. ***

Comment 12 Anton Arapov 2010-05-26 09:31:09 UTC
this was fixed a while ago.