View previous topic :: View next topic |
Author |
Message |
sdauth l33t
Joined: 19 Sep 2018 Posts: 652 Location: Ásgarðr
|
Posted: Wed Jul 03, 2024 7:18 pm Post subject: bash-5.2_p26-r6 HISTSIZE & HISTFILESIZE variables |
|
|
Hello,
With bash-5.2_p26-r6, if I don't set HISTSIZE & HISTFILESIZE in my ~/.bashrc; I observe the creation of lot of .bash_history-******.tmp files appearing randomly (some even empty) in my ~/
This wasn't needed with previous bash-5.1 series. Or at least I never observed this behaviour.
I was finally able to solve the issue by setting those variables in my ~/.bashrc. I added HISTCONTROL too for good measure.
HISTCONTROL=ignorespace:ignoredups
HISTSIZE=10000
HISTFILESIZE=20000
If anyone have an explanation or maybe it is unrelated and just coincidence.. At least if it can help anyone with the same issue, that's a good thing.
Cheers |
|
Back to top |
|
|
RumpletonBongworth Tux's lil' helper
Joined: 17 Jun 2024 Posts: 82
|
Posted: Wed Jul 03, 2024 9:28 pm Post subject: |
|
|
I noticed some lingering temporary files on one of my machines, dating from several months ago. As far as I can tell, nothing has changed in 5.2 that would make it any more or less likely for one of the syscalls to fail in such a way that a temporary file remains. It could have just been an anomaly but I did notice something potentially interesting: the length of the temporary files was exactly that of the values of HISTSIZE and HISTFILESIZE at the time. I don't have an explanation for this but it's on my radar, so to speak. |
|
Back to top |
|
|
sdauth l33t
Joined: 19 Sep 2018 Posts: 652 Location: Ásgarðr
|
Posted: Fri Jul 05, 2024 3:47 pm Post subject: |
|
|
RumpletonBongworth wrote: | the length of the temporary files was exactly that of the values of HISTSIZE and HISTFILESIZE at the time. I don't have an explanation for this but it's on my radar, so to speak. |
Interesting, what values were you using when you noticed this ?
I think the default is 500 for HISTSIZE (when not set in ~/.bashrc)
In Debian, the default ~/.bashrc set the following :
Code: | # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000 |
Which seems too low because I have the same issue with Debian if I use these values.
Instead I set :
Code: | # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=10000
HISTFILESIZE=20000 |
And no more tmp files cluttering my home folder. (like hundred of them..)
Strangely the issue started to happen with Debian bookworm (12), current stable, which introduced bash 5.2. With oldstable (Bullseye), I never saw those history tmp files. |
|
Back to top |
|
|
RumpletonBongworth Tux's lil' helper
Joined: 17 Jun 2024 Posts: 82
|
Posted: Sun Jul 07, 2024 5:16 am Post subject: |
|
|
sdauth wrote: | Interesting, what values were you using when you noticed this ?
I think the default is 500 for HISTSIZE (when not set in ~/.bashrc) |
Indeed, it is 500 for both HISTSIZE and HISTFILESIZE. Both of these defaults were in effect at the time. |
|
Back to top |
|
|
sdauth l33t
Joined: 19 Sep 2018 Posts: 652 Location: Ásgarðr
|
Posted: Sun Jul 07, 2024 9:05 am Post subject: |
|
|
It took a while for them to show up again but they did.. So while raising up the value of both variables improve a little bit (it takes longer to manifest), it's still happening.
Code: | -rw------- 1 sdauth users 7325 7 juil. 10:58 .bash_history
-rw------- 1 sdauth users 7360 7 juil. 00:52 .bash_history-19312.tmp
-rw------- 1 sdauth users 0 7 juil. 01:42 .bash_history-27948.tmp |
I thought I had found a solution.. |
|
Back to top |
|
|
CaptainBlood Advocate
Joined: 24 Jan 2010 Posts: 3870
|
Posted: Sun Jul 07, 2024 9:13 am Post subject: |
|
|
Here's Code: | 2024-01-01T23:22:38 >>> app-shells/bash-5.1_p16-r6: 2′32″
2024-01-25T20:29:57 >>> app-shells/bash-5.1_p16-r6: 1′42″
|
Code: | -rw------- 1 user users 0 janv. 20 19:52 .bash_history-00643.tmp |
Not bash-5.2 only here.
Thks 4 ur attention, interest & support. _________________ USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. " |
|
Back to top |
|
|
sdauth l33t
Joined: 19 Sep 2018 Posts: 652 Location: Ásgarðr
|
Posted: Sun Jul 07, 2024 9:18 am Post subject: |
|
|
No way ! haha, well the plot thickens |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22687
|
Posted: Sun Jul 07, 2024 12:28 pm Post subject: |
|
|
From reading the bash source, the ability to generate those files is quite old. I suspect they are generated far more often than you realize, but usually cleaned up promptly, and your problem here is that they sometimes are not removed. I have not tried to determine likely causes for the failure to remove them. |
|
Back to top |
|
|
|