[Pljava-dev] Re: Subject: Re: Loading of native libraries in PLJAVA
Thomas Hallgren
thhal at mailblocks.com
Fri Mar 11 12:38:55 UTC 2005
Nageshwar Rao wrote:
>Hi,
>You can find JNI interface in
>http://www.teamlinux.org.uk/saxm/projects/icmp/, there is PingClient java
>file, which calls a JNI ping utility.
>
>Steps to replicate the error:-
>
> Basically we need to create a jar file of PingUtility and install
>the jar file in PLJava and set the classpath then insert record in the
>referenced table to invoke the trigger and the trigger should call the ping
>utility via JNI.
>
>
I have no linker problems loading and running libping from within
PL/Java so there must be an error in your setup. I run into another
perhaps bigger problem though. ping.c creates a RAW socket. Only root is
allowed to do that. PostgreSQL refuses to run as root (rightly so, that
would be a major security hole).
Here's a quote from the teamlinux page: "Unfortunately, it requires root
(at least, on a Linux box) - as ping.c creates a raw packet, which can
only be done by the super-user."
Perhaps you should consider skip using libping altogether and go for
J2SE 5.0 instead and then use java.net.InetAddress.isReachable()?
Regards,
Thomas Hallgren
More information about the Pljava-dev
mailing list