Created
July 31, 2024 08:41
-
-
Save cosimo/ae7d334548b1553691a118bd3852d6fc to your computer and use it in GitHub Desktop.
tomcat9 systemd service unit 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
[Unit] | |
Description=Apache Tomcat 9 Web Application Server | |
Documentation=https://tomcat.apache.org/tomcat-9.0-doc/index.html | |
After=network-online.target | |
Wants=cloud-final.service | |
[Service] | |
# Configuration | |
Environment="CATALINA_HOME=/usr/share/tomcat9" | |
Environment="CATALINA_BASE=/var/lib/tomcat9" | |
Environment="CATALINA_TMPDIR=/tmp" | |
Environment="JAVA_OPTS=-Djava.awt.headless=true" | |
EnvironmentFile=-/etc/default/tomcat9 | |
# Lifecycle | |
Type=simple | |
ExecStartPre=+/usr/libexec/tomcat9/tomcat-update-policy.sh | |
ExecStart=/bin/sh /usr/libexec/tomcat9/tomcat-start.sh | |
SuccessExitStatus=143 | |
Restart=on-abort | |
# Logging | |
SyslogIdentifier=tomcat9 | |
# Security | |
User=tomcat | |
Group=tomcat | |
PrivateTmp=yes | |
AmbientCapabilities=CAP_NET_BIND_SERVICE | |
NoNewPrivileges=true | |
LogsDirectory=tomcat9 | |
LogsDirectoryMode=755 | |
CacheDirectory=tomcat9 | |
CacheDirectoryMode=750 | |
ProtectSystem=strict | |
ReadWritePaths=/etc/tomcat9/Catalina/ | |
ReadWritePaths=/var/lib/tomcat9/webapps/ | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment