[BusyBox] Live updating busybox?

Rob Landley rob at landley.net
Mon Nov 17 21:22:16 UTC 2003


On Monday 17 November 2003 12:09, Bastian Blank wrote:
> On Mon, Nov 17, 2003 at 02:48:12PM +0100, Steven Scholz wrote:
> > One suggestion I got was to store the new version of busybox in let's say
> > /bin/busybox.new and then "mv /bin/busybox.new /bin/busybox" where "mv"
> > must not be the busybox applet but a standalone binary.
>
> the first is right, the second is not, rename(2) is an atomar operation.
>
> > 2.) Should I kill busybox inetd, httpd, telnetd etc before updating
> > busybox?
>
> You never write into the living binary, so the in-memory footprint is in
> sync with the on-disc binary even if it is unlink()ed.

scp elsewhere.com:busybox /bin/busybox2
mv /bin/busybox2 /bin/busybox

Modulo linking against the wrong libraries and the busybox binary not actually 
working, this should have a new inode and everything, shouldn't it?  
(Assuming your target system has enough space for two copies of the 
binary...)

Best to try this out first on a system you can boot from tomsrtbt or a knoppix 
cd if it goes wrong, of course.  But sometimes you just have to live 
dangerously...

Rob




More information about the busybox mailing list