RE: Issue with catalina.out not being generated (RHEL 7.9, tomcat 9.0.63)

2022-08-11 Thread Hiran CHAUDHURI
CONFIDENTIAL & RESTRICTED

AFAIK catalina.out is just written by redirecting Tomcat's stdout to that file. 
So if you run Tomcat from any kind of wrapper such as jsvc, what is this going 
to do to Tomcat's stdout?

See 'Considerations for production usage' on this page: 
https://tomcat.apache.org/tomcat-9.0-doc/logging.html#Considerations_for_production_usage
As it also states that you end up with two copies of the same messages, you 
should not be really missing stuff but finding it in a different location.

Hiran

-Original Message-
From: Paul Chauvet 
Sent: Thursday, August 11, 2022 20:25
To: users@tomcat.apache.org
Subject: Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat 
9.0.63)

CAUTION: External mail. Be careful with links and attachments.


Hi Chris,

I honestly don't care if they are in catalina.out, /var/log/messages, or a file 
named 'awesomestuff.log' - I just know that things are MISSING.

Let me be more specific - sorry if I'm not being clear here!


Normal operation (running via systemd) - I get Tomcat startup/shutdown, and 
some other info in catalina--MM-DD.log.  I don't get the debug information 
for opensaml.

When I start via startup.sh directly - a lot more is being logged to 
catalina.out than anywhere else I have been able to find.


I tried starting Tomcat without using systemd by just doing the following - but 
still no catalina.out.
/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



I ended up temporarily just starting via startup.sh just long enough to get the 
error logs I was looking for into catalina.out - then started it up again 
normally.


Sorry to bother everyone with this - but I appreciate your assistance!



From: Christopher Schultz 
Sent: Thursday, August 11, 2022 1:34 PM
To: users@tomcat.apache.org 
Subject: Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat 
9.0.63)

CAUTION: Message from a non-New Paltz email server. Treat message, links, and 
attachments with extra caution.


Paul,

On 8/11/22 13:03, Paul Chauvet wrote:
> Hi Noelette,
>
> Thanks for the reponse!
>
> It logs to catalina--MM-DD.log, localhost.YY-MM-DD.log, 
> localhost_access_log.-MM-DD.txt - but it doesn't use catalina.out.
>
> When I temporarily started Tomcat via startup.sh it did create catalina.out 
> (and start logging the things that it wasn't logging into the other files, 
> /var/log/messages, or the systemd journal).
>
> I'll see if I can get my setup (at least temporarily) working with startup.sh.

OH... you might just be misunderstanding what's happening.

When you use catalina.sh start (or startup.sh), that script just does this:

java [stuff] > ${CATALINA_BASE}/logs/catalina.out 2>&1

When you run with jsvc, it includes some built-in file-rotation and so 
catalina-[date].log is the same thing.

Are you irritated that you can't read the logs, or are you irritated that the 
log file isn't specifically "catalina.out"?

-chris

> 
> From: Noelette Stout 
> Sent: Thursday, August 11, 2022 12:35 PM
> To: Tomcat Users List 
> Subject: Re: Issue with catalina.out not being generated (RHEL 7.9,
> tomcat 9.0.63)
>
> CAUTION: Message from a non-New Paltz email server. Treat message, links, and 
> attachments with extra caution.
>
>
> 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  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.-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://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftomcat.apache.org%2Fdownload-90.

Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat 9.0.63)

2022-08-11 Thread Paul Chauvet
Hi Noelette,

Definitely not a dumb question.  Trust me - I've missed obvious things before.  
In this case though - Tomcat is definitely starting fine via systemd and has 
been running without issue (through various upgrades from 8.5.x and through 
9.0.x versions, though I still need to upgrade to 9.0.64).

Everything's working fine - except the catalina.out logging for opensaml (which 
we're trying to troubleshoot as we move from CAS to SAML for authentication - 
but without the logs for the saml issues the vendor couldn't assist).  Now that 
I have those debug logs - it's in that vendor's hands as to find out what's 
wrong .

I will look at the daemon startup method you list though - thank you!



Paul Chauvet, CISSP

Information Security Officer

State University of New York at New Paltz

chauv...@newpaltz.edu

[cid:aaa5e02a-2ded-4434-b7d6-c140c723291e]

Keep on a lookout for fraudulent emails!  For examples reported to us - see the 
"New Paltz PhishBowl<https://www.newpaltz.edu/phishbowl>"


From: Noelette Stout 
Sent: Thursday, August 11, 2022 2:52 PM
To: Tomcat Users List 
Subject: Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat 
9.0.63)

CAUTION: Message from a non-New Paltz email server. Treat message, links, and 
attachments with extra caution.


dumb question time -- Is tomcat actually starting up all the way when you
run with systemd? One of the things that I ran into with tomcat and systemd
was that the default service start timeout was not enough time for tomcat
to start. Also, I'm not starting tomcat by calling jsvc directly; I'm using
the daemon.sh script. Here's what one of my tomcat unit files looks like:

[Unit]
Description= CAS server (Tomcat)
After=syslog.target network-online.target

[Service]
Type=forking
User=tomcat
Group=tomcat
Environment=CATALINA_HOME=/var/local/tomcat/tomcat
Environment=CATALINA_BASE=/var/local/tomcat/cas
Environment=JAVA_HOME=/var/local/tomcat/java
ExecStart=/var/local/tomcat/tomcat/bin/daemon.sh start
ExecStop=/var/local/tomcat/tomcat/bin/daemon.sh stop
RemainAfterExit=yes
TimeoutSec=300
[Install]
WantedBy=multi-user.target

I also have a setenv.sh file in $CATALINA_BASE/bin with this (yes, it's a
little redundant):
export JAVA_HOME="/var/local/tomcat/java"
export CATALINA_HOME="/var/local/tomcat/tomcat"
export CATALINA_BASE="/var/local/tomcat/cas"
CATALINA_PID="$CATALINA_BASE/logs/tomcat.pid"
CATALINA_OPTS="-server -Xmx512m -Dlog4j2.formatMsgNoLookups=true"
SERVICE_START_WAIT_TIME=300

I always get a catalina-daemon.out file when starting this way.

On Thu, Aug 11, 2022 at 12:25 PM Paul Chauvet  wrote:

> Hi Chris,
>
> I honestly don't care if they are in catalina.out, /var/log/messages, or a
> file named 'awesomestuff.log' - I just know that things are MISSING.
>
> Let me be more specific - sorry if I'm not being clear here!
>
>
> Normal operation (running via systemd) - I get Tomcat startup/shutdown,
> and some other info in catalina--MM-DD.log.  I don't get the debug
> information for opensaml.
>
> When I start via startup.sh directly - a lot more is being logged to
> catalina.out than anywhere else I have been able to find.
>
>
> I tried starting Tomcat without using systemd by just doing the following
> - but still no catalina.out.
> /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
>
>
>
> I ended up temporarily just starting via startup.sh just long enough to
> get the error logs I was looking for into catalina.out - then started it up
> again normally.
>
>
> Sorry to bother everyone with this - but I appreciate your assistance!
>
>
> ________
> From: Christopher Schultz 
> Sent: Thursday, August 11, 2022 1:34 PM
> To: users@tomcat.apache.org 
> Subject: Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat
> 9.0.63)
>
> CAUTION: Message from a non-New Paltz email server. Treat message, links,
> and attachments with extra caution.
>
>
> Paul,
>
> On 8/11/22 13:03, Paul Chauvet wrote:
> > Hi Noelette,
> >
> > Thanks for the reponse!
> >
> > It logs to c

Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat 9.0.63)

2022-08-11 Thread Noelette Stout
dumb question time -- Is tomcat actually starting up all the way when you
run with systemd? One of the things that I ran into with tomcat and systemd
was that the default service start timeout was not enough time for tomcat
to start. Also, I'm not starting tomcat by calling jsvc directly; I'm using
the daemon.sh script. Here's what one of my tomcat unit files looks like:

[Unit]
Description= CAS server (Tomcat)
After=syslog.target network-online.target

[Service]
Type=forking
User=tomcat
Group=tomcat
Environment=CATALINA_HOME=/var/local/tomcat/tomcat
Environment=CATALINA_BASE=/var/local/tomcat/cas
Environment=JAVA_HOME=/var/local/tomcat/java
ExecStart=/var/local/tomcat/tomcat/bin/daemon.sh start
ExecStop=/var/local/tomcat/tomcat/bin/daemon.sh stop
RemainAfterExit=yes
TimeoutSec=300
[Install]
WantedBy=multi-user.target

