Reputation: 3468
I have a shared library (.so) on AIX I know what all processes are using it. I have stopped all the concerned processes. I need to replace the above .so file (with the new library) using cp -p command. But the above command is giving error: "Cannot remove the running program"
While i am trying "cp -p -f" it is wroking fine, But I need to use only "cp -p" Any idea on this matter will be helpful. Thanks.
Upvotes: 0
Views: 638
Reputation: 377
The safe way is using temporal file:
cp -p /from/libfoo.so /target/libfoo.so.tmp
mv -f /target/libfoo.so.tmp /target/libfoo.so
You don't have to stop any program to perform this; and there won't be any moment when there is no libfoo.so in target directory.
Also it doesn't hurt to call slibclean sometimes, to keep the memory clean. Use 'genkld | wc -l' before and after it to check if it has done anything.
Upvotes: 1