...
| Bloc de code |
|---|
|
cp /usr/lib/systemd/system/tomcat10.service /etc/systemd/system/tomcat-esup-sgc.service
cp /usr/lib/systemd/system/tomcat10.service /etc/systemd/system/tomcat-esup-nfc-tag.service
|
Pour Esup-SGC (TODO : à revoir) :
| Bloc de code |
|---|
|
cat > /etc/systemd/system/tomcat-esup-sgc.service <<EOF
#
# Systemd unit file for Apache Tomcat
#
[Unit]
Description=Apache Tomcat ESUP-SGC Server
Documentation=https://tomcat.apache.org/tomcat-10.0-doc/index.html
After=network.target
RequiresMountsFor=/var/log/tomcat10 /var/lib/tomcat10 /opt/tomcat-esup-sgc
[Service]
# Configuration
Environment="CATALINA_HOME=/usr/share/tomcat10"
Environment="CATALINA_BASE=/opt/tomcat-esup-sgc"
Environment="CATALINA_TMPDIR=/opt/tomcat-esup-sgc/temp"
Environment="JAVA_OPTS=-Djava.awt.headless=true"
# Lifecycle
Type=simple
ExecStart=/bin/sh /usr/libexec/tomcat10/tomcat-start.sh
SuccessExitStatus=143
Restart=on-abort
# Logging
SyslogIdentifier=tomcat-esup-sgc
# Security
User=tomcat
Group=tomcat
PrivateTmp=yes
AmbientCapabilities=CAP_NET_BIND_SERVICE
NoNewPrivileges=true
CacheDirectory=tomcat-esup-sgc
CacheDirectoryMode=750
ProtectSystem=strict
ReadWritePaths=/opt/tomcat-esup-sgc/conf/
ReadWritePaths=/opt/tomcat-esup-sgc/work/
ReadWritePaths=/opt/tomcat-esup-sgc/webapps/
ReadWritePaths=/opt/tomcat-esup-sgc/logs/
ReadWritePaths=/opt/tomcat-esup-sgc/temp/
[Install]
WantedBy=multi-user.target |
...