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?

New Busybox ash history working bad
(9 posts) (2 voices)-
Posted 10 years ago #
-
Hi gibor,
What you mean saying "working bad"?
Maybe you know that we have history command as a part of slitaz-tools package:
which history /usr/bin/history
It is a simple script:
#!/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...'
So, it just lists contents of ~/.ash_history file.
But!
history ≠ /usr/bin/history
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.
Posted 10 years ago # -
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!!!
Posted 10 years ago # -
Oh, I understand your needs. But I not touched this in any way :)
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.:
#if ENABLE_FEATURE_EDITING_SAVEHISTORY
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:
107 CONFIG_FEATURE_EDITING_HISTORY=255 108 CONFIG_FEATURE_EDITING_SAVEHISTORY=y 109 CONFIG_FEATURE_EDITING_SAVE_ON_EXIT=y
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?
Posted 10 years ago # -
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/Posted 10 years ago # -
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.Posted 10 years ago # -
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 IMHOThank for your support Aleksej :)
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 setPosted 10 years ago # -
My congratulations, gibor! It's works :)
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 =) 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...Posted 10 years ago # -
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 -rand at out of loop “Stop all daemons started at boot time” add line 25
killall busybox19 # 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 doneat reboot no have any error, but better if you do your tests I'm not a programmer...
Posted 10 years ago #
Reply
You must log in to post.