On 3 December 2013 08:19, JinHwan Hwang <[email protected]> wrote: > By googling, I know that there are some issue if i use port number which is > under 1000 without root privileges. But in my case, i have run jsvc with > root account and all the involving files have ‘chmod 755’ permission. Https > server are created by using restlet with jetty container. What will cause > this annoying permission error besides permission of files? Moreover, https > server works fine when i run without jsvc(directly run jar file). I have > post error message and all the sample code which i used below. > > Thanks in advance for any help > > *jsvc error output* > > 2013-12-03 16:38:53.248:WARN:oejuc.AbstractLifeCycle:FAILED > [email protected]:443: java.net.SocketException: > Permission denied > java.net.SocketException: Permission denied > at sun.nio.ch.Net.bind(Native Method) > at > sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:126) > at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59) > at > org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:187) > at > org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:316) > at > org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:265) > at > org.eclipse.jetty.server.ssl.SslSelectChannelConnector.doStart(SslSelectChannelConnector.java:631) > at > org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) > at org.eclipse.jetty.server.Server.doStart(Server.java:293) > at > org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) > at > org.restlet.ext.jetty.JettyServerHelper.start(JettyServerHelper.java:398) > at org.restlet.Server.start(Server.java:590) > at org.restlet.Component.startServers(Component.java:611) > at org.restlet.Component.start(Component.java:538) > at JettyServerExample.main(JettyServerExample.java:26) > at CmmDaemon.start(CmmDaemon.java:23)
I think you need to bind to the socket earlier, in the init() method. By the time start() is called, the process has dropped root privs. See: http://commons.apache.org/proper/commons-daemon/jsvc.html in particular http://commons.apache.org/proper/commons-daemon/jsvc.html#Directly et seq. > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at > org.apache.commons.daemon.support.DaemonLoader.start(DaemonLoader.java:243) --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
