maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   [Announce] Enhanced BusyBox package (https://talk.maemo.org/showthread.php?t=72801)

ivgalvez 2012-03-02 14:00

Re: [Announce] Enhanced BusyBox package
 
I have again lost my history. Now there is no garbage in files but I couldn't trigger any command pressing CTRL+R.

I have checked that file .ash_history is empty. There is also a file .ash_history.1918.new that is empty and a ash_history.3055.new with only 100 very old commands.

iDont 2012-03-06 22:23

Re: [Announce] Enhanced BusyBox package
 
Quote:

Originally Posted by ivgalvez (Post 1173082)
I have again lost my history. Now there is no garbage in files but I couldn't trigger any command pressing CTRL+R.

I have checked that file .ash_history is empty. There is also a file .ash_history.1918.new that is empty and a ash_history.3055.new with only 100 very old commands.

Hmm, that's real unfortunate news to hear.

When you close ash, it'll append all of its new history to .ash_history, completely re-load .ash_history (other instances of ash might have written to it, and re-loading trims it to MAX_HISTORY), write the trimmed history out to .ash_history.$PID.new, and rename .ash_history.$PID.new to .ash_history.

The used code for this is pretty solid (look for save_history() in libbb/lineedit.c), and I don't see any direct cause as to why you lost your history :(. The only clue we have is that rename() somehow failed, since you still got .ash_history.XXXX.new files. It's rather odd though that you experienced this twice - the only other report is from Mentalist Traceur, but he mentioned that the device was unstable.

You could add something like the following to your ~/.profile file. This will backup your old history to /home/user/hist_bak/ when you close ash. It won't solve the issue you're experiencing, but at least you won't lose all of your history. I'm sorry I can't be of more help.
Code:

trap 'NAME=`date +%Y%m%d_%H%M%S`_bak && \
  cp /home/user/.ash_history /home/user/hist_bak/$NAME' 0


iDont 2012-03-06 22:44

Re: [Announce] Enhanced BusyBox package
 
Since this thread got bumped anyway, let me take this opportunity to call for testers :). Busybox-power 1.19.3power4 has been in extras-testing for a pretty long while now, and we most certainly can't leave out those extras users from shiny new versions, can we?

Also, for those that have noticed, busybox-powers' git repo has BusyBox 1.19.4 in it since a while now. It isn't pushed to the repositories because there is no code change between 1.19.4 and 1.19.3 + hotfixes, of which busybox-power 1.19.3power5 consists. Just a FYI ;).

deed 2012-03-06 23:03

Re: [Announce] Enhanced BusyBox package
 
Hi,
Got a problem with creating user and group, at least, the postinstall script from the icecast2 deb had!
Can't install this app and busybox power report a prob in user and group creation, any ideas?

iDont 2012-03-07 08:37

Re: [Announce] Enhanced BusyBox package
 
Quote:

Originally Posted by deed (Post 1175551)
Hi,
Got a problem with creating user and group, at least, the postinstall script from the icecast2 deb had!
Can't install this app and busybox power report a prob in user and group creation, any ideas?

Thanks for reporting.

The line that causes this error in the postinst script is:
Code:

    adduser --system --disabled-password --disabled-login \
        --home /usr/share/icecast2 --no-create-home --group icecast

However, Maemo isn't shipped with adduser at all! Busybox-power does provide an adduser applet, but it takes different arguments than the postinst tries to use.

The solution is rather simple though. Execute:
Code:

apt-get install adduser
and icecast2 will install flawlessly :). The postrm script also uses utilities from the adduser package (namely: deluser and groupdel), so you shouldn't uninstall the package right after installing icecast2. It seems like the package maintainer simply forgot to add a dependency on adduser to icecast2.

ivgalvez 2012-03-07 09:25

Re: [Announce] Enhanced BusyBox package
 
Quote:

Originally Posted by iDont (Post 1175519)
Hmm, that's real unfortunate news to hear.

When you close ash, it'll append all of its new history to .ash_history, completely re-load .ash_history (other instances of ash might have written to it, and re-loading trims it to MAX_HISTORY), write the trimmed history out to .ash_history.$PID.new, and rename .ash_history.$PID.new to .ash_history.

The used code for this is pretty solid (look for save_history() in libbb/lineedit.c), and I don't see any direct cause as to why you lost your history :(. The only clue we have is that rename() somehow failed, since you still got .ash_history.XXXX.new files. It's rather odd though that you experienced this twice - the only other report is from Mentalist Traceur, but he mentioned that the device was unstable.

You could add something like the following to your ~/.profile file. This will backup your old history to /home/user/hist_bak/ when you close ash. It won't solve the issue you're experiencing, but at least you won't lose all of your history. I'm sorry I can't be of more help.
Code:

trap 'NAME=`date +%Y%m%d_%H%M%S`_bak && \
  cp /home/user/.ash_history /home/user/hist_bak/$NAME' 0


OK I will try that, in fact in case it happens again it would be useful to know when really happened. It might be related to any other issue.

peterleinchen 2012-03-08 22:45

Re: [Announce] Enhanced BusyBox package
 
Quote:

Originally Posted by iDont (Post 1175519)
the only other report is from Mentalist Traceur, but he mentioned that the device was unstable.

Hey iDont,

just for the reports:
I also faced this a few times. But afair always after a hard shutdown (real sw_res). I found total senseless entries in history or even lines of my e-mails (which really scared me the first time ;))...

But just loosing the history sometimes is just a inconvenience, no more. And the positice effects of busybox enhanced is SO much more!
Thanks again for that package and support.

deed 2012-03-09 08:04

Re: [Announce] Enhanced BusyBox package
 
Quote:

Originally Posted by iDont (Post 1175728)
Thanks for reporting.

The line that causes this error in the postinst script is:
Code:

    adduser --system --disabled-password --disabled-login \
    --home /usr/share/icecast2 --no-create-home --group icecast

However, Maemo isn't shipped with adduser at all! Busybox-power does provide an adduser applet, but it takes different arguments than the postinst tries to use.

The solution is rather simple though. Execute:
Code:

apt-get install adduser
and icecast2 will install flawlessly :). The postrm script also uses utilities from the adduser package (namely: deluser and groupdel), so you shouldn't uninstall the package right after installing icecast2. It seems like the package maintainer simply forgot to add a dependency on adduser to icecast2.


Thank you very much IDont, I haven't thought about it myself...
Thanks also for the hard work about busybox-power, it's a huge enhancement for the N900.
Have a nice day.

ivgalvez 2012-03-18 21:17

Re: [Announce] Enhanced BusyBox package
 
Happened again, this time after using preenv from the command line. Could it be related?

iDont 2012-03-19 09:27

Re: [Announce] Enhanced BusyBox package
 
Quote:

Originally Posted by ivgalvez (Post 1181193)
Happened again, this time after using preenv from the command line. Could it be related?

Thanks, I'll check it out when I get back home. Are you able to reproduce the issue, or did it happen at random? Also, how did you close preenv and its parent shell (by executing "exit" twice, simply closing the window, or ..)?

Update: I'm still not able to (re)produce any kind of issue with the history handling. This issue is driving me nuts! I must have looked over the code a hundred times by now. What completely puzzles me, are the reports about the completely unrelated text in .ash_history; I can't seem to relate that to BusyBox in any way :(.


All times are GMT. The time now is 02:04.

vBulletin® Version 3.8.8