I run Gentoo and was wondering if anyone knows how can I get bash to dump my current shell cli history to .bash_history when I type reboot or shutdown. When I bounce my box if I don't exit the shell then it doesn't write my command history to the bash_history. I had this issue with Linux From Scratch too.
I was hoping it would be a setting in bashrc, or /etc/profile but I can't find anything that stands out to writing the history on a init. Since I had this issue with LFS I looked there and found this.
http://linuxfromscratch.org/pipermai...ne/060297.html
I have no clue on how to get it to do the SIGHUP. I suppose I would need to grab the source for shutdown, modify it and recompile shutdown. Anyone else have any better suggestions? Is there a way I can get the initlevel to run some commands before issuing the init 6?
Thanks,
Nick