You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Cheltenham, Chris" <cc...@philasd.org> on 2018/04/05 13:08:59 UTC

tomcat


There is a behavior I see in tomcat at times which is puzzling to me.

 

Sometimes when I start up tomcat it doesn't log anything.

 

Maybe I am restarting ti to fast?

 

I don't have any other symptoms to report other than . sometimes when a
start tomcat it does not log anything.

 

Does anyone know why that happens?

 

 

 

===========================

Thank You;

Chris Cheltenham
Technology Services
The School District of Philadelphia

Work # 215-400-5025
Cell # 215-301-6571 


RE: tomcat

Posted by "Cheltenham, Chris" <cc...@philasd.org>.
Certainly,

I took this from digital oceans posted web page on how to.
I am not sure what the umask is doing there either but it doesn't keep 
tomcat from functioning.
I also tried to run this as a non-root user but I was overruled by 
management for the time being.


# Systemd unit file for tomcat
[Unit]
Description=Apache Tomcat Web Application Container
After=syslog.target network.target

[Service]
Type=forking

Environment=JAVA_HOME=/opt/java
Environment=CATALINA_PID=/opt/apache-tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/apache-tomcat
Environment=CATALINA_BASE=/opt/apache-tomcat
Environment=CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC -Djava.net.preferIPv4Stack=true
Environment=JAVA_OPTS=-Dlog4j.configurationFile=/etc/cas/log4j2.xml -Djava.awt.headless=true 
 -Djava.security.egd=file:/dev/./urandom

ExecStart=/opt/apache-tomcat/bin/catalina.sh start
ExecStop=/opt/apache-tomcat/bin/catalina.sh stop

User=root
Group=root
UMask=0007
RestartSec=15
Restart=always

[Install]
WantedBy=multi-user.target

===========================

Thank You;

Chris Cheltenham
Technology Services
The School District of Philadelphia

Work # 215-400-5025
Cell # 215-301-6571


-----Original Message-----
From: Christopher Schultz <ch...@christopherschultz.net>
Sent: Thursday, April 5, 2018 12:45 PM
To: users@tomcat.apache.org
Subject: Re: tomcat

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Chris,

On 4/5/18 11:13 AM, Cheltenham, Chris wrote:
> Thanks for answering. It's not a big problem just a bit annoying.
>
> I created a system service. Maybe I did not format it correctly.
>
> What [I] generally do is stop tomcat #systemctl stop tomcat And then
> blow out the /opt/apache-tomcat/logs files.

That should be safe.

> Then restart it as #systemctl start tomcat.

So should that.

> Sometimes it starts but there are not files in /opt/apache-tomcat/logs
> As soon as I see that I stop it and start it again.
>
> I delete the logs so I have less minutia to parse through.

Maybe your system service is doing something unexpected. Could you post what 
you've got?

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlrGUp8ACgkQHPApP6U8
pFhZ6A//Q4hYSS3+VKcLK0H3q7hOymf5mhE1+iSvhz7p22dCVy8VSMVtbroxTgtK
nvcfQ5ytcFgcleNmp2Oj7y96Ab5sxdh+MsA0JuC5Oq3sA1hoOSL/iR+CCZa4VOAZ
RF5EVJorXbPm+KunvqjkdFwIu/1M+k3a/jmJQgxqRGKrZ/5TfV+BHkbEUkdz06d8
OLkMSROd28hvbkwMozvLRwAK8JJRgfNWiK60PF7OXNW4uydxG5RXm0Sb5gpRXGxj
I9YRU9jStFpfnKSQtnR+UeMrzUdPTB9hodu4M945M5Prmtlo2E3V5okDu7f6bv+v
OS991/wxf9xqTitBn/DCCa4jrabKRaOlncDW8L2efmR2P1PnECb9TBmwE6dEFTRO
0HdnFswdgKTal9+re5dRQ0kapjuroN1WRztLlKUa1r4S0C9Tstb87+hvnnhrFhd3
1rE1zmAxZboHlFRhsZKQjlqdKefZReFUf4CXcH6/WKzimupZFBPfOQMdCRNeTkKX
IcPxzLPAWHKhf6TKJZoa/xEes1n734cBs4NCq/k5ftexoNxV6TqD+SgfCh8j1H9/
ZNprsKcNyG28tzIou3eo7D4V1/wLiFzixhgwarT3fo4Esw29KHbJQA8ts4O/qehv
xZBiMc8piQTY3IN4U3TAufP03nZqzKFuAtdRUqKQ58VvEv2bZYI=
=7K9X
-----END PGP SIGNATURE-----

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


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


