Details
- Reviewers
imp
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 59335 Build 56222: arc lint + arc unit
Event Timeline
NAK.
This is a bad change and should be rejected outright.
It breaks 'halt -p' since that's a hard link to reboot.
Hmmm, OK, it doesn't break halt -p. I misread a couple of things...
This is likely OK, but may surprise some people who just know reboot -p.
However, the -cp makes sense as does -ch or -cr, and they mean different things. reboot -cp means 'powercycle, if you can, otherwise power off' and -ch means 'powercycle if you can otherwise halt' and -cr means power cycle if you can, otherwise just reboot.
So while -ph doesn't seem to make sense, it is poweroff-or-halt. and -pr is 'poweroff-or-reboot'. Because the hardware is weird, you want the ability to have a fallback.
About the only thing that doesn't make sense -hr which wants you to both halt and reboot. If the reboot fails for some reason, it will de-facto halt since that hits a while (1); loop.
"-cp" is already illegal, see the check on line 303 and 304, so nothing changes in that regard. Also, "-r cannot be used with -c, -d, -n, or -p" already. I also see no "-h" option, so no "-ch" either, or am I missing anything here?
That being said, I've been bitten by this a few times. I've created this review last Friday because I accidentally powered down a system in a remote location that I can't remotely power on. When I type "reboot" with whatever arguments, I really want the system to reboot. That is to say that I really expect it to come back up shortly, not to halt or power off. While I can see that it's possible that there are people that habitually use "reboot -p" to power off a system, I really wonder why since "halt -p" is shorter to type and "poweroff" is clearer. But of course YMMV.