You are not logged in.
Hi there,
yesterday evening I turned off my machine (using GNOME). Currently, I was logged in as root on a console and in parallel in my usually GNOME session. Today a logged in as root again to peform updates and I recognized that the root history is empty. That is, the .bash_history file is empty and was last modified at the exact time I turned off my machine yesterday. So what's the reason? Was this a bug or some sort of race condition during shutdown? I'm a little bit afraid someone modified something on the system and maybe tried to delete his traces by deleting the root bash history.
Kind regards
Last edited by Pilsbert (2014-09-11 09:33:31)
Offline
Anything in your journal? Logs?
Not a Sysadmin issue, moving to NC...
Offline
Thanks for your reply.
By scrolling over the journal entries since yesterday I did not recognize something special... An output of ps -ax also lists no abnormal process name.
I also performed an update yesterday, but only 5 packages were updated (ntp, colord, libqmi, libtracker-sparql, tracker).
So maybe it was only a bug that the content of the history was deleted.
Offline
What are your history settings in root's bashrc?
Offline
Actually, there is no .bashrc file in the /root directory. The /etc/bash.bashrc file looks like this
#
# /etc/bash.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
PS1='[\u@\h \W]\$ '
PS2='> '
PS3='> '
PS4='+ '
case ${TERM} in
xterm*|rxvt*|Eterm|aterm|kterm|gnome*)
PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'
;;
screen)
PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033_%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'
;;
esac
[ -r /usr/share/bash-completion/bash_completion ] && . /usr/share/bash-completion/bash_completion
Offline
Please use code tags when pasting to the boards: https://wiki.archlinux.org/index.php/Fo … s_and_Code
See `man bash` for details on history settings, but if HISTFILE is not set, no history is saved when the shell exits.
Offline
I'll use the code tag for posting code in the future.
But my installation exists for 1.5 years and I neither changed any bashrc file nor edited the HISTFILE environment variable. If I execute
declare -p
as root in both gnome-terminal and a VT HISTFILE and HISTFILESIZE are correctly set (although root still hasn't any .bashrc file)
Offline
Have you tried to replicate? You could run a strace while doing so to see if that turns up anything.
Offline
I tried to replicate it two times. First by being logged in as root in a VT and in gnome-terminal at a time, and second being logged in as root only in a VT. Then i turned off the computer (using gnome-shell poweroff). Result: In both cases the root history was not deleted.
Offline
See this thread: https://bbs.archlinux.org/viewtopic.php … 9#p1340529
Offline
Thanks a lot!
You can mark this thread as solved
Last edited by Pilsbert (2014-09-11 09:15:06)
Offline
Well, actually, you can... by editing your first post and prepending it to the title.
Offline