I also have a setenv.sh file in $CATALINA_BASE/bin with this (yes, it's a
little redundant):
export JAVA_HOME="/var/local/tomcat/java"
export CATALINA_HOME="/var/local/tomcat/tomcat"
export CATALINA_BASE="/var/local/tomcat/cas"
CATALINA_PID="$CATALINA_BASE/logs/tomcat.pid"
CATALINA_OPTS="-server -Xmx512m -Dlog4j2.formatMsgNoLookups=true"
SERVICE_START_WAIT_TIME=300

I always get a catalina-daemon.out file when starting this way.

On Thu, Aug 11, 2022 at 12:25 PM Paul Chauvet  wrote:

> Hi Chris,
>
> I honestly don't care if they are in catalina.out, /var/log/messages, or a
> file named 'awesomestuff.log' - I just know that things are MISSING.
>
> Let me be more specific - sorry if I'm not being clear here!
>
>
> Normal operation (running via systemd) - I get Tomcat startup/shutdown,
> and some other info in catalina--MM-DD.log.  I don't get the debug
> information for opensaml.
>
> When I start via startup.sh directly - a lot more is being logged to
> catalina.out than anywhere else I have been able to find.
>
>
> I tried starting Tomcat without using systemd by just doing the following
> - but still no catalina.out.
> /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
>
>
>
> I ended up temporarily just starting via startup.sh just long enough to
> get the error logs I was looking for into catalina.out - then started it up
> again normally.
>
>
> Sorry to bother everyone with this - but I appreciate your assistance!
>
>
> ____________________
> From: Christopher Schultz 
> Sent: Thursday, August 11, 2022 1:34 PM
> To: users@tomcat.apache.org 
> Subject: Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat
> 9.0.63)
>
> CAUTION: Message from a non-New Paltz email server. Treat message, links,
> and attachments with extra caution.
>
>
> Paul,
>
> On 8/11/22 13:03, Paul Chauvet wrote:
> > Hi Noelette,
> >
> > Thanks for the reponse!
> >
> > It logs to catalina--MM-DD.log, localhost.YY-MM-DD.log,
> localhost_access_log.-MM-DD.txt - but it doesn't use catalina.out.
> >
> > When I temporarily started Tomcat via startup.sh it did create
> catalina.out (and start logging the things that it wasn't logging into the
> other files, /var/log/messages, or the systemd journal).
> >
> > I'll see if I can get my setup (at least temporarily) working with
> startup.sh.
>
> OH... you might just be misunderstanding what's happening.
>
> When you use catalina.sh start (or startup.sh), that script just does this:
>
> java [stuff] > ${CATALINA_BASE}/logs/catalina.out 2>&1
>
> When you run with jsvc, it includes some built-in file-rotation and so
> catalina-[date].log is the same thing.
>
> Are you irritated that you can't read the logs, or are you irritated
> that the log file isn't specifically "catalina.out"?
>
> -chris
>
> > 
> > From: Noelette Stout 
> > Sent: Thursday, August 11, 2022 12:35 PM
> > To: Tomcat Users List 
> > Subject: Re: Issue with catalina.out not being generated (RHEL 7.9,
> tomcat 9.0.63)
> >
> > CAUTION: Message from a non-New Paltz email server. Treat message,
> links, an

Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat 9.0.63)

2022-08-11 Thread Paul Chauvet
Hi Chris,

I honestly don't care if they are in catalina.out, /var/log/messages, or a file 
named 'awesomestuff.log' - I just know that things are MISSING.

Let me be more specific - sorry if I'm not being clear here!


Normal operation (running via systemd) - I get Tomcat startup/shutdown, and 
some other info in catalina--MM-DD.log.  I don't get the debug information 
for opensaml.

When I start via startup.sh directly - a lot more is being logged to 
catalina.out than anywhere else I have been able to find.


I tried starting Tomcat without using systemd by just doing the following - but 
still no catalina.out.
/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



I ended up temporarily just starting via startup.sh just long enough to get the 
error logs I was looking for into catalina.out - then started it up again 
normally.


Sorry to bother everyone with this - but I appreciate your assistance!



