commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Caillet <>
Subject JSVC unable to execute Java ping with Suid privilege
Date Thu, 24 Sep 2009 15:20:48 GMT
Hi !

I need to use the InetAddress.isReachable() function to check some hosts. This function's
implementation tries first to execute an ICMP ping if it has enough rights and if not, performs
a TCP ping on port 7. Right needed for ICMP is Suid (given by chmod +s) and root execution.

I have a test class in a Jar which does this job very well if I execute the jar file as root
and if I have launched a chmod +s on it.

But if I try to launch it with JSVC, the class is unable to perform ICMP pings (I am sure
because TCP are stopped by a firewall).

I have made a chmod +s on :
- jsvc 
- java
- the jar
JSVC is launched as root.
I know all that is bad, but ... anyway for the moment ! For information, I don't want to use
the "ping" command of the OS because I will have to performs thousands of ping every 3mn and
I am afraid the OS command will increase the RAM load too high ... So I suppose the isReachable
implementation is less resources consuming. May be I am wrong :-)

I don't know what do to do now ! It would be great if anybody has any idea ... 

Best regards,

Sylvain Caillet

View raw message