<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div>For CentOS/RHEL/OEL v 6.x, we’ve implemented this successfully for a non-root/application user (working with our sys admins):</div><div><br class=""></div><div><font face="Monaco" class=""><span style="font-size: 12px;" class="">* copy $JETTY_HOME/bin/jetty.sh to /etc/init.d/ as jetty … or … symlink /etc/init.d/jetty to </span></font><span style="font-family: Monaco; font-size: 12px;" class="">$JETTY_HOME/bin/jetty.sh</span></div><div><span style="font-family: Monaco; font-size: 12px;" class="">* create /etc/default/jetty or symlink it to </span><span style="font-family: Monaco; font-size: 12px;" class="">$JETTY_HOME/etc/jetty and in it add the following:</span></div><div><font face="Monaco" class=""><span style="font-size: 12px;" class=""><br class=""></span></font></div><div><font face="Monaco" class=""><span style="font-size: 12px;" class="">JAVA_HOME=path to java<br class="">JAVA=$JAVA_HOME/bin/java<br class="">JETTY_HOME=path to jetty home<br class="">JAVA_OPTIONS="-Didp.home=/app/shibboleth-idp -Xmx1024M -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -verbose:gc -Xloggc:${JETTY_HOME}/logs/gc.log"<br class="">JETTY_USER=application's userid<br class="">IDP_HOME=/app/shibboleth-idp<br class="">JETTY_BASE=${IDP_HOME}/jetty-base<br class="">JETTY_PID=${JETTY_BASE}/jetty.pid</span></font></div><div><font face="Monaco" class=""><span style="font-size: 12px;" class=""><br class=""></span></font></div><div><span style="font-family: Monaco; font-size: 12px;" class="">* chkconfig --add jetty</span><br style="font-family: Monaco; font-size: 12px;" class=""><span style="font-family: Monaco; font-size: 12px;" class="">* chkconfig jetty on</span><br style="font-family: Monaco; font-size: 12px;" class=""><span style="font-family: Monaco; font-size: 12px;" class="">* grant application's userid sudo permission to run "/etc/init.d/jetty *" without prompting for password</span></div><div><br class=""></div><div>Let me know if you have any follow-up questions, or would like to have an off-line discussion.</div><div><br class=""></div><div>Kavi</div><div><br class=""></div><div><blockquote type="cite" class=""><div class="">Date: Thu, 30 Jul 2015 18:52:04 +0000<br class="">From: "Wessel, Keith" <<a href="mailto:kwessel@illinois.edu" class="">kwessel@illinois.edu</a>><br class="">To: "<a href="mailto:users@shibboleth.net" class="">users@shibboleth.net</a>" <<a href="mailto:users@shibboleth.net" class="">users@shibboleth.net</a>><br class="">Subject: Daemonizing Jetty?<br class="">Message-ID:<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><<a href="mailto:A1EB7EC659FA0F429A55865D5820006D2E303F1E@CITESMBX1.ad.uillinois.edu" class="">A1EB7EC659FA0F429A55865D5820006D2E303F1E@CITESMBX1.ad.uillinois.edu</a>><br class="">Content-Type: text/plain; charset="us-ascii"<br class=""><br class="">Hi, all,<br class=""><br class="">I know this is a purely Jetty question, foregive me if it's off-topic. I figured others might have run into this, too.<br class=""><br class="">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:<br class=""><br class="">ssh other-IDP-note jetty.sh start<br class=""><br class="">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.<br class=""><br class="">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.<br class=""><br class="">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.<br class=""><br class="">Thanks,<br class="">Keith<br class=""></div></blockquote></div></body></html>