You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Srijith Kochunni <ks...@novell.com> on 2008/12/10 14:46:49 UTC
java.net.bind exception with ports < 80.
Hi All,
I am using jsvc to daemonize my java application, which runs on a Linux box. I get an error java.net.BindException: Permission denied. I get this only for ports < 1024 and I understand on linux to bind to any ports which are below 1024, you require root permission. Therefore I am launching my application as root. However I still am not able to get the privileges required. My JSVC arguments are as follows.
jsvc.exec -debug -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8008 -jvm server -user root -home $JAVA_HOME
-outfile /var/opt/myfile.out -pidfile /var/run/myfile.pid -errfile '&1'
I am launching as root user and also in jsvc arguments I have specified "-user root", but am at a loss as to why I am still getting this exception, when I launch my jetty server. When I tried to launch it normally outside jsvc, it works fine. I have searched on the net, and also came across this message thread http://markmail.org/message/3mw6r2dievxvviu3#query:jsvc%20java.net.BindException%3A%20Permission%20denied+page:1+mid:j2w4dpzp4aaypun6+state:results where it suggested, that some system call had been modified and it worked thereafter, but did not find the details.
Have run strace, but could not find any errors.
On starting in debug mode, I see the following messages,
10/12/2008 18:55:30 6349 jsvc debug: user changed to 'root'
10/12/2008 18:55:30 6348 jsvc debug: User 'root' validated
and I also don't see any errors.
Any help / suggestions in this regard would be greatly appreciated.
Thanks,
Srijith.