Hello everyone,
I am trying to install XNAT 1.8.5 on my VM (Ubuntu 20.04, JAVA 8, PostgreSQL 10, Tomcat 9) and I am following the page of the installation:
Unfortunately, I am trying everything to solve this riddle, doing searches on searches but nothing and Tomcat does not start at all.
Can you help me please?
1) Here is the unit file:
#
# Systemd unit file for Apache Tomcat
#
[Unit]
Description=Apache Tomcat 9 Web Application Server
Documentation=https://tomcat.apache.org/tomcat-9.0-doc/index.html
After=network.target
RequiresMountsFor=/var/log/tomcat9 /var/lib/tomcat9
[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"
# 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=xnat
Group=xnat
PrivateTmp=yes
AmbientCapabilities=CAP_NET_BIND_SERVICE
NoNewPrivileges=true
CacheDirectory=tomcat9
CacheDirectoryMode=750
ProtectSystem=strict
ReadWritePaths=/etc/tomcat9/Catalina/
ReadWritePaths=/var/lib/tomcat9/webapps/
ReadWritePaths=/var/log/tomcat9/
ReadWritePaths=/data/xnat/
[Install]
WantedBy=multi-user.target
2) Here is the configuration file:
# Run Tomcat as this user ID. Not setting this or leaving it blank will use the
# default of tomcat8.
TOMCAT9_USER=xnat
# Run Tomcat as this group ID. Not setting this or leaving it blank will use
# the default of tomcat8.
TOMCAT9_GROUP=xnat
# The home directory of the Java development kit (JDK). You need at least
# JDK version 8. If JAVA_HOME is not set, some common directories for
# OpenJDK and the Oracle JDK are tried.
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
# You may pass JVM startup parameters to Java here. If you run Tomcat with
# Java 8 instead of 9 or newer, add "-XX:+UseG1GC" to select a suitable GC.
# If unset, the default options will be: -Djava.awt.headless=true
JAVA_OPTS="-Djava.awt.headless=true -XX:+UseConcMarkSweepGC -Xms1g -Xmx2g -XX:+UseConcMarkSweepGC -Dxnat.home=/data/xnat/home/"
# To enable remote debugging uncomment the following line.
# You will then be able to use a Java debugger on port 8000.
#JAVA_OPTS="${JAVA_OPTS} -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n"
# Java compiler to use for translating JavaServer Pages (JSPs). You can use all
# compilers that are accepted by Ant's build.compiler property.
#JSP_COMPILER=javac
# Enable the Java security manager? (true/false, default: false)
#SECURITY_MANAGER=true
# Whether to compress logfiles older than today's
#LOGFILE_COMPRESS=1
3) I changed the CATALINA_OPTS
CATALINA_OPTS="${CATALINA_OPTS} -Dxnat.home=/data/xnat/home"
4) Writing "sudo systemctl status tomcat9" I get this:
tomcat9.service - Apache Tomcat 9 Web Application Server
Loaded: loaded (/lib/systemd/system/tomcat9.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2022-09-06 14:59:38 CEST; 11s ago
Docs: https://tomcat.apache.org/tomcat-9.0-doc/index.html
Process: 266412 ExecStartPre=/usr/libexec/tomcat9/tomcat-update-policy.sh (code=exited, status=217/USER)
Sep 06 14:59:38 srv-xnat-ivd systemd[1]: Starting Apache Tomcat 9 Web Application Server...
Sep 06 14:59:38 srv-xnat-ivd systemd[266412]: tomcat9.service: Failed to determine user credentials: No such process
Sep 06 14:59:38 srv-xnat-ivd systemd[266412]: tomcat9.service: Failed at step USER spawning /usr/libexec/tomcat9/tomcat-update-policy.sh: No such process
Sep 06 14:59:38 srv-xnat-ivd systemd[1]: tomcat9.service: Control process exited, code=exited, status=217/USER
Sep 06 14:59:38 srv-xnat-ivd systemd[1]: tomcat9.service: Failed with result 'exit-code'.
Sep 06 14:59:38 srv-xnat-ivd systemd[1]: Failed to start Apache Tomcat 9 Web Application Server.
Can you help me please?
Thank you so much in advance.
Matteo