bash crash dash

Had a strange episode on my laptop last night. Not sure if it’s the update I ran a few hours before, or flakey hardware, but all of a sudden I couldn’t start any new shells, and the cpu was locked so hard the machine turned into a hair dryer (which is why I wanted to run a shell – to run top). I used the xfce process manager to kill a busted bash process which was locking the cpu (although unlike windows, the machine was still responsive enough, I didn’t want to burn the thing out).

Turns out that /bin/bash somehow got corrupted. Hmm, tricky. Bit hard to fix something like that if you can’t log in – so much for gui tools. Hmm, what to do. I thought of emacs and shell mode, and guessed the way to specify the shell to run. After trying all the obvious things like ash, tcsh, and csh and discovering none of those shells were installed, I took a punt on the oddly named but completely unfamiliar dash. Horrah, finally I could run a shell! So I changed my login shell to dash and started poking around. Hmm, apt-get --reinstall install bash perhaps? Oh no, it needs bash to run the pre/post install scripts – it just always failed. Poked around man pages in dpkg and apt-get. Not much luck, no obvious way to disable the scripts. But at least I found where the package was cached. Hmm, dpkg-reconfigure? Oh helpful. Package bash is not working or only partially installed. No shit sherlock. Bear with me here, I really don’t grok debian’s package system – all I remember from the Evolution days is that they made up their own packages and versions which just gave the developers extra headaches. Ahaah, dpkg-deb -x bash* /tmp/foo. We have a binary. cp bin/bash /bin/bash, re-fix my shell, and finally it works.

Bit of a panic there – it’s been so long since i’ve had to administer a box at that level (apart from disabling all the crap that runs at login), and quite frankly there’s a reason for that. Hmm, so maybe there’s some hardware issue with my machine – firefox has started crashing a lot too (firefox 2 that is, 3 was way too much to use), or maybe it’s just related to the 8.04 install or an update.

2 thoughts on “bash crash dash”

Leave a Reply

Your email address will not be published. Required fields are marked *