Bug 1191775

Summary: ERROR tuned.utils.commands: Executing hdparm error: [Errno 2] No such file or directory
Product: Red Hat Enterprise Linux 7 Reporter: Scott Dodson <sdodson>
Component: tunedAssignee: Jaroslav Škarvada <jskarvad>
Status: CLOSED ERRATA QA Contact: Tereza Cerna <tcerna>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.1CC: jeder, jscotka, jskarvad, tcerna
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tuned-2.5.1-1.el7 Doc Type: Bug Fix
Doc Text:
Cause: Tuned requires hdparm tool for some functionality, but Tuned is noarch package and hdparm tool doesn't exist on all architectures. That's why hdparm cannot be specified as Tuned dependency in RPM and calls of hdparm can fail. Consequence: If hdparm package is not installed, Tuned could output a lot of errors that hdparm tool is missing. Fix: Handling of hdparm was improved in Tuned disk plugin. Result: Now if hdparm tool is missing, Tuned outputs one warning to its log and all future hdparm settings are ignored.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 12:21:23 UTC Type: Bug
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: 1190654    
Attachments:
Description Flags
patch none

Description Scott Dodson 2015-02-11 23:26:15 UTC
Created attachment 990699 [details]
patch

Description of problem:
Several tuned profiles adjust harddrive spindown intervals via the hdparm command. There's a note in the specfile that hdparm isn't available on s390x but it's available on x86_64 and should be included as a dependency or the code updated not to call it.

Version-Release number of selected component (if applicable):
tuned-2.4.1-1.el7.noarch

How reproducible:
100%

Steps to Reproduce:
1. yum remove hdparm
2. yum install tuned
3. tuned-adm profile throughput-performance
4. grep ERROR /var/log/tuned/tuned.log


Actual results:
2015-02-11 10:26:51,689 ERROR    tuned.utils.commands: Executing hdparm error: [Errno 2] No such file or directory
2015-02-11 10:26:51,717 ERROR    tuned.utils.commands: Executing hdparm error: [Errno 2] No such file or directory
2015-02-11 10:26:51,721 ERROR    tuned.utils.commands: Executing hdparm error: [Errno 2] No such file or directory
2015-02-11 10:48:18,016 ERROR    tuned.utils.commands: Executing hdparm error: [Errno 2] No such file or directory



Expected results:
no errors, hdparm is installed

Additional info:

Comment 2 Jaroslav Škarvada 2015-02-12 09:14:29 UTC
Unfortunately it is not as easy as it seems. Tuned is noarch, and we want to keep it noarch as long as possible. Thus the non arch package can be build on any arch and conditionals proposed in your patch maybe useless/wrong in this case. AFAIK there is no support in RPM for optional deps so there are probably two possibilities:

- keep it as loose deps, i.e. as is
- make it arch package, it means build/package/store the same binary bits multiple times just with different deps in header.

Comment 3 Jaroslav Škarvada 2015-06-16 16:03:41 UTC
I improved it a bit in upstream commmit:
https://git.fedorahosted.org/cgit/tuned.git/commit/?id=f35bdee22efc9b280e2a953d4264f6e1afa8d4d6

It reports now first error:
ERROR    tuned.utils.commands: Executing hdparm error: [Errno 2] No such file or directory
INFO     tuned.plugins.plugin_disk: hdparm command not found, ignoring future set_apm / set_spindown commands

and all future hdparms related command are ignored in the session.

Spindown and APM is not concern with SSDs, so maybe better not to bother users with this error. I will probably change INFO to WARN and drop the error completely, I am not 100% sure now. This is probably the best we can currently do about it.

Comment 4 Jaroslav Škarvada 2015-06-18 08:01:23 UTC
(In reply to Jaroslav Škarvada from comment #3)
> Spindown and APM is not concern with SSDs, so maybe better not to bother
> users with this error. I will probably change INFO to WARN and drop the
> error completely, I am not 100% sure now. This is probably the best we can
> currently do about it.

Fixed in upstream commit:
https://git.fedorahosted.org/cgit/tuned.git/commit/?id=e2837a5dfa20a8181b66db82da5722ebb60e8b02

Comment 8 errata-xmlrpc 2015-11-19 12:21:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2375.html