You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Haim Cohen <ha...@gmail.com> on 2008/11/06 15:36:41 UTC

jsvc credentials issue

Hi,

I have a strange problem with permissions when trying to launch application
as daemon using jsvc.
The platform is RHEL 5.0 and the user is root.

If I start my application directly, all is well.
When I start the application using jsvc, it fails on trying to open SNMP
port ("Permission denied").

I tried launching jsvc with and w/out the "-user root" switch.
SNMP failure is not due to port already bound – netstat shows the port is
free for use.
Failure is also not due to daemon loading failure: I do see my code is
running (thus loaded).

My configuration:
The main class 'MyClass' is packaged in myclass.jar file. This is the jar I
use when I directly start the application.
For jsvc I added a class:  'MyClassDaemon' (this implements the Daemon
interface jsvc is looking for) and it is contained within myclassdaemon.jar
file.
When I start jsvc I provide it with the MyClassDaemon class as entry point.
MyClassDaemon loads MyClass and fires it.

Not sure if this of any importance, but 'MyClass' using external classes
that comes as additional jar files.
I believe that for some reason, 'MyClass' is not called as root user but I
don't know how to confirm this and if this is the case, then how to change
it to work properly.

Any help would be greatly appreciated.

Thx