From: Christopher Schultz 
Sent: Thursday, August 11, 2022 1:34 PM
To: users@tomcat.apache.org 
Subject: Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat 
9.0.63)

CAUTION: Message from a non-New Paltz email server. Treat message, links, and 
attachments with extra caution.


Paul,

On 8/11/22 13:03, Paul Chauvet wrote:
> Hi Noelette,
>
> Thanks for the reponse!
>
> It logs to catalina--MM-DD.log, localhost.YY-MM-DD.log, 
> localhost_access_log.-MM-DD.txt - but it doesn't use catalina.out.
>
> When I temporarily started Tomcat via startup.sh it did create catalina.out 
> (and start logging the things that it wasn't logging into the other files, 
> /var/log/messages, or the systemd journal).
>
> I'll see if I can get my setup (at least temporarily) working with startup.sh.

OH... you might just be misunderstanding what's happening.

When you use catalina.sh start (or startup.sh), that script just does this:

java [stuff] > ${CATALINA_BASE}/logs/catalina.out 2>&1

When you run with jsvc, it includes some built-in file-rotation and so
catalina-[date].log is the same thing.

Are you irritated that you can't read the logs, or are you irritated
that the log file isn't specifically "catalina.out"?

-chris

> 
> From: Noelette Stout 
> Sent: Thursday, August 11, 2022 12:35 PM
> To: Tomcat Users List 
> Subject: Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat 
> 9.0.63)
>
> CAUTION: Message from a non-New Paltz email server. Treat message, links, and 
> attachments with extra caution.
>
>
> 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  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.-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 rela

Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat 9.0.63)

2022-08-11 Thread Christopher Schultz

Paul,

On 8/11/22 13:03, Paul Chauvet wrote:

Hi Noelette,

Thanks for the reponse!

It logs to catalina--MM-DD.log, localhost.YY-MM-DD.log, 
localhost_access_log.-MM-DD.txt - but it doesn't use catalina.out.

When I temporarily started Tomcat via startup.sh it did create catalina.out 
(and start logging the things that it wasn't logging into the other files, 
/var/log/messages, or the systemd journal).

I'll see if I can get my setup (at least temporarily) working with startup.sh.


OH... you might just be misunderstanding what's happening.

When you use catalina.sh start (or startup.sh), that script just does this:

java [stuff] > ${CATALINA_BASE}/logs/catalina.out 2>&1

When you run with jsvc, it includes some built-in file-rotation and so 
catalina-[date].log is the same thing.


Are you irritated that you can't read the logs, or are you irritated 
that the log file isn't specifically "catalina.out"?


-chris



From: Noelette Stout 
Sent: Thursday, August 11, 2022 12:35 PM
To: Tomcat Users List 
Subject: Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat 
9.0.63)

CAUTION: Message from a non-New Paltz email server. Treat message, links, and 
attachments with extra caution.


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  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.-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



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat 9.0.63)

2022-08-11 Thread Paul Chauvet
Hi Noelette,

Thanks for the reponse!

It logs to catalina--MM-DD.log, localhost.YY-MM-DD.log, 
localhost_access_log.-MM-DD.txt - but it doesn't use catalina.out.

When I temporarily started Tomcat via startup.sh it did create catalina.out 
(and start logging the things that it wasn't logging into the other files, 
/var/log/messages, or the systemd journal).

I'll see if I can get my setup (at least temporarily) working with startup.sh.


From: Noelette Stout 
Sent: Thursday, August 11, 2022 12:35 PM
To: Tomcat Users List 
Subject: Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat 
9.0.63)

CAUTION: Message from a non-New Paltz email server. Treat message, links, and 
attachments with extra caution.


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  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.-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


Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat 9.0.63)

2022-08-11 Thread Noelette Stout
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  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.-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


Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat 9.0.63)

2022-08-11 Thread Christopher Schultz

Paul,

On 8/11/22 12:09, Paul Chauvet 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.-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).


Typically, systemd captures stdout/stderr and sends it to journald or 
whatever. Writing to log files is apparently too quaint.



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).


It seems that you are just resisting doing things the Systemd Way.

Have you tried poking-around with journalctl to see if you can get the logs?

If "catalina.sh start/run" works for you, then the issue lies with your 
systemd configuration/environment.


-chris

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org