From owner-freebsd-questions@freebsd.org Tue Mar 21 16:27:18 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89643D1642A for ; Tue, 21 Mar 2017 16:27:18 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from bede.home.qeng-ho.org (bede.qeng-ho.org [217.155.128.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "fileserver.home.qeng-ho.org", Issuer "fileserver.home.qeng-ho.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 13925389 for ; Tue, 21 Mar 2017 16:27:16 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from arthur.home.qeng-ho.org (arthur.home.qeng-ho.org [172.23.1.2]) by bede.home.qeng-ho.org (8.15.2/8.15.2) with ESMTP id v2LGRDx4035766; Tue, 21 Mar 2017 16:27:13 GMT (envelope-from freebsd@qeng-ho.org) Subject: Re: command line history broken in 11.0 To: Polytropon References: <58D019EE.9030508@gmail.com> <20170321161947.f34a308d.freebsd@edvax.de> Cc: freebsd-questions@freebsd.org From: Arthur Chance Message-ID: Date: Tue, 21 Mar 2017 16:27:13 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <20170321161947.f34a308d.freebsd@edvax.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Mar 2017 16:27:18 -0000 On 21/03/2017 15:19, Polytropon wrote: > On Tue, 21 Mar 2017 14:31:34 +0000, Arthur Chance wrote: [snip] >> >> To the best of my understanding, reboot and halt should really only be >> used in single user mode, because they don't cleanly close down running >> programs - they're more like pulling the power plug after a couple of >> syncs. That's been the case for a long time now. > > Basically, "reboot" is equivalent to "shutdown -r now", just > as "halt" is to "shutdown -h now". Both things do the same. > From "man reboot": > > The halt and reboot utilities flush the file system cache to disk, send > all running processes a SIGTERM (and subsequently a SIGKILL) and, respec- > tively, halt or restart the system. The action is logged, including > entering a shutdown record into the wtmp(5) file. > > This is what shutdown does as well. But see "man shutdown", > especially option -o, for differences related to calling init. > > Both variations should be fully safe to use from multi user mode. > The manpages don't say otherwise... You're right, but I'm sure that at one point there was a difference. Either that, or I'm misremembering some other Unix like system. Given that over a period of 37 years I've worked with eleven Unix variants, many of them hacked about horribly by their vendors, and a couple of Linux distros, it's a wonder I can remember anything clearly. >> Is there any reason for you not to use shutdown exclusively? The -p and >> -r modifiers give you power off and reboot abilities, and daemons get >> cleanly shut down, which may save you from a broken database one day. > > Note: -p = power off, -h = halt (does _not_ power off); "halt -p" > and "shutdown -p now" perform the same task (shut down, then power > off), while "halt" and "shutdown -h now" keep the system powered > on after shutting down. -- By June 1949, people had begun to realize that it was not so easy to get a program right as had at one time appeared. It was on one of my journeys between the EDSAC room and the punching equipment that the realization came over me with full force that a good part of the remainder of my life was going to be spent in finding errors in my own programs. -- Maurice Wilkes