SliTaz SliTaz Forum

You are not logged in.

#1 2015-01-15 17:40:34

gibor
Moderator
Registered: 2011-04-30
Posts: 1,067

New Busybox ash history working bad

Hi at all, anyone have same problem?

I use frequently command from terminal, and the history dont work correctly.

Have difference from normal user and root user. the previous version of busybox (slitaz-4.0) working well.

Any idea?

Offline

#2 2015-01-15 18:23:21

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: New Busybox ash history working bad

Hi gibor,

What you mean saying "working bad"?

Maybe you know that we have history command as a part of slitaz-tools package:

[c]which history
/usr/bin/history[/c]
It is a simple script:

[c]#!/bin/sh
#
# Fake history command for Ash.
#
. /lib/libtaz.sh
export TEXTDOMAIN='slitaz-tools' #i18n

cat $HOME/.ash_history 2>/dev/null || _ 'No history file found...'[/c]
So, it just lists contents of ~/.ash_history file.

But! [c]history ≠ /usr/bin/history[/c]

When I type "history" seems like I run internal "history" command, not /usr/bin/history (what runs in the SliTaz 4.0?)

And I think, problem begins if you have more than one terminal opened. Every other terminal has its own history.

Small experiment. Open two terminals.

Command "echo aaa" on first terminal, command "history". Ok, our "echo aaa" is here.

Command "history" on the second terminal. No "echo aaa" absent. Command "echo bbb" and check "history" on the first terminal. No, it is absent too.

So, every terminal has its own history (and its history is gone when you close the terminal), but its working not bad, as for me.

Offline

#3 2015-01-15 18:51:56

gibor
Moderator
Registered: 2011-04-30
Posts: 1,067

Re: New Busybox ash history working bad

Thank for your reply but the problem is not command “history” but the .ash_history file not created from command line on terminal.

No have idea where is the problem, but if change only busybox from version of busybox of slitaz-4.0 (BusyBox v1.18.4) working well.

So, every terminal has its own history (and its history is gone when you close the terminal), but its working not bad, as for me.

Another thing the history file of command I preferred have a unique file and make persistence not deleted at closing!!!

Offline

#4 2015-01-15 19:06:39

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: New Busybox ash history working bad

Oh, I understand your needs. But I not touched this in any way smile

Interesting thread found when I searching the problem: http://lists.busybox.net/pipermail/busybox/2011-July/076247.html

Ash writes to ~/.ash_history after every command, causing excessive

wear on devices which use a flash-based device as their storage medium

(i.e. one erase block cycle per command).

This patch allows you to set a temporary location where ash's history

will be saved until the shell is exited.

I think it is interesting to see into Busybox's sources and check if we really have that patch back from 2011 or not...

_____

PS. Found ash source here: https://gitorious.org/busybox/busybox/source/33bbb27e45c7c6a0fecb40b3a5aa36aef69825f9:shell/ash.c

Line 1909, line 13056, etc.:

[c]#if ENABLE_FEATURE_EDITING_SAVEHISTORY[/c]

Interesting to look our busybox config. Do we have this feature enabled?

_____

PPS. Seems that this file is our Busybox config: http://hg.slitaz.org/wok/file/9c6168449386/busybox/stuff/busybox-1.22.config

Searching for "HISTORY" on this page:

[c]107 CONFIG_FEATURE_EDITING_HISTORY=255
108 CONFIG_FEATURE_EDITING_SAVEHISTORY=y
109 CONFIG_FEATURE_EDITING_SAVE_ON_EXIT=y[/c]
Really have no clue what is "Save on exit". Is it mean "Save history on exit"? Maybe we need to change "y" to "n" here?

Offline

#5 2015-01-15 20:45:34

gibor
Moderator
Registered: 2011-04-30
Posts: 1,067

Re: New Busybox ash history working bad

I have tried at standard compile from source busybox-1.23.0, and the result is ok, work correctly...

your nomined patch to limit saving activity on this version compiled is missed... mistery of programmer.

Source from

http://www.busybox.net/downloads/

Offline

#6 2015-01-15 21:16:43

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: New Busybox ash history working bad

So, you recommend to upgrade SliTaz busybox package to 1.23.0?

Sorry, I can't do it. I'm afraid to break everything. So many patches and configs here in the busybox's receipt, so many busybox's packages. Please, ask Pascal for upgrade busybox.

Offline

#7 2015-01-15 21:39:21

gibor
Moderator
Registered: 2011-04-30
Posts: 1,067

Re: New Busybox ash history working bad

Sorry for my ugly english, but not recommend to upgrade. Simply to is possible report same functionality of busybox old on this new version.

Only at simply IMHO

Thank for your support Aleksej smile

Edit

on .config file of my busybox compiled the line suspected correspond this value

110 CONFIG_FEATURE_EDITING_HISTORY=255

111 CONFIG_FEATURE_EDITING_SAVEHISTORY=y

112 # CONFIG_FEATURE_EDITING_SAVE_ON_EXIT is not set

Offline

#8 2015-01-16 01:25:53

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: New Busybox ash history working bad

My congratulations, gibor! It's works smile

I'm afraid to break everything. So, I just copied "busybox" with receipt and all its stuff from our "cooking" repo to the "undigest" repo. Then I commented CONFIG_FEATURE_EDITING_SAVE_ON_EXIT as in your piece of config file.

Compiled ... And ... Here it is: http://cook.slitaz.org/undigest/cooker.cgi?pkg=busybox

I installed it and reboot my SliTaz. Ok, it is not an end of the days, and seems like all working smile But what about history?

I opened my ~/.ash_history in the JuffEd (my text editor of the choice): it alerts when file is changed on the disk and suggests to reload it. Then I opened two Sakura terminals. Then "echo aaa" on the first. JuffEd alerts that file is changed. Reload it and see my "echo aaa" in the history. Then "echo bbb" on the second Sakura. And all repeats, my "echo bbb" in the history too!

So, it works for me. You can download and use it too.

But question stays opened as for a Cooking repository. I don't know is it safe to apply these changes to the Cooking busybox? Looking into busybox receipt I see "busybox", "busybox-pam", "busybox-static", "busybox-uclibc", "busybox-musl", "busybox-diet", and four busybox configs. I'm confused...

Offline

#9 2015-01-16 08:50:16

gibor
Moderator
Registered: 2011-04-30
Posts: 1,067

Re: New Busybox ash history working bad

Yes Aleksej seem working well.

Have tried from rolling and the script rc.shutdown hide an old error at umount command.

Lsof view a responsible busybox for this error

my first personal solution is it

from script rc.shutdown modding the line

remove at line 38 “2>/dev/null” (unhide message)

36 # Umount filesystems

37

38 /bin/umount -a -r

and at out of loop “Stop all daemons started at boot time” add line 25

killall busybox

19 # Stop all daemons started at boot time.

20 for daemon in $RUN_DAEMONS

21 do

22    if [ -x /etc/init.d/$daemon ]; then

23         /etc/init.d/$daemon stop >> $log

24     fi

25 killall busybox

26 done

at reboot no have any error, but better if you do your tests I'm not a programmer...

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.018 seconds, 7 queries executed - Memory usage: 1.55 MiB (Peak: 1.77 MiB) ]