"Install" of photon app not working

I have taken the platform specific Makefile that is built by PhAB and added
a line. After the ‘phabbind’ line I added:
@cp my_app …/…/…/…/bin

This would be an application specific ‘bin’ directory for all of my
applications. This works most of the time. But every now and then (several
times a day) I’ll get:
cp: Can’t open destination file. (…/…/…/…/bin/my_app): Resource busy
The app was not running at the time. (I do realize that a running photon
app may still have an open file descriptor to he executable file.) Once the
error occurs it will continue to occur until I let the system just ‘sit idle’
for a few minutes.

What could be causeing this “Resource Busy”?

What can I do so that my Makefile will succeed regardless?

Bill Caroselli <qtps@earthlink.net> wrote:

BC > I have taken the platform specific Makefile that is built by PhAB and added
BC > a line. After the ‘phabbind’ line I added:
BC > @cp my_app …/…/…/…/bin

BC > This would be an application specific ‘bin’ directory for all of my
BC > applications. This works most of the time. But every now and then (several
BC > times a day) I’ll get:
BC > cp: Can’t open destination file. (…/…/…/…/bin/my_app): Resource busy
BC > The app was not running at the time. (I do realize that a running photon
BC > app may still have an open file descriptor to he executable file.) Once the
BC > error occurs it will continue to occur until I let the system just ‘sit idle’
BC > for a few minutes.

BC > What could be causeing this “Resource Busy”?

BC > What can I do so that my Makefile will succeed regardless?

P.S. This seems to happen if I attempt a make right after terminating the
last execution of my application (2-3 seconds).

Bill Caroselli <qtps@earthlink.net> wrote:
BC > Bill Caroselli <qtps@earthlink.net> wrote:

BC > BC > I have taken the platform specific Makefile that is built by PhAB and added
BC > BC > a line. After the ‘phabbind’ line I added:
BC > BC > @cp my_app …/…/…/…/bin

BC > BC > This would be an application specific ‘bin’ directory for all of my
BC > BC > applications. This works most of the time. But every now and then (several
BC > BC > times a day) I’ll get:
BC > BC > cp: Can’t open destination file. (…/…/…/…/bin/my_app): Resource busy
BC > BC > The app was not running at the time. (I do realize that a running photon
BC > BC > app may still have an open file descriptor to he executable file.) Once the
BC > BC > error occurs it will continue to occur until I let the system just ‘sit idle’
BC > BC > for a few minutes.

BC > BC > What could be causeing this “Resource Busy”?

BC > BC > What can I do so that my Makefile will succeed regardless?

BC > P.S. This seems to happen if I attempt a make right after terminating the
BC > last execution of my application (2-3 seconds).

Additional info:

It seems that even if I wait 10 seconds after terminating the executable that
still isn’t long enough and I still get the Resource busy error.

Does it help to explain anything that the executable is over 1 MB in size?

I’m long since done with PhAB modifying the application. But I am still
adding functionality to the executable code. So I run the executable, decide
what changes I want to make and edit the source while I’m running. Then I
end the program and immediately do another make. This procedure is failing
most of the time now.

And I still don’t see why the executable file should be busy.

BTW, it stays busy even if the executable was running for over an hour.
So it is not being made busy at load time, but termination time, I assume.

Not that this is helpful to your problem Bill, but I’ve noticed the same
thing. I have a couple of test machines running QNet, call them A and
B. If I compile a photon app on machine A, copy it to B and run it then
terminate it, I can’t recompile and copy from A to B again until I
remove the executeable from B because it complains to me that the
application is still busy. I thought it might be a QNet related issue,
are you involving QNet at all or does it do it to you on one local machine?

Cheers,
-Warren “the number you have reached…” Peece



Bill Caroselli wrote:

Bill Caroselli <> qtps@earthlink.net> > wrote:
BC > Bill Caroselli <> qtps@earthlink.net> > wrote:

BC > BC > I have taken the platform specific Makefile that is built by PhAB and added
BC > BC > a line. After the ‘phabbind’ line I added:
BC > BC > @cp my_app …/…/…/…/bin

BC > BC > This would be an application specific ‘bin’ directory for all of my
BC > BC > applications. This works most of the time. But every now and then (several
BC > BC > times a day) I’ll get:
BC > BC > cp: Can’t open destination file. (…/…/…/…/bin/my_app): Resource busy
BC > BC > The app was not running at the time. (I do realize that a running photon
BC > BC > app may still have an open file descriptor to he executable file.) Once the
BC > BC > error occurs it will continue to occur until I let the system just ‘sit idle’
BC > BC > for a few minutes.

BC > BC > What could be causeing this “Resource Busy”?

BC > BC > What can I do so that my Makefile will succeed regardless?

BC > P.S. This seems to happen if I attempt a make right after terminating the
BC > last execution of my application (2-3 seconds).

Additional info:

It seems that even if I wait 10 seconds after terminating the executable that
still isn’t long enough and I still get the Resource busy error.

Does it help to explain anything that the executable is over 1 MB in size?

I’m long since done with PhAB modifying the application. But I am still
adding functionality to the executable code. So I run the executable, decide
what changes I want to make and edit the source while I’m running. Then I
end the program and immediately do another make. This procedure is failing
most of the time now.

And I still don’t see why the executable file should be busy.

BTW, it stays busy even if the executable was running for over an hour.
So it is not being made busy at load time, but termination time, I assume.

On 23 Mar 2004 13:46:04 GMT, Bill Caroselli wrote:

I have taken the platform specific Makefile that is built by PhAB and added
a line. After the ‘phabbind’ line I added:
@cp my_app …/…/…/…/bin

This would be an application specific ‘bin’ directory for all of my
applications. This works most of the time. But every now and then (several
times a day) I’ll get:
cp: Can’t open destination file. (…/…/…/…/bin/my_app): Resource busy
The app was not running at the time. (I do realize that a running photon
app may still have an open file descriptor to he executable file.) Once the
error occurs it will continue to occur until I let the system just ‘sit idle’
for a few minutes.

What could be causeing this “Resource Busy”?

What can I do so that my Makefile will succeed regardless?

I can’t explain exactly why you’re seeing the error (something still has
the file open) but if you just do a ‘cp -f’ it should make your problem go
away.

Rob Rutherford

Warren Peece <warren@nospam.com> wrote:
WP > Not that this is helpful to your problem Bill, but I’ve noticed the same
WP > thing. I have a couple of test machines running QNet, call them A and
WP > B. If I compile a photon app on machine A, copy it to B and run it then
WP > terminate it, I can’t recompile and copy from A to B again until I
WP > remove the executeable from B because it complains to me that the
WP > application is still busy. I thought it might be a QNet related issue,
WP > are you involving QNet at all or does it do it to you on one local machine?

WP > Cheers,
WP > -Warren “the number you have reached…” Peece

I am working strictly on a local system.

However, if I can ‘rm’ the target before I try to copy, that will get me
past my problem. Admittedly it is an ugly kludge.

Robert Rutherford <ruzz@nospamplease.ruzz.com> wrote:
RR > On 23 Mar 2004 13:46:04 GMT, Bill Caroselli wrote:

I have taken the platform specific Makefile that is built by PhAB and added
a line. After the ‘phabbind’ line I added:
@cp my_app …/…/…/…/bin

This would be an application specific ‘bin’ directory for all of my
applications. This works most of the time. But every now and then (several
times a day) I’ll get:
cp: Can’t open destination file. (…/…/…/…/bin/my_app): Resource busy
The app was not running at the time. (I do realize that a running photon
app may still have an open file descriptor to he executable file.) Once the
error occurs it will continue to occur until I let the system just ‘sit idle’
for a few minutes.

What could be causeing this “Resource Busy”?

What can I do so that my Makefile will succeed regardless?

RR > I can’t explain exactly why you’re seeing the error (something still has
RR > the file open) but if you just do a ‘cp -f’ it should make your problem go
RR > away.

RR > Rob Rutherford

Thanks Rob. I’ll try this too.

Bill Caroselli <qtps@earthlink.net> wrote:
BC > Robert Rutherford <ruzz@nospamplease.ruzz.com> wrote:
BC > RR > On 23 Mar 2004 13:46:04 GMT, Bill Caroselli wrote:

I have taken the platform specific Makefile that is built by PhAB and added
a line. After the ‘phabbind’ line I added:
@cp my_app …/…/…/…/bin

This would be an application specific ‘bin’ directory for all of my
applications. This works most of the time. But every now and then (several
times a day) I’ll get:
cp: Can’t open destination file. (…/…/…/…/bin/my_app): Resource busy
The app was not running at the time. (I do realize that a running photon
app may still have an open file descriptor to he executable file.) Once the
error occurs it will continue to occur until I let the system just ‘sit idle’
for a few minutes.

What could be causeing this “Resource Busy”?

What can I do so that my Makefile will succeed regardless?

BC > RR > I can’t explain exactly why you’re seeing the error (something still has
BC > RR > the file open) but if you just do a ‘cp -f’ it should make your problem go
BC > RR > away.

BC > RR > Rob Rutherford

BC > Thanks Rob. I’ll try this too.

For the record, this did work. Thanks again Rob.

I’d still like to know why the file was flagged as busy.

Or at least, can someone tell me what I can look at/try to figure out why
it is flagged as busy?

procnto keeps the executable mapping around for 30 seconds in order to
‘cache’ it.

Normally it should only do this if the ‘t’ sticky b is set, but there
may be other cases where it does it.

Since the exec is opened with a write lock this explains the “Resource
Busy” result.

Unlinking (rm or cp -f) is the correct fix.

Bill Caroselli wrote:

Bill Caroselli <> qtps@earthlink.net> > wrote:
BC > Robert Rutherford <> ruzz@nospamplease.ruzz.com> > wrote:
BC > RR > On 23 Mar 2004 13:46:04 GMT, Bill Caroselli wrote:


I have taken the platform specific Makefile that is built by PhAB and added
a line. After the ‘phabbind’ line I added:
@cp my_app …/…/…/…/bin

This would be an application specific ‘bin’ directory for all of my
applications. This works most of the time. But every now and then (several
times a day) I’ll get:
cp: Can’t open destination file. (…/…/…/…/bin/my_app): Resource busy
The app was not running at the time. (I do realize that a running photon
app may still have an open file descriptor to he executable file.) Once the
error occurs it will continue to occur until I let the system just ‘sit idle’
for a few minutes.

What could be causeing this “Resource Busy”?

What can I do so that my Makefile will succeed regardless?


BC > RR > I can’t explain exactly why you’re seeing the error (something still has
BC > RR > the file open) but if you just do a ‘cp -f’ it should make your problem go
BC > RR > away.

BC > RR > Rob Rutherford

BC > Thanks Rob. I’ll try this too.

For the record, this did work. Thanks again Rob.

I’d still like to know why the file was flagged as busy.

Or at least, can someone tell me what I can look at/try to figure out why
it is flagged as busy?


cburgess@qnx.com

Colin Burgess <cburgess@qnx.com> wrote:
CB > procnto keeps the executable mapping around for 30 seconds in order to
CB > ‘cache’ it.

CB > Normally it should only do this if the ‘t’ sticky b is set, but there
CB > may be other cases where it does it.

CB > Since the exec is opened with a write lock this explains the “Resource
CB > Busy” result.

CB > Unlinking (rm or cp -f) is the correct fix.

Thank you very much Colin for the explanation.