update a running busybox

Ralf Friedl Ralf.Friedl at online.de
Tue Apr 5 11:50:52 UTC 2011


Arno Steffen wrote:
> 2011/3/29 Harald Becker <ralda at gmx.de>:
>   
>>> You can try
>>>
>>> ln /bin/busybox /bin/busybox.old
>>> mv busybox /bin/busybox
>>>
>>> Then remove /bin/busybox.old after the next reboot.
>>>       
>> That is the best way to replace any running executable in place, but
>> doesn't solve the "Device busy" problem in all cases (that even arise
>> due to other actions, not only Busybox update). As those problems are a
>> mess on flash file systems, I focused on the reboot question ... but
>> otherwise you are right. You can even remove busybox.old right after the
>> move, it than gets deleted on shutdown automatically.
>>
>> --
>> Harald
>>     
> I cannot confirm that remove of busybox_old is working before reboot.
> In this case your device will keep busy and it is impossible to
> remount in read-only.
> That's pity, as I like this method.
> Regards
> Arno
If you remove the old program after the move, you might as well omit the 
link completely.
The effect of the additional link is that the program will not be 
removed at shutdown, as there exists a link to the file.
If you remove the link, or don't create the link at all, there is no 
reference left to the file, just the running processes executing the 
program. Therefor the file will be removed when the last process exits, 
which will likely be init.
Most file systems will deal with this without any problems.
In this case the problem is either the flash file system itself that 
doesn't handle this case, or it may be the fact that the file system was 
remounted read only, although updates were pending.
That should be easy to find out, just replace busybox and then do a 
reboot without remounting read only.

Ralf


More information about the busybox mailing list