Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
jetty.service file
# A basic systemd configuration for Jetty to start on boot
# Uses the Service scenario of 'oneshot' run as root
# and once the process has run, it is considered successful
# regardless of error code (even 'FAILURE') as jetty
# may take longer to start than observes it's logs
# for.
Description=Jetty Web Application Server
# Execute pre and post scripts as root
# The process will be considered active after it exits
# Note on the Start we do not wait for successful start.
# This is to allow the container to run beyond the jetty shell script
# in cases where it takes very long to start and results in
# reporting FAILED. It's a false positive on failure.
ExecStart=-/opt/jetty/bin/ start
ExecStop=/opt/jetty/bin/ stop
ExecReload=/opt/jetty/bin/ restart
Copy link

danielkeller commented Jul 18, 2017

Thanks, this is very helpful. I've created a variant of this that uses Jetty's pidfile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment