1

I recently took over some RPM work while one of our colleagues is away. During the post installation step, the RPM installs some libraries in a particular location, writes a file to /etc/ld.conf.so.d/ containing the path to these files, and then runs "ldconfig". But when the call is made, there are quite few messages stating that: "libXYZ.so* is not a symbolic link".

I looked at the files and the sym links are not set up correctly. E.g., libA.so.1 and libA.so.1.1 are identical files, instead of libA.so.1->libA.so.1.1. Whenever ldconfig is run on a system with the RPM installed, these messages are shown.

Now for no particular reason, I tried replicating this by creating a shared library called libmylib.so.1.1. Then I created another file called libmylib.so.1 which was identical to the previous file. I added a test.conf file to /etc/ld.conf.so.d which contains the path to these shared libraries, and then ran ldconfig. But I didn't see any of these "not a symlink" messages. Instead ldconfig set up two symlinks to both these files. Is that message displayed only under particular circumstances?

Also, when I'm installing shared libraries, do I need to setup the links such as:

linker name -> so name -> real name

manually? And then run ldconfig?

This is my first time working with RPM and installing shared libraries, so any input would be appreciated.

Thanks

muddy
  • 187
  • 2
  • 8
  • Never mind guys, I figured out what I was doing incorrectly. Getting that message now. – muddy Sep 20 '15 at 00:34
  • Side note - please consider having the file dropped in `/etc/ld.conf.so.d` be generated by the normal `%install` process and listed in `%files` so that the RPM database knows where it came from. `rpm -q --whatprovides /etc/ld.conf.so.d/yourfile` is useful for an admin. – Aaron D. Marasco Sep 21 '15 at 01:13
  • Thanks Aaron, I'm not sure if the installer does that at the moment. If it writes that file during %post, will it be added to the RPM database? – muddy Sep 21 '15 at 01:26
  • No, only if it is listed (or imported) in the `%files` section. The `%post` should only be calling `ldconfig`. – Aaron D. Marasco Sep 21 '15 at 10:11

1 Answers1

0

Common practice is to make symbolic links to relate the library version and soname to the name used when building/linking a program. Here are a few comments on that:

ldconfig expects that there is only one actual file. Here are a few places where this question has been asked:

Usually, problems in this area are due to improper updating of the symbolic links. But an incorrect build-script can be the problem as well.

Community
  • 1
  • 1
Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105