From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 19:00:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id F385510656A4; Fri, 31 Dec 2010 19:00:58 +0000 (UTC) Date: Fri, 31 Dec 2010 19:00:58 +0000 From: Alexander Best To: Erik Trulsson Message-ID: <20101231190058.GA79467@freebsd.org> References: <201012301806.oBUI6VcW046731@svn.freebsd.org> <20101231144308.GA55052@stack.nl> <20101231165552.GA24854@owl.midgard.homeip.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101231165552.GA24854@owl.midgard.homeip.net> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek , Jilles Tjoelker Subject: Re: svn commit: r216823 - head/sbin/shutdown X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Dec 2010 19:00:59 -0000 On Fri Dec 31 10, Erik Trulsson wrote: > On Fri, Dec 31, 2010 at 03:43:08PM +0100, Jilles Tjoelker wrote: > > On Thu, Dec 30, 2010 at 06:06:31PM +0000, Pawel Jakub Dawidek wrote: > > > Author: pjd > > > Date: Thu Dec 30 18:06:31 2010 > > > New Revision: 216823 > > > URL: http://svn.freebsd.org/changeset/base/216823 > > > > > Log: > > > For compatibility with Linux and Solaris add poweroff(8). > > > > > It is implemented as a hard link to shutdown(8) and it is equivalent of: > > > > > # shutdown -p now > > > > If we go that way, then for consistency reboot(8) and halt(8) should > > also be equivalent to calling shutdown -r now and shutdown -h now > > respectively, unless conflicting options are given. Linux has a -f > > option for what's currently reboot's and halt's default action, and > > fastboot(8)/fasthalt(8) could also retain the current behaviour. > > > > I would be in favour of this change. > > I would not be in favour of such a change. Adding a new command that > did not previously exist in FreeBSD (e.g. poweroff(8)) is one thing, > and is unlikely to break anything or confuse anybody. > > Changing the meaning of a command that is already present in FreeBSD is > something else, which is far more likely to cause problems. Such > changes should generally be avoided unless there is some really good > reason to do it, and I don't think such a reason exists in this case. of course you have a point there. on the other hand one can argue that the current behavior is non-intuitive. most of the time users want to reboot or halt a system nicely including execution of the rc.shutdown scripts. the names "reboot" and "halt" suggest that these commands do exactly what i described beforehand: to reboot or halt the system regularly. in fact reboot and halt will not execute certain scripts and thus it is recomended to use "shutdown -r now" or "shutdown -h now". why should executables for a regular reboot and halt *not exist*, while executables for a non-regular reboot and halt *do exist*? even more: there are 2 executables for a non-reguar reboot and 2 for a non-regular halt (reboot/fastboot and halt/fasthalt). another thought: running 'reboot' instead of 'shutdown -r now' *can* cause harm to the system, because an important rc.shutdown script wasn't executed. however running 'shutdown -r now' in single-user mode e.g. will cause a few sterr warnings; however it *cannot* cause any harm. so if the semantics for reboot and halt get changed, nothing bad can happen except for a few people wondering why suddenly reboot and halt execute rc.shutdown scripts in single user mode and produce warnings. so i vote for the following: change 'reboot' to execute 'shutdown -r now'. change 'halt' to execute 'shutdown -h now'. fastboot and fasthalt should keep their current semantical behavior and would need to become exectables rather than hardlinks to reboot/halt. just my 0.02$. cheers. alex > > > -- > > Erik Trulsson > ertr1013@student.uu.se -- a13x