Page MenuHomeFreeBSD

reboot: powering off and rebooting at the same time doesn't make sense
Needs RevisionPublic

Authored by rosenfeld_grumpf.hope-2000.org on Fri, Sep 6, 10:05 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Sep 24, 3:02 AM
Unknown Object (File)
Tue, Sep 24, 1:10 AM
Unknown Object (File)
Tue, Sep 24, 12:35 AM
Unknown Object (File)
Sun, Sep 22, 1:46 PM
Unknown Object (File)
Sun, Sep 22, 2:23 AM
Unknown Object (File)
Fri, Sep 20, 10:47 PM
Unknown Object (File)
Thu, Sep 19, 1:44 PM
Unknown Object (File)
Wed, Sep 18, 5:18 PM
Subscribers

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

imp requested changes to this revision.Fri, Sep 6, 4:13 PM

NAK.

This is a bad change and should be rejected outright.

It breaks 'halt -p' since that's a hard link to reboot.

This revision now requires changes to proceed.Fri, Sep 6, 4:13 PM

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.