We use systemd with jsvc and our tomcat instances write to $CATALINA_BASE/logs by default.
On Thu, Aug 11, 2022 at 10:10 AM Paul Chauvet <chauv...@newpaltz.edu> wrote: > Hello all, > > I haven't been able to figure this out - but a catalina.out file is not > being generated for me. Sadly - I'm trying to troubleshoot an issue (with > a vendor's saml implementation) which wants to write to that file (and > doesn't seem to be writing what I need to catalina.YYYY-DD-MM.logs, > /var/log/messages, or into the journal as seen by "journalctl > --unit=tomcat.service"). > > > My environment: > > * RHEL 7.9 (though the same happens on my RHEL 8 hosts) > * Tomcat 9.0.63 (installed from the .tar.gz download from > https://tomcat.apache.org/download-90.cgi - not from the OS repository) > * Using jsvc via a systemd startup script to start Tomcat (that script > is at the bottom of this message). > > I've tried specifying CATALINA_OUT in setenv.sh, and in my systemd startup > script. I've temporarily disabled SELinux to see if that makes a > difference. Neither of those work. What does work, though I would like to > avoid it, is if I start Tomcat via ./startup.sh. If I do that - > catalina.out is generated but I'm not getting other settings I set in my > systemd script (or having it tied to startup/shutdown of the OS). > > I don't know what I'm missing or doing wrong here, or if there's something > about jsvc that is an issue here that I can't figure out. I've been unable > to find anything related to this (lots of posts about catalina.out related > to operating system distributed versions of Tomcat that don't appear to > apply). > > Any advice here would be greatly appreciated! > > My systemd startup script is below. > > > [Unit] > Description=Apache Tomcat Web Application Container > After=syslog.target network.target > > [Service] > Type=forking > PIDFile=/var/run/tomcat.pid > UMask=0007 > > # Tomcat variables > Environment='JAVA_HOME=/usr/lib/jvm/java-openjdk' > Environment='CATALINA_PID=/var/run/tomcat.pid' > Environment='CATALINA_HOME=/opt/tomcat/latest' > Environment='CATALINA_BASE=/opt/tomcat/latest' > Environment='CATALINA_OPTS=-Xms512M -Xmx2048M -XX:+UseParallelGC -server' > Environment='CATALINA_OUT=/var/log/tomcat/catalina.out' > > # Needed to make use of Tomcat Native Library > Environment='LD_LIBRARY_PATH=/opt/tomcat/latest/lib' > > ExecStart=/opt/tomcat/latest/bin/jsvc \ > -Dcatalina.home=${CATALINA_HOME} \ > -Dcatalina.base=${CATALINA_BASE} \ > -Djava.awt.headless=true \ > > -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \ > > -Djava.util.logging.config.file=${CATALINA_BASE}/conf/logging.properties \ > -Dlog4j2.FormatMsgNoLookups=true \ > -cp > ${CATALINA_HOME}/bin/commons-daemon.jar:${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcat-juli.jar > \ > -pidfile ${CATALINA_PID} \ > -java-home ${JAVA_HOME} \ > -user tomcat \ > $CATALINA_OPTS \ > org.apache.catalina.startup.Bootstrap > > ExecStop=/opt/tomcat/latest/bin/jsvc \ > -pidfile ${CATALINA_PID} \ > -stop \ > org.apache.catalina.startup.Bootstrap > > [Install] > WantedBy=multi-user.target > > > > > > > > Paul Chauvet, CISSP > > Information Security Officer > > State University of New York at New Paltz > > chauv...@newpaltz.edu > > -- Noelette Stout ITS Enterprise Applications - Senior Application Administrator Idaho State University E-mail: stounoel "at" isu "dot" edu Desk: 208-282-2554