Page MenuHomeFreeBSD

development(7): Replace "reboot" with "shutdown -r now"
ClosedPublic

Authored by 0mp on Aug 22 2018, 2:01 PM.

Details

Summary

Commit message:

We generally document shutdown(8) instead of reboot(8) as it's better for
interactive use.

Reported by: eadler

Do you have any comments on what should be the reason in the commit message? I've got a feeling that the current message is not very informative.


Note: I'll bump Dd before committing.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

0mp created this revision.Aug 22 2018, 2:01 PM
0mp edited the summary of this revision. (Show Details)Aug 22 2018, 6:10 PM
eadler accepted this revision.Aug 26 2018, 7:33 AM

Do you have any comments on what should be the reason in the commit message?

In modern FreeBSD is matterns a lot less, its mostly just convention. One minor thing is that shutdown produces a global message, while reboot does not. I believe that historically, some versions of reboot did not do appropriate safe shutdown checks and just rebooted.

Its also just consistency: for example https://www.freebsd.org/doc/handbook/boot-shutdown.html documents shutdown

This revision is now accepted and ready to land.Aug 26 2018, 7:33 AM
jilles accepted this revision.Aug 26 2018, 11:15 AM
jilles added a subscriber: jilles.

There is actually another important difference between reboot and shutdown -r now: reboot does not run /etc/rc.shutdown. This is because reboot has its own shutdown procedure and does not signal init like init 6 and shutdown -r now do (except in the case of rerooting via reboot -r).

A few years ago I proposed changing reboot's default to signalling init (preserving reboot -q which just invokes the reboot system call), but this was not accepted. Perhaps this can be tried again for 13.0.

Don't forget to update .Dd.

0mp added subscribers: krion, mat.

Thank you, @eadler & @jilles.

@krion, @mat: may I ask you for an approval to commit? Then I'll contact release engineers for the final approval.

0mp requested review of this revision.Aug 26 2018, 11:32 AM
krion accepted this revision.Aug 26 2018, 11:41 AM
This revision is now accepted and ready to land.Aug 26 2018, 11:41 AM

There is actually another important difference between reboot and shutdown -r now: reboot does not run /etc/rc.shutdown. This is because reboot has its own shutdown procedure and does not signal init like init 6 and shutdown -r now do (except in the case of rerooting via reboot -r).

I completely forgot about this...

This revision was automatically updated to reflect the committed changes.