Re: Should reboot(8) be modified so that it can become the recommended way to reboot a system?
Date: Tue, 11 Feb 2025 08:45:21 UTC
Am 2025-02-10 18:04, schrieb Warner Losh: > On Sun, Feb 9, 2025 at 10:00 AM Poul-Henning Kamp <phk@phk.freebsd.dk> > wrote: > >> -------- >> Daniel Tameling writes: >> >>> Part of the problem is that reboot indeed reboots the system. >> >> I understand what you are saying, but there's no way it can be a >> "problem" that a command called "reboot" reboots the system :-) >> >> If we dont want to make this a flag-day and break a lot of scripts, >> and other automation, the only option, is to make reboot(8) and >> halt(8) print a message and sleep long enough that people can >> change their mind. >> >> My suggestion would be: >> >> If reboot(8) or halt(8) is invoked with any other argument than >> '-p', they behave as documented today. >> >> If they are invoked without arguments, or with only the '-p' argument, >> it goes something like: >> >> # reboot >> >> If you want things to be stop nicely: >> >> Press CTRL-C now, and use the shutdown(8) command instead. >> >> 3 >> 2 >> 1 >> rebooting >> >> That clearly communicates what the concern is, gives people a sensible >> chance to change their mind, and does not break any existing scripts. > > I have a contrary view. I think we should make some changes. But we > can't just exec shutdown, the args / history / evolution of reboot is > too complicated for that. I have scripts which rely on "reboot" to not kill processes or run scripts. Those are some kind of "automatic repair for bugs which are not easily fixed" scripts (those temporary fixes which stay forever). I have no problem to change that, but I expect that a lot of the situations where reboot is used, it is because of the hard reboot without caring about processes and stop scripts. If you do not come up with something makes people aware very loudly about this change, it may cause grief. Additionally I think there was a discussion about exactly the same topic in the past. Years ago. Maybe more than 10 years ago. There were similar concerns about POLA. Bye, Alexander. -- http://www.Leidinger.net Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0x8F31830F9F2772BF