From owner-freebsd-questions@freebsd.org Sat Oct 22 14:41:07 2016 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 A6491C1CD4C for ; Sat, 22 Oct 2016 14:41:07 +0000 (UTC) (envelope-from luzar722@gmail.com) Received: from mail-it0-x22a.google.com (mail-it0-x22a.google.com [IPv6:2607:f8b0:4001:c0b::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6AD9713C5 for ; Sat, 22 Oct 2016 14:41:07 +0000 (UTC) (envelope-from luzar722@gmail.com) Received: by mail-it0-x22a.google.com with SMTP id 66so53795446itl.1 for ; Sat, 22 Oct 2016 07:41:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-transfer-encoding; bh=exFy1NNGkMrBhlfQ6iaV5icqmwPiWbOmYc2Cjeafka8=; b=UVUMAlnZHSPSfXMg+uVOh4NQQwYX39XGmhreW9yfj/lQySIvjOSx1l4wodzIZRC3tc yMM/dupAh6Kbe3zg6Z7TaAYld98ygvYMIXHi6xSoZ59KGIH4EwYhmdTTPaHky5MwjacZ 9FO3Jt/rbflYu0lILATWhj/z+fNszfny3csUGcUGJjxh0qtG5w3SK+n10wkCpD12PG23 dRZkpjpS8q6onx3d2maRVexHCP3FjbX5Dz0aqHjX6d0ImJy7vW3qD4g8H9FCcL9XlLXU f2CM5qjws/42dx2M/TiLkpU85+3Cdm7o7UyXgivDWcphtjOcy7cdWCDwoLB+9WQb0hrt Y7Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-transfer-encoding; bh=exFy1NNGkMrBhlfQ6iaV5icqmwPiWbOmYc2Cjeafka8=; b=mogVOrCWv0YR6EKeTqD9n5uZmfkYIK+Yfj+sSWp4o9QVqtsYkPx98WLEpVLTEXnbQz ZihYR/2P+E+c74HKejuG2rl8lVbOre0gGfICtx0Jyh2cuN5yr1T/D4KTPRsSA+AQ9qHy eva8Iut+1QGrCgHWZvCrv1wjXGQq3/JRM9MH8Os4aFDqT/A/P1TqKrKBOlsgW+ivaRXY IqowApviJ07QDQUVDaksSIlcaxcsEJIxbMLM3XaHxZfz4T7+ksv+jaPP3pyi1Uu3mY7/ 0fr9TvoG5feQyCXgEKsfPAbHYZoUfnBan61SPjOH+mQSZ+mRCtw5ZfJcc3k/CkzGqOzF ugqw== X-Gm-Message-State: ABUngvfCA6zad9SxJp9R65FLLdzD7EeAwA1tjHZnzUUl9JPrfkgZWZUF9+naPGRoRtS7Ng== X-Received: by 10.36.22.70 with SMTP id a67mr6092452ita.114.1477147266770; Sat, 22 Oct 2016 07:41:06 -0700 (PDT) Received: from [10.0.10.3] (cpe-24-165-204-240.neo.res.rr.com. [24.165.204.240]) by smtp.googlemail.com with ESMTPSA id m71sm405733itg.1.2016.10.22.07.41.05 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 22 Oct 2016 07:41:06 -0700 (PDT) Message-ID: <580B7A86.9050209@gmail.com> Date: Sat, 22 Oct 2016 10:41:10 -0400 From: Ernie Luzar User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Adam Vande More CC: Freebsd Questions Subject: Re: console command history References: <580A4A2F.4020902@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed 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: Sat, 22 Oct 2016 14:41:07 -0000 Adam Vande More wrote: > On Fri, Oct 21, 2016 at 12:02 PM, Ernie Luzar > wrote: > > Hello List; > > After installing from scratch using cdrom.iso the console command > history is blank for user root. As I issue commands from the root > command line these commands get added to the history as one would > expect. After rebooting the system, root's history contains the > commands I issued before I rebooted the system, and any newly issued > commands are added to the history as one would expect. > > Now here is the problem I am seeing. After any reboots the history > contains only the issued commands from the first boot after the > install from scratch. The history does not contain the commands > issued before the last reboot. > > > This has been the default behavior for quite awhile. If you logout, the > history will be saved. Whatever entails "shutdown -r now" doesn't > gracefully logout the shell. > > Doing something like "# exit && shutdown -r now" would be a workaround. > > > -- > Adam Adam: Thank you. You hit the mail on the head. The original posted problem has nothing to do with those statements referenced in previous posts in this thread. The real problem is the shutdown, halt, and reboot commands just kill the system which includes the csh shell that the command was issued from denning the running shell the opportunity to save the current console command history so it can be restored when the root logs in after the system is started again. Issuing exit && reboot or exit && halt or exit && shutdown -p now from the command line does fix the problem. I added this this statement in root's .cshrc file alias sdp "exit && shutdown -p now" and now when I issue the sdp command from roots shell the history is saved and restored upon starting the system and logging in as root. Going to submit a PR to get shutdown, reboot, and halt changed to gracefully exit the shell the command was issued from. Thanks for your help in understanding what was really happening here.