Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
bash-5.2_p26-r6 HISTSIZE & HISTFILESIZE variables
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
sdauth
l33t
l33t


Joined: 19 Sep 2018
Posts: 620
Location: Ásgarðr

PostPosted: Wed Jul 03, 2024 7:18 pm    Post subject: bash-5.2_p26-r6 HISTSIZE & HISTFILESIZE variables Reply with quote

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.. :lol: At least if it can help anyone with the same issue, that's a good thing.

Cheers
Back to top
View user's profile Send private message
RumpletonBongworth
n00b
n00b


Joined: 17 Jun 2024
Posts: 63

PostPosted: Wed Jul 03, 2024 9:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
sdauth
l33t
l33t


Joined: 19 Sep 2018
Posts: 620
Location: Ásgarðr

PostPosted: Fri Jul 05, 2024 3:47 pm    Post subject: Reply with quote

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
View user's profile Send private message
RumpletonBongworth
n00b
n00b


Joined: 17 Jun 2024
Posts: 63

PostPosted: Sun Jul 07, 2024 5:16 am    Post subject: Reply with quote

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
View user's profile Send private message
sdauth
l33t
l33t


Joined: 19 Sep 2018
Posts: 620
Location: Ásgarðr

PostPosted: Sun Jul 07, 2024 9:05 am    Post subject: Reply with quote

It took a while for them to show up again but they did.. :o 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
View user's profile Send private message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 3698

PostPosted: Sun Jul 07, 2024 9:13 am    Post subject: Reply with quote

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
View user's profile Send private message
sdauth
l33t
l33t


Joined: 19 Sep 2018
Posts: 620
Location: Ásgarðr

PostPosted: Sun Jul 07, 2024 9:18 am    Post subject: Reply with quote

No way ! haha, well the plot thickens :lol:
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22028

PostPosted: Sun Jul 07, 2024 12:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum