Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Resource Busy: (3 Items)
   
Resource Busy  
Hello,

For some years I have encountered the message "Resource Busy" when I try to copy an executable file to a name of one 
that's currently running. This is often the case when I have modified a program and simply want to replace the one 
that's running. It hasn't really been a problem - more of a nuisance but one that I could live with.

But recently, I have been getting this message when the file simply exists - regardless of whether it is running or not.
 I have to remove the file (rm) before I can copy a new one over it. Although sometimes this doesn't occur more often 
than not it does and I am somewhat confused by what is actually happening. I'm using the most recent release of 7.1 but 
this message was apparent back in the 6.x days.

So my question is: what is the criteria that governs when this "Resource Busy" is issued requiring either the running 
process to be stopped or the destination file to be removed?

I guess to date I have considered it to be simply one of life's little mystery's.

Geoff.
Re: Resource Busy  
In these cases you will normally see that the procnto still had a fd open to the file in questions for the mappings.

even after the process has been exited the procnto will keep the mapping references around for a short period of time. 
Or for up to 60 seconds if you have the sticky bit set on the file. This is to facilitate quicker reloading of the 
binary should you decode to restart it.
http://www.qnx.com/developers/docs/7.0.0/#com.qnx.doc.neutrino.user_guide/topic/files_Sticky.html

The correct approach to replacing a binary in place it to unlink/rm the old one and then copy the new one to the same 
location. 
Re: Resource Busy  
Thanks John. It sort of makes sense now!

Geoff.

> In these cases you will normally see that the procnto still had a fd open to 
> the file in questions for the mappings.
> 
> even after the process has been exited the procnto will keep the mapping 
> references around for a short period of time. 
> Or for up to 60 seconds if you have the sticky bit set on the file. This is to
>  facilitate quicker reloading of the binary should you decode to restart it.
> http://www.qnx.com/developers/docs/7.0.0/#com.qnx.doc.neutrino.user_guide/
> topic/files_Sticky.html
> 
> The correct approach to replacing a binary in place it to unlink/rm the old 
> one and then copy the new one to the same location.