Re: tomcat

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Chris,

On 4/5/18 11:13 AM, Cheltenham, Chris wrote:
> Thanks for answering. It's not a big problem just a bit annoying.
> 
> I created a system service. Maybe I did not format it correctly.
> 
> What [I] generally do is stop tomcat #systemctl stop tomcat And
> then blow out the /opt/apache-tomcat/logs files.

That should be safe.

> Then restart it as #systemctl start tomcat.

So should that.

> Sometimes it starts but there are not files in
> /opt/apache-tomcat/logs As soon as I see that I stop it and start
> it again.
> 
> I delete the logs so I have less minutia to parse through.

Maybe your system service is doing something unexpected. Could you
post what you've got?

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlrGUp8ACgkQHPApP6U8
pFhZ6A//Q4hYSS3+VKcLK0H3q7hOymf5mhE1+iSvhz7p22dCVy8VSMVtbroxTgtK
nvcfQ5ytcFgcleNmp2Oj7y96Ab5sxdh+MsA0JuC5Oq3sA1hoOSL/iR+CCZa4VOAZ
RF5EVJorXbPm+KunvqjkdFwIu/1M+k3a/jmJQgxqRGKrZ/5TfV+BHkbEUkdz06d8
OLkMSROd28hvbkwMozvLRwAK8JJRgfNWiK60PF7OXNW4uydxG5RXm0Sb5gpRXGxj
I9YRU9jStFpfnKSQtnR+UeMrzUdPTB9hodu4M945M5Prmtlo2E3V5okDu7f6bv+v
OS991/wxf9xqTitBn/DCCa4jrabKRaOlncDW8L2efmR2P1PnECb9TBmwE6dEFTRO
0HdnFswdgKTal9+re5dRQ0kapjuroN1WRztLlKUa1r4S0C9Tstb87+hvnnhrFhd3
1rE1zmAxZboHlFRhsZKQjlqdKefZReFUf4CXcH6/WKzimupZFBPfOQMdCRNeTkKX
IcPxzLPAWHKhf6TKJZoa/xEes1n734cBs4NCq/k5ftexoNxV6TqD+SgfCh8j1H9/
ZNprsKcNyG28tzIou3eo7D4V1/wLiFzixhgwarT3fo4Esw29KHbJQA8ts4O/qehv
xZBiMc8piQTY3IN4U3TAufP03nZqzKFuAtdRUqKQ58VvEv2bZYI=
=7K9X
-----END PGP SIGNATURE-----

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


RE: tomcat

Posted by "Cheltenham, Chris" <cc...@philasd.org>.
Chris,

Thanks for answering.
It's not a big problem just a bit annoying.

I created a system service.
Maybe I did not format it correctly.

What si generally do is stop tomcat
#systemctl stop tomcat
And then blow out the /opt/apache-tomcat/logs files.

Then restart it as
#systemctl start tomcat.

Sometimes it starts but there are not files in /opt/apache-tomcat/logs
As soon as I see that I stop it and start it again.

I delete the logs so I have less minutia to parse through.



===========================

Thank You;

Chris Cheltenham
Technology Services
The School District of Philadelphia

Work # 215-400-5025
Cell # 215-301-6571


-----Original Message-----
From: Christopher Schultz <ch...@christopherschultz.net>
Sent: Thursday, April 5, 2018 10:58 AM
To: users@tomcat.apache.org
Subject: Re: tomcat

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Chris,

On 4/5/18 9:08 AM, Cheltenham, Chris wrote:
> There is a behavior I see in tomcat at times which is puzzling to me.
>
> Sometimes when I start up tomcat it doesn’t log anything.

To which files? Any of them?

> Maybe I am restarting it too fast?

Possibly. How are you restarting it?

> I don’t have any other symptoms to report other than sometimes when a
> start tomcat it does not log anything.
>
> Does anyone know why that happens?

My guess is that your restart process somehow rotates the file(s) you are 
expecting out of the way (or deletes them) but the new process has already 
started logging to them, so it looks like nothing is happening.

On *NIX systems, processes will happily continue to write to deleted files 
and the data basically never makes it to the disk. (Actually, it does make 
it to the disk, but no other process can reasonably read that data).

