From owner-freebsd-arch@FreeBSD.ORG Thu May 17 09:33:05 2012 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 858F5106566C; Thu, 17 May 2012 09:33:05 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx07.syd.optusnet.com.au (fallbackmx07.syd.optusnet.com.au [211.29.132.9]) by mx1.freebsd.org (Postfix) with ESMTP id 1506E8FC15; Thu, 17 May 2012 09:33:04 +0000 (UTC) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by fallbackmx07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4H9PUjY026214; Thu, 17 May 2012 19:25:30 +1000 Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4H9PDFq006762 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 17 May 2012 19:25:14 +1000 Date: Thu, 17 May 2012 19:25:13 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh In-Reply-To: Message-ID: <20120517183044.U970@besplex.bde.org> References: <20120513220646.GA12826@stack.nl> <4FB0CF88.5010309@FreeBSD.org> <3D895644-0BA5-44F7-AC8F-07323729C1AA@bsdimp.com> <4FB40506.3000300@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Doug Barton , Jilles Tjoelker , freebsd-arch@freebsd.org Subject: Re: [patch] halt/reboot/shutdown cleanup X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 09:33:05 -0000 On Wed, 16 May 2012, Warner Losh wrote: > On May 16, 2012, at 1:50 PM, Doug Barton wrote: >> The problem is that people see the names "halt" and "reboot" and assume >> that "simpler is better" and use them. The fact that the proper way to >> reboot a FreeBSD system is 'shutdown -r' is ... just silly. > > Right, but this is the historical way things have been done, and there are many existing users who have products that depend on the difference. So the argument for change needs to be stronger. Right, they can't be renamed without breaking things. Please use the unix newline character. > I think a more proper argument could be made that the times have changed and that while it would be desirable to retain the old interface, it is more desirable to file off the rough edges from the crufty old interfaces to improve the user experience for the hordes that are coming from the Linux world. Their bevaviour with the same options also can't be changed without breaking things. > Of course, if all reboot is going to do is call shutdown -r now, then maybe it makes sense to just install a shell script called reboot and rename the current reboot to fastreboot. Quick, let's rename cp to COPY and del to DELETE. > However, I think that we can get most of what is needed here by tightening up the shutdown -r path, and reinventing[*] fasthalt and fastreboot from SunOS 4.x days. Then reboot/halt could easily be a simple shell script that invokes shutdown. This would allow the embedded folks to replace it with fast*, while allowing the enterprise customers a more uniform experience with their linux and solaris systems. And the tightening up would likely cause the developer community to not notice as much the difference, because the artificial delays have been removed. Or to add to their .profile/.cshrc files something along the lines of alias reboot fastreboot. Do you mean reinventing them from FreeBSD? fastboot and fasthalt are still standard in FreeBSD, but they have been reduced to hard links to reboot. They don't even change the action of reboot(8). No one knows about them of course (not even to the extent of noticing that they are in reboot's man page), so reboot is used directly. In FreeBSD-1 and 4.4BSD-Lite, they were shell scripts that copied /dev/null to /fastboot and then invoked reboot and halt, respectively. halt(8) has also been reduced to a hard link to reboot, but now it changes the action of reboot. It is misimplemented by making its action depend on the program name but not providing an equivalent option. > [*] I say reinventing here because IIRC fastboot also suppressed the full fsck of filesystems when the system is coming back up. with zfs, ufs + suj, the clean flag short-curcuit, etc that functionality is no longer all that useful._______________________________________________ In FreeBSD, the whole point of fastboot was to suppress fsck. It was otherwise equivalent to reboot (but never to shutdown). Now it is identical with reboot except for its name. Its reason for existence is no longer documented. In 4.4BSD-Lite2, it was: % FASTBOOT(8) FreeBSD System Manager's Manual FASTBOOT(8) % % NAME % fastboot, fasthalt -- reboot/halt the system without checking the disks % % SYNOPSIS % fastboot [boot-options] % fasthalt [halt-options] % % DESCRIPTION % Fastboot and fasthalt are shell scripts which reboot and halt the system % without checking the file systems. This is done by creating a file % /fastboot, then invoking the reboot program. The system startup script, % /etc/rc, looks for this file and, if present, skips the normal invocation % of fsck(8). % % SEE ALSO % halt(8), reboot(8), rc(8) Hmm, shutdown isn't even mentioned. % % HISTORY % The fastboot command appeared in 4.2BSD. Much (?) older than SunOS. % % 4.2 Berkeley Distribution June 5, 1993 4.2 Berkeley Distribution The old shutdown(8) references fastboot but not fasthalt. shutdown -f gave fasthalt (no longer supported) and shutdown -r gave reboot(8) (at the specified type) (it now gives a more direct reboot at the specified time). I now remember why fasthalt and fastboot went away. dg added dirty flag handling, so that a full fsck is not needed in the usual case of a clean reboot, at least for ffs. For a non-clean reboot, you shouldn't tell fsck not to run even if you could, and most non-clearn reboots are for panics which couldn't run fastboot anyway. Bruce