[jira] [Created] (DAEMON-234) Allow the same jsvc binary executable to work with either libcap.so.1 or libcap.so.2 at runtime

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (DAEMON-234) Allow the same jsvc binary executable to work with either libcap.so.1 or libcap.so.2 at runtime

Gilles (Jira)
Allow the same jsvc binary executable to work with either libcap.so.1 or libcap.so.2 at runtime
-----------------------------------------------------------------------------------------------

                 Key: DAEMON-234
                 URL: https://issues.apache.org/jira/browse/DAEMON-234
             Project: Commons Daemon
          Issue Type: Improvement
          Components: Jsvc
    Affects Versions: 1.0.8
            Reporter: Phil Clay


From a recent mail thread on the commons user list...

http://markmail.org/message/uvkfqd7nkqyhq5eg

I would like to be able to use jsvc on both debian and redhat machines.  Ideally, I'd like to be able to compile jsvc once, and use the same binary on both platforms.

The problem I am encountering is that the version of libcap varies across machines.


For example, if I compile jsvc on a RHEL 5.4 machine (which has libcap.so.1), and then attempt to run the same binary on a Debian 6 machine (which has libcap.so.2), then the execution fails with:

jsvc: error while loading shared libraries: libcap.so.1: cannot open shared object file: No such file or directory



In order to create a single jsvc executable that works whether or not libcap.so.1 or libcap.so.2 is available at runtime, the jsvc code should use dlopen("libcap.so") and then dlsym all API's instead linking.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Resolved] (DAEMON-234) Allow the same jsvc binary executable to work with either libcap.so.1 or libcap.so.2 at runtime

Gilles (Jira)

     [ https://issues.apache.org/jira/browse/DAEMON-234?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mladen Turk resolved DAEMON-234.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 1.0.9

Implemented by dynamically loading libcap.so.
This means that the library is not linked to libcap.so.MAJOR
but it loads and resolves api symbols at run-time.
               

> Allow the same jsvc binary executable to work with either libcap.so.1 or libcap.so.2 at runtime
> -----------------------------------------------------------------------------------------------
>
>                 Key: DAEMON-234
>                 URL: https://issues.apache.org/jira/browse/DAEMON-234
>             Project: Commons Daemon
>          Issue Type: Improvement
>          Components: Jsvc
>    Affects Versions: 1.0.8
>            Reporter: Phil Clay
>             Fix For: 1.0.9
>
>
> From a recent mail thread on the commons user list...
> http://markmail.org/message/uvkfqd7nkqyhq5eg
> I would like to be able to use jsvc on both debian and redhat machines.  Ideally, I'd like to be able to compile jsvc once, and use the same binary on both platforms.
> The problem I am encountering is that the version of libcap varies across machines.
> For example, if I compile jsvc on a RHEL 5.4 machine (which has libcap.so.1), and then attempt to run the same binary on a Debian 6 machine (which has libcap.so.2), then the execution fails with:
> jsvc: error while loading shared libraries: libcap.so.1: cannot open shared object file: No such file or directory
> In order to create a single jsvc executable that works whether or not libcap.so.1 or libcap.so.2 is available at runtime, the jsvc code should use dlopen("libcap.so") and then dlsym all API's instead linking.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (DAEMON-234) Allow the same jsvc binary executable to work with either libcap.so.1 or libcap.so.2 at runtime

Gilles (Jira)
In reply to this post by Gilles (Jira)

    [ https://issues.apache.org/jira/browse/DAEMON-234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13207955#comment-13207955 ]

Phil Clay commented on DAEMON-234:
----------------------------------

Hey Mladen,

I downloaded commons-daemon-1.0.9-native-src.tar.gz, extracted it, then ran

./configure
make

...on a rhel5.4 machine (which has libcap.so.1), and ran jsvc on a debian 6 machine (which has libcap.so.2), and still received the same error.  :(

I noticed that the configure file needs to be regenerated for the source distribution.

After regenerating configure using autoconf, then running
./configure
make

The produced binary works on both platforms.

(Also, as a side note, I noticed that jsvc -help shows the version as 1.0.8 instead of 1.0.9.  I think version.h needs updating.)

Not sure how you want to handle this. New bug?
               

> Allow the same jsvc binary executable to work with either libcap.so.1 or libcap.so.2 at runtime
> -----------------------------------------------------------------------------------------------
>
>                 Key: DAEMON-234
>                 URL: https://issues.apache.org/jira/browse/DAEMON-234
>             Project: Commons Daemon
>          Issue Type: Improvement
>          Components: Jsvc
>    Affects Versions: 1.0.8
>            Reporter: Phil Clay
>             Fix For: 1.0.9
>
>
> From a recent mail thread on the commons user list...
> http://markmail.org/message/uvkfqd7nkqyhq5eg
> I would like to be able to use jsvc on both debian and redhat machines.  Ideally, I'd like to be able to compile jsvc once, and use the same binary on both platforms.
> The problem I am encountering is that the version of libcap varies across machines.
> For example, if I compile jsvc on a RHEL 5.4 machine (which has libcap.so.1), and then attempt to run the same binary on a Debian 6 machine (which has libcap.so.2), then the execution fails with:
> jsvc: error while loading shared libraries: libcap.so.1: cannot open shared object file: No such file or directory
> In order to create a single jsvc executable that works whether or not libcap.so.1 or libcap.so.2 is available at runtime, the jsvc code should use dlopen("libcap.so") and then dlsym all API's instead linking.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (DAEMON-234) Allow the same jsvc binary executable to work with either libcap.so.1 or libcap.so.2 at runtime

Gilles (Jira)
In reply to this post by Gilles (Jira)

    [ https://issues.apache.org/jira/browse/DAEMON-234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13208065#comment-13208065 ]

Mladen Turk commented on DAEMON-234:
------------------------------------

Hmm, not sure why the provided configure doesn't work for you.
... and for version yes, I noticed that file didn't get updated afer
we made release.

So, yes, please open a new JIRA. The configure issue is really interesting.
I was using RHEL4 for generating them so it can work with older systems, so
this might be the reason.

               

> Allow the same jsvc binary executable to work with either libcap.so.1 or libcap.so.2 at runtime
> -----------------------------------------------------------------------------------------------
>
>                 Key: DAEMON-234
>                 URL: https://issues.apache.org/jira/browse/DAEMON-234
>             Project: Commons Daemon
>          Issue Type: Improvement
>          Components: Jsvc
>    Affects Versions: 1.0.8
>            Reporter: Phil Clay
>             Fix For: 1.0.9
>
>
> From a recent mail thread on the commons user list...
> http://markmail.org/message/uvkfqd7nkqyhq5eg
> I would like to be able to use jsvc on both debian and redhat machines.  Ideally, I'd like to be able to compile jsvc once, and use the same binary on both platforms.
> The problem I am encountering is that the version of libcap varies across machines.
> For example, if I compile jsvc on a RHEL 5.4 machine (which has libcap.so.1), and then attempt to run the same binary on a Debian 6 machine (which has libcap.so.2), then the execution fails with:
> jsvc: error while loading shared libraries: libcap.so.1: cannot open shared object file: No such file or directory
> In order to create a single jsvc executable that works whether or not libcap.so.1 or libcap.so.2 is available at runtime, the jsvc code should use dlopen("libcap.so") and then dlsym all API's instead linking.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira