1834419 Members
2175 Online
110067 Solutions
New Discussion

Re: shared library

 
SILVERSTAR
Frequent Advisor

shared library

Hello.

I am in need to update a shared library that is loaded up by a process.
I tried to:
prompt> mv shared.sl newshared.sl
I get the following message:
prompt> mv: oldshared.sl: cannot move "text busy" shared library: Text file busy

Since I cannot kill the process running, I need a workaround in order to update the library.
Before running the process I substitute the shared library with a symbolic link:
prompt> ln -s shared.sl shared.sl.link
Now after running the process, I can change the symbolic link:
prompt> ln -fs newshared.sl shared.sl.link
In this way, it seems I work around the problem and update shared libraries during process running.
I checked and it seems to work.
Anyway I would need a confirmation about:
1) The old processes running before symbolic link is changed still working properly?
2) HP-UX process management does not realese the old shared library and load it up again later on?
(This would cause a problem since in the meantime I changed the link pointing the new library).
3) Of course the processes running after link changed will use the new library.

Thanks in advance,
paolo.
1 REPLY 1
Stephen Keane
Honored Contributor

Re: shared library

1. Depends on the program. Unless the programmer has done something clever in the program (like loading objects from the shared library directly - windows style), it should work OK.

2. Again depends on the program, usually the shared library wouldn't be released until the program exits. It wouldn't normally be reloaded.

3. Almost certainly true.