Another possibility is that Tomcat is basically not starting, due to e.g. a 
port conflict. When this happens, Tomcat logs a small amount and shuts down. 
But in that case, you'd be saying "Tomcat does not start up again" so that's 
probably not the case, here.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlrGOXQACgkQHPApP6U8
pFh7lQ/5AYCBtjfuj4qUpblWv6HqkrseMBpF9Anc2dP8wm7Q2A2Wp7WT/SMciyw+
1V+YEQRHDwPlPpjFVfXa2zxvYcSz8uqTK8okvwwXd8nApS59T9TAG2vtwbZtt5lH
HOrU/qin1JCm3L03OB5iumMVYJit5Fr/NKEULHQewk/FVV+8zCDeRFXw0DXg2I64
Tq9CvNpAaGSqWZ8FAxMe57unX3XayTiMtTf3muYCZqFk0kDCoXhrvDVMm2F2Kf/p
k2GR/sbgiHVDdvqUZcMveoTyWlXhiqnYBQziLtMhglsqOkGcG4ijNNW+dFvNhCbK
g9LU8ptxug/We3xJqmfq6jJlGThl9/KAQfFb3kwi5OPnrEsMPCCbv8Kg5XtaCgPW
pr1JniRIoZpSeO0DNa2T3vXzZ4IlJ1Xeh4+gPfIBUoDOGwoxQrhyAjG1KYLPyc9G
QnBN7z9PglRSJ88g3F1dJShAj/unN6x5WjzAPuer7BRjX4/CiXn+2I1HwbP6E2q3
fSlIFugUCm2fQ5LvolhRCcMVr98fhCIqISBC77fA7vbLr9djVgLVqpXL1aCJg4Zj
R7l8wngDRIdBXFghjWFiAIbZtx1IifKUfFOYkWpM4Y2nfa3rPBkjF6bF+18tapyY
6GFEoyvPGC50yt2YhwqyLPTpLl8bYI8KZQevDvKlFbCuAPKnHOw=
=yE/b
-----END PGP SIGNATURE-----

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


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


Re: tomcat

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Chris,

On 4/5/18 9:08 AM, Cheltenham, Chris wrote:
> There is a behavior I see in tomcat at times which is puzzling to
> me.
> 
> Sometimes when I start up tomcat it doesn’t log anything.

To which files? Any of them?

> Maybe I am restarting it too fast?

Possibly. How are you restarting it?

> I don’t have any other symptoms to report other than sometimes when
> a start tomcat it does not log anything.
> 
> Does anyone know why that happens?

My guess is that your restart process somehow rotates the file(s) you
are expecting out of the way (or deletes them) but the new process has
already started logging to them, so it looks like nothing is happening.

On *NIX systems, processes will happily continue to write to deleted
files and the data basically never makes it to the disk. (Actually, it
does make it to the disk, but no other process can reasonably read
that data).

Another possibility is that Tomcat is basically not starting, due to
e.g. a port conflict. When this happens, Tomcat logs a small amount
and shuts down. But in that case, you'd be saying "Tomcat does not
start up again" so that's probably not the case, here.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlrGOXQACgkQHPApP6U8
pFh7lQ/5AYCBtjfuj4qUpblWv6HqkrseMBpF9Anc2dP8wm7Q2A2Wp7WT/SMciyw+
1V+YEQRHDwPlPpjFVfXa2zxvYcSz8uqTK8okvwwXd8nApS59T9TAG2vtwbZtt5lH
HOrU/qin1JCm3L03OB5iumMVYJit5Fr/NKEULHQewk/FVV+8zCDeRFXw0DXg2I64
Tq9CvNpAaGSqWZ8FAxMe57unX3XayTiMtTf3muYCZqFk0kDCoXhrvDVMm2F2Kf/p
k2GR/sbgiHVDdvqUZcMveoTyWlXhiqnYBQziLtMhglsqOkGcG4ijNNW+dFvNhCbK
g9LU8ptxug/We3xJqmfq6jJlGThl9/KAQfFb3kwi5OPnrEsMPCCbv8Kg5XtaCgPW
pr1JniRIoZpSeO0DNa2T3vXzZ4IlJ1Xeh4+gPfIBUoDOGwoxQrhyAjG1KYLPyc9G
QnBN7z9PglRSJ88g3F1dJShAj/unN6x5WjzAPuer7BRjX4/CiXn+2I1HwbP6E2q3
fSlIFugUCm2fQ5LvolhRCcMVr98fhCIqISBC77fA7vbLr9djVgLVqpXL1aCJg4Zj
R7l8wngDRIdBXFghjWFiAIbZtx1IifKUfFOYkWpM4Y2nfa3rPBkjF6bF+18tapyY
6GFEoyvPGC50yt2YhwqyLPTpLl8bYI8KZQevDvKlFbCuAPKnHOw=
=yE/b
-----END PGP SIGNATURE-----

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