Skip to content

Ignore spurious error when setting APM#3076

Open
tjkirch wants to merge 1 commit intorockstor:testingfrom
tjkirch:3075_apm_ignore_spurious_error
Open

Ignore spurious error when setting APM#3076
tjkirch wants to merge 1 commit intorockstor:testingfrom
tjkirch:3075_apm_ignore_spurious_error

Conversation

@tjkirch
Copy link

@tjkirch tjkirch commented Feb 16, 2026

Fixes #3075

See friendly forum thread: https://forum.rockstor.com/t/apm-not-persisted-due-to-spurious-drive-error/10857

In short, when running hdparm commands on certain drives (at least a couple of Seagate and Western Digital USB drives) it will return 0 but give a spurious error when setting some options, including the APM setting -B needed for spindown to work. The operation does work regardless of the message in stderr.

Before this change, I had to use a systemd service override to force in the -B 127 setting. Trying to set it in Rockstor's spindown interface did nothing because of the conditional being modified in this PR, and the error would show up in Rockstor logs.

This change checks for the specific spurious error message and continues if that's all it sees and the command returned 0. (The new function could be used in other places if the same spurious error is preventing other actions, but I haven't run into any others.)

Testing:

I tested the new function on its own against a bunch of good and bad arguments to be sure it only excused the specific error under discussion. Then I tested on my Rockstor server and confirmed that the systemd service has the requested -B option without an override.

@phillxnet phillxnet added the needs review Ideally by prior rockstor-core contributor label Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs review Ideally by prior rockstor-core contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants