- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- shared library in use + possible resolution
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2004 12:08 AM
тАО11-04-2004 12:08 AM
I found a solution for this if I create an executable and afterward I say
chatr +dbg enable
I can move, replace the shared libs used by the executable while it is running.
questions
-is this the way to go about it and is it possible to tell aCC of ld directly what I want and avoiding the chatr step ??
-is there a danger involved by using chatr +dbg enable and is it really safe to remove a shared lib afterward ? (won't it be referenced ever again ?)
(I believe on linux it works because you can mv or rm the file, but as long as it is in use the inode stays alive, untill the last reference to the file is dropped)
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2004 02:04 AM
тАО11-04-2004 02:04 AM
Re: shared library in use + possible resolution
a shared library is supposed to be shared in memory by all processes that simultaneously load it. when you do a chatr +dbg enable, the library is mapped private into the memory of each process that loads it.
btw, 'mv -f' should work on the busy text file too.
--
ranga
[i work for hpe]
- Tags:
- mv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2004 02:10 AM
тАО11-04-2004 02:10 AM
Re: shared library in use + possible resolution
mv: libhello.sl: cannot write: Text file busy
remains the question -> is there an option which I can pass to aCC avoiding the chatr step (because an extra step is error prone, and will be forgotten)
and is it absolutely safe (so is _everything_ mapped in memory)
why ?
whe wrote a shared lib used by lots of deamon processes, which every once in while needs to be updated, but we don't want to restart all the deamons, ..
cheers,
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2004 01:11 PM
тАО11-04-2004 01:11 PM
Re: shared library in use + possible resolution
# /usr/bin/cpset -o new_shared_lib directory_to_install_to
This should rename old shared library to OLD
- Tags:
- cpset
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2004 08:39 PM
тАО11-04-2004 08:39 PM
Re: shared library in use + possible resolution
never heard of it, it has one problem though, I can use it only once, because it will rename the lib to OLDlib, and the second time OLDlib is in use by the daemons, and cpset refuses duty.
BUT it rang a bell, and I found a nice solution (wouldn't have thought of it without cpset though !)
/*just demo proof of concept code, bla, bla*/
#include
#include
#include
#include
int main(int argc,char *argv[])
{
if ( link(argv[1],argv[2] ) )
{
printf("error : copy %s -> %s : %s\n",argv[1],argv[2],strerror(errno) ) ;
}
else
{
if ( unlink(argv[1]) )
{
printf("error : remove %s : %s\n",argv[1],strerror(errno) ) ;
}
}
}
aCC move.c -o move
move
and YES, it works, all the time, ... !
any dangers involved guru's ?
cheers, Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-07-2004 10:49 AM
тАО11-07-2004 10:49 AM
SolutionPlease note that 'mv -f' will also work, but you have to do it as follows.
# mv -f libhello.sl \#libhello.sl
# cp newlibhello.sl libhello.sl
It won't work if you do it as
# mv -f newlibhello.sl libhello.sl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-07-2004 06:57 PM
тАО11-07-2004 06:57 PM
Re: shared library in use + possible resolution
why didn't I think of that
great answers guys, thanks,
I need what I want,
greetz,
Peter