[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] .bash_history lost
From: |
Greg Wooledge |
Subject: |
Re: [Help-bash] .bash_history lost |
Date: |
Mon, 10 Mar 2014 15:06:43 -0400 |
User-agent: |
Mutt/1.4.2.3i |
On Mon, Mar 10, 2014 at 07:44:47PM +0100, Manuel Reimer wrote:
> On 03/10/2014 07:13 PM, Chris Down wrote:
> >A root shell inside a regular user's shell?
>
> No. I switched to a VT via "Ctrl + Alt + F6", then logged in there as
> "root" and then I did my system update. After that, I entered "reboot"
> and hit enter.
Was the history blank before you did this? Because nothing that you
did on tty6 would be written to the history file, unless your OS's
"reboot" command happens to send a SIGTERM to the bash login shell,
and then waits long enough for bash to write out its history before
sending SIGKILL.
If on the other hand your OS's "reboot" command sends a SIGTERM to
every process, and then immediately sends a SIGKILL to every process,
it is possible that bash received the SIGTERM, started writing history
(which may involve truncating the existing file, depending on the
settings of the history variables), and was killed by a SIGKILL before
it could finish writing.
It might be helpful to know which operating system you're running,
what the settings of all the bash history variables are, how big (in
lines) the existing history file was before logging in, and how many
lines of history the new shell wanted to write.
Now, *personally* if I'm doing something similar to what you describe,
I always logout of the shell on the console so that history gets
written, and then I use Ctrl-Alt-Del to do the reboot without a shell.