Daemonizing Jetty?

Khawer Masood shehzada at gwu.edu
Thu Jul 30 15:18:35 EDT 2015


For CentOS/RHEL/OEL v 6.x, we’ve implemented this successfully for a non-root/application user (working with our sys admins):

* copy $JETTY_HOME/bin/jetty.sh to /etc/init.d/ as jetty … or … symlink /etc/init.d/jetty to $JETTY_HOME/bin/jetty.sh
* create /etc/default/jetty or symlink it to $JETTY_HOME/etc/jetty and in it add the following:

JAVA_HOME=path to java
JAVA=$JAVA_HOME/bin/java
JETTY_HOME=path to jetty home
JAVA_OPTIONS="-Didp.home=/app/shibboleth-idp -Xmx1024M -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -verbose:gc -Xloggc:${JETTY_HOME}/logs/gc.log"
JETTY_USER=application's userid
IDP_HOME=/app/shibboleth-idp
JETTY_BASE=${IDP_HOME}/jetty-base
JETTY_PID=${JETTY_BASE}/jetty.pid

* chkconfig --add jetty
* chkconfig jetty on
* grant application's userid sudo permission to run "/etc/init.d/jetty *" without prompting for password

Let me know if you have any follow-up questions, or would like to have an off-line discussion.

Kavi

> Date: Thu, 30 Jul 2015 18:52:04 +0000
> From: "Wessel, Keith" <kwessel at illinois.edu>
> To: "users at shibboleth.net" <users at shibboleth.net>
> Subject: Daemonizing Jetty?
> Message-ID:
> 	<A1EB7EC659FA0F429A55865D5820006D2E303F1E at CITESMBX1.ad.uillinois.edu>
> Content-Type: text/plain; charset="us-ascii"
> 
> Hi, all,
> 
> I know this is a purely Jetty question, foregive me if it's off-topic. I figured others might have run into this, too.
> 
> I've been using jetty.sh (included with the Jetty package) to start/stop Jetty. Seems it's using a simple '&' backgrounding method to daemonize jetty.sh. This is fine as long as I'm starting/stopping Jetty from the local system. It's when I do:
> 
> ssh other-IDP-note jetty.sh start
> 
> that I run into problems. The non-interactive nature of things seems to gum up the works. My ssh command never returns me to a prompt on the local system. I assume it's waiting for the backgrounded process to start and, in fact, verified this with a simple one-line bash script: sleep 15 &. It terminates immediately when run locally but hangs for 15 seconds when passed to ssh asa  command to run remotely.
> 
> I know I can get around this with the -t option to ssh to tell ssh to force a pseudo terminal. But is there any Jetty command-line arg that tells Jetty to daemonize? I imagine, if there was, it would probably be used in jetty.sh in place of &. But I figured it couldn't hurt to ask. My Google searches so far reveal no such option.
> 
> I'm far happier with Jetty's ease of configuration and speed so far than I was with Tomcat, but Tomcat at least knew how to fork its own Daemon process.
> 
> Thanks,
> Keith
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/users/attachments/20150730/67dcce6d/attachment.html>


More information about the users mailing list