| 1 |
# |
| 2 |
# Systemd unit file for Jetty |
| 3 |
# |
| 4 |
|
| 5 |
[Unit] |
| 6 |
Description=Jetty 9 Web Application Server |
| 7 |
Documentation=https://www.eclipse.org/jetty/documentation/current/ |
| 8 |
After=network.target |
| 9 |
|
| 10 |
[Service] |
| 11 |
|
| 12 |
# Configuration |
| 13 |
Environment="JETTY_HOME=/usr/share/jetty9/" |
| 14 |
Environment="JETTY_STATE=/var/lib/jetty9/jetty.state" |
| 15 |
Environment="JAVA_OPTS=-Djava.awt.headless=true" |
| 16 |
EnvironmentFile=-/etc/default/jetty9 |
| 17 |
|
| 18 |
# Lifecycle |
| 19 |
Type=simple |
| 20 |
ExecStart=/usr/share/jetty9/bin/jetty.sh run |
| 21 |
SuccessExitStatus=143 |
| 22 |
Restart=on-abort |
| 23 |
|
| 24 |
# Logging |
| 25 |
SyslogIdentifier=jetty9 |
| 26 |
|
| 27 |
# Security |
| 28 |
User=jetty |
| 29 |
Group=jetty |
| 30 |
PrivateTmp=yes |
| 31 |
AmbientCapabilities=CAP_NET_BIND_SERVICE |
| 32 |
NoNewPrivileges=true |
| 33 |
WorkingDirectory=/usr/share/jetty9/ |
| 34 |
LogsDirectory=jetty9 |
| 35 |
LogsDirectoryMode=750 |
| 36 |
ProtectSystem=strict |
| 37 |
ReadWritePaths=/var/lib/jetty9/ |
| 38 |
|
| 39 |
[Install] |
| 40 |
WantedBy=multi-user.target |