Making apt-get powercut-proof
Bryce Harrington
bryce at canonical.com
Mon May 5 20:51:20 UTC 2008
On Mon, May 05, 2008 at 08:57:36PM +0100, Andrew Sayers wrote:
> A friend of mine was upgrading to Hardy, and (so far as we can tell)
> there was a power cut while it was halfway through, which left his
> system in a not-especially-useful state. I think the best solution is
> to have a /etc/init.d/{apt-get|dpkg} script that checks for
> half-finished installs, and restarts them if necessary. If so, which
> (or both) would be better, and is there anyone here that knows enough
> about the two to suggest a complete set of commands that need to be run?
> Also, is this something we should be doing in an Ubuntu-specific way
> (e.g. from X), or should I take this idea to Debian?
Another use case (which I've run into a few times) is if you are doing
the upgrade unattended, it pauses for confirmation about a change to a
config file, and [battery runs out | wife turns off computer | system
locks up due to a suspend/resume bug].
I don't recall exactly what apt commands I needed to get things going
again. In one particularly nasty case, network manager had been left in
some sort of weird inconsistent state and I couldn't get it to connect
to the network, so ended up having to do a bunch of low level wireless
network hackery to get it going again. I suspect that was atypical, but
it makes me wonder if power failures during certain packages could be
much worse than others...
Anyway, making upgrades more resilient to being restarted in the middle
would be quite welcomed.
Bryce
More information about the Ubuntu-devel-discuss
mailing list