[
https://issues.apache.org/jira/browse/DAEMON-242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13505809#comment-13505809
]
Mark Wood commented on DAEMON-242:
----------------------------------
Of course Gentoo Linux does things differently. /usr/lib/libcap.so is a linker
script. Dynamically loading it results in error because it's not a shared
object library but a text file.
johncock lib # head /var/log/tomcat-7/fix.log
failed loading capabilities library -- /usr/lib/libcap.so: invalid ELF header.
set_caps(CAPS) failed for user 'tomcat'
Service exit with a return value of 4
johncock lib # cat libcap.so
/* GNU ld script
Since Gentoo has critical dynamic libraries in /lib, and the static versions
in /usr/lib, we need to have a "fake" dynamic lib in /usr/lib, otherwise we
run into linking problems. This "fake" dynamic lib is a linker script that
redirects the linker to the real lib. And yes, this works in the cross-
compiling scenario as the sysroot-ed linker will prepend the real path.
See bug http://bugs.gentoo.org/4411 for more info.
*/
OUTPUT_FORMAT ( elf64-x86-64 )
GROUP ( /lib64/libcap.so.2 )
I had to move it and symlink /usr/lib/libcap.so -> /lib/libcap.so to get jsvc
to proceed.
> jsvc cannot find libcap.so on debian-based distributions
> --------------------------------------------------------
>
> Key: DAEMON-242
> URL: https://issues.apache.org/jira/browse/DAEMON-242
> Project: Commons Daemon
> Issue Type: Bug
> Components: Jsvc
> Affects Versions: 1.0.9
> Environment: Debian 6.0.2
> Ubuntu 11.04
> Reporter: Phil Clay
> Fix For: 1.0.10
>
>
> Debian-based distributions do not symlink the "main" shared object to the
> major version.
> For example:
> On RHEL4u4:
> $ ls -l /lib/libcap.so*
> lrwxrwxrwx 1 root root 11 Jun 13 2007 /lib/libcap.so -> libcap.so.1
> lrwxrwxrwx 1 root root 14 Jun 12 2007 /lib/libcap.so.1 -> libcap.so.1.10
> -rwxr-xr-x 1 root root 11784 Oct 7 2006 /lib/libcap.so.1.10
> Notice libcap.so -> libcap.so.1
> On Debian 6.02:
> $ ls -l /lib/libcap.so*
> lrwxrwxrwx 1 root root 14 Jan 25 10:19 /lib/libcap.so.2 -> libcap.so.2.19
> -rw-r--r-- 1 root root 16640 Aug 16 2010 /lib/libcap.so.2.19
> On Ubuntu 11.04:
> $ ls -l /lib/libcap.so*
> lrwxrwxrwx 1 root root 14 2011-07-16 09:52 /lib/libcap.so.2 ->
> libcap.so.2.20
> -rw-r--r-- 1 root root 13816 2011-02-15 14:35 /lib/libcap.so.2.20
> Notice there is no libcap.so -> libcap.so.2
> Therefore, when jsvc attempts to load libcap.so, it fails...
> I see this when running jsvc -debug ...
> Attemtping to load library /lib/libcap.so
> Attemtping to load library /usr/lib/libcap.so
> failed loading capabilities library -- /usr/lib/libcap.so: cannot open shared
> object file: No such file or directory.
> set_caps(CAPS) failed for user 'oncommand'
> Service exit with a return value of 4
> If I create the libcap.so -> libcap.so.2 symlink, it works.
> I'm guessing the fix for this would be to load libcap.so, libcap.so.2,
> libcap.so.1 in progression to see if any work.
> (Note that I have performed the workaround I mentioned in
> https://issues.apache.org/jira/browse/DAEMON-241 to get this far.)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira