Created
February 10, 2016 18:06
-
-
Save canariecaf/0fdd6db9e4f294afca79 to your computer and use it in GitHub Desktop.
jetty.service file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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 jetty.sh observes it's logs | |
# for. | |
# | |
# | |
[Unit] | |
Description=Jetty Web Application Server | |
After=network.target | |
[Install] | |
WantedBy=multi-user.target | |
Alias=jetty.service | |
[Service] | |
Type=oneshot | |
# Execute pre and post scripts as root | |
PermissionsStartOnly=true | |
# The process will be considered active after it exits | |
RemainAfterExit=yes | |
# 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 jetty.sh | |
# reporting FAILED. It's a false positive on failure. | |
ExecStart=-/opt/jetty/bin/jetty.sh start | |
ExecStop=/opt/jetty/bin/jetty.sh stop | |
ExecReload=/opt/jetty/bin/jetty.sh restart | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks, this is very helpful. I've created a variant of this that uses Jetty's pidfile.