[Pljava-dev] Re: Subject: Re: Loading of native libraries in PLJAVA

From: thhal at mailblocks(dot)com (Thomas Hallgren)
To:
Subject: [Pljava-dev] Re: Subject: Re: Loading of native libraries in PLJAVA
Date: 2005-03-11 12:38:55
Message-ID: 4231915F.10703@mailblocks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

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

Browse pljava-dev by date

  From Date Subject
Next Message Bruno Domenici Ferreira 2005-03-14 17:49:42 [Pljava-dev] Failed to create Java VM
Previous Message Thomas Hallgren 2005-03-11 10:49:58 [Pljava-dev] Re: Subject: Re: Loading of native libraries in PLJAVA