Daemonizing Jetty?

Wessel, Keith kwessel at illinois.edu
Thu Jul 30 15:01:57 EDT 2015


Thanks, Dave, but shoulda mentioned an essential fact in my original note: this is a non-root installation. We’re not on a system-based distro yet (RHEL 6), and een if we were, this all needs to be done with things not requiring root. The jetty.sh script is nice enough to check and do its thing without start-stop-daemon if we aren’t root, but it’s still using lazy backgrounding.

Keith


From: users [mailto:users-bounces at shibboleth.net] On Behalf Of David Langenberg
Sent: Thursday, July 30, 2015 1:58 PM
To: Shib Users <users at shibboleth.net>
Subject: Re: Daemonizing Jetty?

If you're on a SystemD-based distro, here's some instructions that work on CentOS 7.  YMMV on other systems:

Courtesy of the InCommon Shib Training Team:


1) Create the file /etc/systemd/system/shibboleth.service using your favorite editor and save the following there (Note, what follows is case-sensitive:

[Unit]
Description=Shibboleth Identity Provider

[Service]
WorkingDirectory=/opt/shibboleth-idp/jetty-base
ExecStart=/usr/bin/java -jar <path-to-jetty>/start.jar jetty.home=<your-jetty-home> jetty.base=<your-custom-jetty-base>

[Install]
WantedBy=multi-user.target

2) Reload systemd: systemctl daemon-reload shibboleth

3) Start Shib: systemctl enable shibboleth && systemctl start shibboleth

Dave

On Thu, Jul 30, 2015 at 12:52 PM, Wessel, Keith <kwessel at illinois.edu<mailto:kwessel at illinois.edu>> wrote:
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

--
To unsubscribe from this list send an email to users-unsubscribe at shibboleth.net<mailto:users-unsubscribe at shibboleth.net>



--
David Langenberg
Identity & Access Management Architect
The University of Chicago
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/users/attachments/20150730/85675f2b/attachment.html>


More information about the users mailing list