View Single Post
Posts: 2,802 | Thanked: 4,491 times | Joined on Nov 2007
#86
Originally Posted by iDont View Post
Even Maemo's stock BusyBox handled shell history well, until bug 4174 appeared, that is. As you can read there, it changes BusyBox' shell history saving behaviour from writing out the history directly after executing a command, to saving the history upon shell exit. This, however, introduces new problems (e.g. bug 5317 you've mentioned).
Feel free to blame me, I should have argued harded on the upstream bugs but I kinda lost interest :-(

It's a tradeoff we have to make here. Either we keep the proper upstream shell history handling and have a (little?) bit more wear on the eMMC and a resulting (small?) increase of power usage
That's half the story, the other half being bug 4175 (history cross-contamination between concurrently running shells).

or we go Nokia's way of saving shell history only upon shell exit, but then we'll have problems with concurrent shells etcetera.
The other way around. Upstream busybox now avoids shells contaminating each other's history while they are running but ~/.ash_history is still a mashup of the last n commands from all sessions.

Some averaged numbers (/guesses) on how much wear upstream shell history handling actually creates on our eMMC's would be great, but I guess those are pretty hard to quantify.
It depends on how you use it obviously. We're talking about one eraseblock cycle every time you press enter which I guess adds up to a not-insignificant amount, but probably not enough to kill your flash by itself within the device's expected lifetime.

Originally Posted by Mentalist Traceur View Post
On the one hand I'm used to the shell being slightly 'wrong' in behavior since my main shell experience soure is the N900. On the other hand, if Nokia chose to go with "standard" behavior for Maemo 6 (I'm not calling Harmattan 'MeeGo' in casual conversation), that must mean even the Nokia folk think it's better to keep standard shell behavior.
There's no standard sadly (POSIX typically avoids the issue), but busybox's handling of history is rather unique AFAIK. Other POSIXy shells like bash or ksh keep their history in memory and write it out at exit (they pretty much have to since they implement fc and that will be extremely broken with mixed histories).

Originally Posted by qole View Post
I think I'd be satisfied if iDont just added the workaround to the post-install script.
Quick'n'dirty version in the Diablo CSSU:

Code:
line="trap exit SIGHUP"
if ! grep -F -q "$line" /etc/profile; then
  echo "$line" >> /etc/profile
fi
(/etc/profile so that root's shells are also taken care of).
 

The Following 4 Users Say Thank You to lma For This Useful Post: