Bug 253861 - service power_profile should conform to standards: act on "describe" command
Summary: service power_profile should conform to standards: act on "describe" command
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: Unspecified
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-26 03:10 UTC by Walter von Entferndt
Modified: 2021-02-28 01:05 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Walter von Entferndt 2021-02-26 03:10:29 UTC
$ service power_profile describe
Usage: /etc/rc.d/power_profile [0x00|0x01]
Exitcode 1

Note: I could easily, but I do not, supply a patch.  Honestly IMHO the one who wrote that script, and noone else please, should fix that.  The reason is that I'm a little bit upset & sad about such bugs, because it's obvious that the one who wrote that script never tested it (a desc="..." is in the script).  Supplying a patch for these kind of bugs fosters the Peter's principle, i.e. people are promoted because they're doing good -> most people are overwhelmed with their duties.  I don't think it's wise to clean up after someone else, while this one does the same mistakes over & over again in his/her next projects.  Although that's typical in the business world, I'd be glad if it could be done better in the FreeBSD project.

If it's complicated & hairy, hey, to err is human.  But when it's so simple, I get nervous, to say it politely.

Regards
Comment 1 Li-Wen Hsu freebsd_committer freebsd_triage 2021-02-26 03:31:13 UTC
(In reply to Walter von Entferndt from comment #0)
desc is added to all rc scripts after power_profile is written:

https://cgit.freebsd.org/src/commit/?id=6c1a5e837d2d886042767bcc7b7255b81acc0965

To me it looks more likely a missing in a larger change. But, anyway, a bug is a bug.  I think besides fixing this (I'd like to check if it's easy to fix by myself, and/or ask help form the original author), another thing I hope you can help is we can have a way to test this in our test suites, and let the CI catch this before it effect more people.  I guess this might be more interesting to you other than just providing a simple patch?  It can help the original author and others not make the same mistake again.

Yes, as you said, to err is human, we, as computer engineers, need to overcome this through a technical way. :-)
Comment 2 Walter von Entferndt 2021-02-28 01:05:17 UTC
(In reply to Li-Wen Hsu from comment #1)
I heartily agree.  But in the spirit of my ongoing efforts to mitigate the Peter principle from spreading & creeping, IMHO that bug-catching test should be written & commited into CI by exactly the one who commited that "horrible crime". I hope it's clear "this" is ironic. That "bug" is truely a minor one; nevertheless, I'm serious with the rest of the above statement.