Re: File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?

2020-07-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Coty,

On 7/7/20 15:23, Coty Sutherland wrote:
> 
>
> With this kind of service (and, similarly, Coty Sutherland's work
> @
>> RedHat), I might re-think my policy of always using the vanilla
>> packages from Apache.
>>
>> It's *really* nice when the package-manager can do it all.
>>
>
> It really is ;)

So why it RHEL dumping the Tomcat packages? Is it really because they
just want to cut-down on the size of the package repository?

They are going to have a lot of angry corporate clients (which is, of
course, the entire user base of RHEL).

- -chris
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl8E8wYACgkQHPApP6U8
pFg8ZBAAxOTvjZT8x6x18sS/ff6j6C57coNPsLohkFolvnL7CbJKJLY2ImKGYBD2
rciR0aUvxaMcyg4pobNmI8Ru3LNeMy07piNH3ZdpG4x9F3E6VNRDVASQIwWjdHoX
30Na9QgZ12DmWAypfhss1FZ1vcVynnxZ6mVDYtils40gcTNzjxDrr8gqPQz+N3RU
8c4+pE87uWsGok9mQ++Eq6XjgJsWYb8h2VKCJFgApPG6qKJnjqdkqjk2SAaY8Mig
YKkCyFlAs5pLsLRXAhLxbTiEn7AeCyP5n6eetqtkgj+R/P4Eej7i6vOSGor73VEb
rod88R5ph36IhgQH+US+qnk+C9q0+/uve0fiP/gHbZP2i3zW4X8g4fkyRwB+KPRG
WsDpWLALSoW0QZhKOtIZPya2EGhVb5gcXWzvFXkzDmRcap551ObYhc/Zq38AHPYj
FMgz20HDTILOr1VkLK1RViAGY1w+Gj/+UHIPNS9iDD4LG1VDUw6hembwTBowLANc
M2TYndPcu3yOIfncq7jOBMENHY42jGELxSfGaWg+WFXcuAbQLcdDGJYVeDH4yvVD
cyZ3X+y/qK7mcYWuwdLKY15vM7EeJ3E2knQhQ/nlZpWXqIfvqzRseeqcSF38dyPc
xIwM3lB5H0YtS/yhhaAc83ZqiWhWYLg0ZIbExDOI9whR4hWhyCQ=
=5mPo
-END PGP SIGNATURE-

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



Re: File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?

2020-07-07 Thread Coty Sutherland


With this kind of service (and, similarly, Coty Sutherland's work @
> RedHat), I might re-think my policy of always using the vanilla
> packages from Apache.
>
> It's *really* nice when the package-manager can do it all.
>

It really is ;)


Re: File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?

2020-06-25 Thread Emmanuel Bourg
Le 24/06/2020 à 03:33, Brian a écrit :

> To be honest with you, I'm happy about the catalina.out file finally getting 
> created and I really appreciate your kind help, I really do. But I'm not 
> really happy about having to restart rsyslog before every time I need to 
> restart Tomcat. It is weird, and I guess a lot of users will never imagine 
> that they have to do that and they will not feel very pleased when they 
> realize that the catalina.out file doesn't get created after restarting 
> Tomcat. And probably most of them will not even notice that the Tomcat log is 
> being added to the syslog, for that matter. This whole new relation between 
> syslog and Tomcat is really weird and I don't think the users are being 
> warned about it. I have used Tomcat+Ubuntu for several years and I haven't 
> seen this complication before. If there is an advantage about this relation 
> between syslog and Tomcat, I really can't see it. 

This is weird I fully agree, and I'll try do to something better.

There is a way to write to catalina.out without using rsyslogd, it's
possible to instruct systemd to write the process output directly to the
file by overriding the StandardOutput directive of the service file:

  StandardOutput=file:/var/log/tomcat9/catalina.out

This would go in a /etc/systemd/system/tomcat9.service.d/override.conf
file for example.

The downside is that you can no longer access the Tomcat output with
'journalctl -t tomcat9', nor see the last lines of the log when
displaying the status with 'systemctl status tomcat9'.

Ideally systemd should support writing to the journal and to a file
simultaneously, with something like StandardOutput=journal+file:... If
there is no other way to achieve the same result I'll file an
enhancement request on systemd.

Emmanuel Bourg

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



Re: File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?

2020-06-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Brian,

On 6/23/20 21:33, Brian wrote:
>
>
> -Original Message- From: Emmanuel Bourg
>  Reply-To: Tomcat Users List
>  Date: Tuesday, June 23, 2020 at 20:01 To:
> "users@tomcat.apache.org"  Subject: Re:
> File "catalina.out" not being created/populated when using Tomcat
> 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog
> instead?
>
> Le 24/06/2020 à 02:35, Brian a écrit :
>
>> Good news: I updated "/etc/tmpfiles.d/tomcat9.conf" (the file I
>> created) with the new value of 2770. Deleted all the logs inside
>> "/val/log/tomcat9" and restarted Ubuntu. "catalina.out" got
>> created and populated. Bad news: Then I deleted all the logs
>> inside "/val/log/tomcat9" and just restarted Tomcat (which is
>> something I do sometimes, in production). "catalina.out" didn't
>> get created this time.
>>
>> Just to confirm, again I deleted all the logs inside
>> "/val/log/tomcat9" and restarted Ubuntu. "catalina.out" got
>> created and populated again.
>>
>> Any ideas?
>
> The catalina.out file is held by rsyslogd and isn't recreated
> unless you restart rsyslogd. Try this when you clean the logs and
> restart Tomcat:
>
> systemctl restart rsyslog tomcat9
>
>
> Hi,
>
> I just realized that when the "bad news" experiment took place, in
> the syslog there was NOT another of those " file
> '/var/log/tomcat9/catalina.out': open error: Permission denied.."
> errors, so I guess it was not a permissions issue anymore, which
> makes me think that the "2770" value finally solved that issue.
> That is nice, thanks! OK, I restarted rsyslog and the started again
> Tomcat as you adviced and... you are right, the catalina.out file
> got created again. So I think you are right about rsyslogd still
> holding the log file.
>
> To be honest with you, I'm happy about the catalina.out file
> finally getting created and I really appreciate your kind help, I
> really do. But I'm not really happy about having to restart rsyslog
> before every time I need to restart Tomcat.
You don't have to restart rsyslog every time you restart Tomcat. You
just have to restart if if you delete its log file out from underneath i
t.

> It is weird, and I guess a lot of users will never imagine that
> they have to do that and they will not feel very pleased when they
> realize that the catalina.out file doesn't get created after
> restarting Tomcat. And probably most of them will not even notice
> that the Tomcat log is being added to the syslog, for that matter.
> This whole new relation between syslog and Tomcat is really weird
> and I don't think the users are being warned about it. I have used
> Tomcat+Ubuntu for several years and I haven't seen this
> complication before. If there is an advantage about this relation
> between syslog and Tomcat, I really can't see it.
This is how logging is done with systemd for better or worse.

- -chris
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl7zZ+kACgkQHPApP6U8
pFiD2xAApR/XqVexdg2uH/srGfUWL7DyRSebfAvf1fJuzLc+KlRSm205VeDl5KI3
P3Qoxdy7cHeW0GSQHpsf5Tdr9PqRyIN6hnCioFJMScNej1sqybjT9qeE43VVg4JY
rSTplVfaPvw+61ukdXC8SKcJniQGzCWAn0bL7B9Ij7rltN//UjlYtV1N30dvYdpD
6c5+kQbp0CcS/wHGz01VwUFYPCde3wLpbZNcBO39/rriCsGjCoN97moAM5A6HtWk
EYYXmByFrhbxjoQPiX/lqrJqVDRwCmGUcWdiv88qaZwlmKWgEUJEGpAROTGpBXWV
DoWEQH5U7te59A/FPTcIAAb2zayNEvDfYqUuR/uwGppQ4cnCC6YX4jKJuKNWuuJe
2pYim+2jDZGggG/XGtmNYJY97JprQGjGw3XkMcnQadTrKcMZNL9BnDVOEhubQfVy
dRQnq1vm1ObAW73xM38Sej2xL/llOOdkqr3icVenW31J02+RNf8Iu9gdxuXrls8P
3daaNZmlzPcgLVkKuOpprnpnCMd2z/RdiEQRhRO/jyj1HqB43KAauM+OPxh1Eq/a
ez2/I4amw7p+nZzHPy5YZ6kdjuY59qTehAhYPZY+CD7qQ0n0JYhCw9cQ43isVXYq
QnfY8fFvtOnc9Q6XuOdRz2BpmJwMD2mqq2GVlcOklvJcXyhnPV4=
=c7Q2
-END PGP SIGNATURE-

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



Re: File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?

2020-06-23 Thread Brian


-Original Message-
From: Emmanuel Bourg 
Reply-To: Tomcat Users List 
Date: Tuesday, June 23, 2020 at 20:01
To: "users@tomcat.apache.org" 
Subject: Re: File "catalina.out" not being created/populated when using Tomcat 
9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?

Le 24/06/2020 à 02:35, Brian a écrit :

> Good news: I updated "/etc/tmpfiles.d/tomcat9.conf" (the file I created) 
with the new value of 2770. Deleted all the logs inside "/val/log/tomcat9" and 
restarted Ubuntu. "catalina.out" got created and populated.
> Bad news: Then I deleted all the logs inside "/val/log/tomcat9" and just 
restarted Tomcat (which is something I do sometimes, in production). 
"catalina.out" didn't get created this time.
> 
> Just to confirm, again I deleted all the logs inside "/val/log/tomcat9" 
and restarted Ubuntu. "catalina.out" got created and populated again.
> 
> Any ideas?

The catalina.out file is held by rsyslogd and isn't recreated unless you
restart rsyslogd. Try this when you clean the logs and restart Tomcat:

  systemctl restart rsyslog tomcat9


Hi,

I just realized that when the "bad news" experiment took place, in the syslog 
there was NOT another of those " file '/var/log/tomcat9/catalina.out': open 
error: Permission denied.." errors, so I guess it was not a permissions issue 
anymore, which makes me think that the "2770" value finally solved that issue. 
That is nice, thanks!
OK, I restarted rsyslog and the started again Tomcat as you adviced and... you 
are right, the catalina.out file got created again. So I think you are right 
about rsyslogd still holding the log file.

To be honest with you, I'm happy about the catalina.out file finally getting 
created and I really appreciate your kind help, I really do. But I'm not really 
happy about having to restart rsyslog before every time I need to restart 
Tomcat. It is weird, and I guess a lot of users will never imagine that they 
have to do that and they will not feel very pleased when they realize that the 
catalina.out file doesn't get created after restarting Tomcat. And probably 
most of them will not even notice that the Tomcat log is being added to the 
syslog, for that matter. This whole new relation between syslog and Tomcat is 
really weird and I don't think the users are being warned about it. I have used 
Tomcat+Ubuntu for several years and I haven't seen this complication before. If 
there is an advantage about this relation between syslog and Tomcat, I really 
can't see it. 

Thanks again!

Brian




Re: File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?

2020-06-23 Thread Emmanuel Bourg
Le 24/06/2020 à 02:35, Brian a écrit :

> Good news: I updated "/etc/tmpfiles.d/tomcat9.conf" (the file I created) with 
> the new value of 2770. Deleted all the logs inside "/val/log/tomcat9" and 
> restarted Ubuntu. "catalina.out" got created and populated.
> Bad news: Then I deleted all the logs inside "/val/log/tomcat9" and just 
> restarted Tomcat (which is something I do sometimes, in production). 
> "catalina.out" didn't get created this time.
> 
> Just to confirm, again I deleted all the logs inside "/val/log/tomcat9" and 
> restarted Ubuntu. "catalina.out" got created and populated again.
> 
> Any ideas?

The catalina.out file is held by rsyslogd and isn't recreated unless you
restart rsyslogd. Try this when you clean the logs and restart Tomcat:

  systemctl restart rsyslog tomcat9

Emmanuel Bourg

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



Re: File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?

2020-06-23 Thread Brian


-Original Message-
From: Emmanuel Bourg 
Reply-To: Tomcat Users List 
Date: Tuesday, June 23, 2020 at 19:02
To: "users@tomcat.apache.org" 
Subject: Re: File "catalina.out" not being created/populated when using Tomcat 
9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?

Le 23/06/2020 à 19:48, Brian a écrit :

> It seems that rsyslogd is still unable to deal with 
"/var/log/tomcat9/catalina.out". 
> What could be wrong now? Do you have any ideas? 

I got the permissions wrong, the adm group is now allowed to write to
/var/log/tomcat9 but not to enter it. Try 2770 instead of 2760.

Emmanuel Bourg


Hi Emmanuel,

Good news: I updated "/etc/tmpfiles.d/tomcat9.conf" (the file I created) with 
the new value of 2770. Deleted all the logs inside "/val/log/tomcat9" and 
restarted Ubuntu. "catalina.out" got created and populated.
Bad news: Then I deleted all the logs inside "/val/log/tomcat9" and just 
restarted Tomcat (which is something I do sometimes, in production). 
"catalina.out" didn't get created this time.

Just to confirm, again I deleted all the logs inside "/val/log/tomcat9" and 
restarted Ubuntu. "catalina.out" got created and populated again.

Any ideas?

Brian


Re: File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?

2020-06-23 Thread Emmanuel Bourg
Le 23/06/2020 à 19:48, Brian a écrit :

> It seems that rsyslogd is still unable to deal with 
> "/var/log/tomcat9/catalina.out". 
> What could be wrong now? Do you have any ideas? 

I got the permissions wrong, the adm group is now allowed to write to
/var/log/tomcat9 but not to enter it. Try 2770 instead of 2760.

Emmanuel Bourg

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



Re: File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?

2020-06-23 Thread calder
I did this on my 18.04 [temporary test] system and it now works
(catalina.out is written to)
(the "ls" commands were for visual inspection on progress)

calder@ren: ~$ sudo service tomcat9 stop
calder@ren: ~$ sudo -u tomcat -g adm touch /var/log/tomcat9/catalina.out
calder@ren: ~$ ls -l /var/log/tomcat9/
[...]
calder@ren: ~$ sudo chown tomcat9:syslog /var/log/tomcat9 -R
calder@ren: ~$ sudo chown tomcat:syslog /var/log/tomcat9 -R
calder@ren: ~$ sudo ls -l /var/log
[...]
calder@ren: ~$ sudo chmod g+rwx /var/log/tomcat9/
calder@ren: ~$ sudo chmod g+rw /var/log/tomcat9/ -R
calder@ren: ~$ sudo chmod g+s /var/log/tomcat9/ -R
calder@ren: ~$ sudo service rsyslog restart
calder@ren: ~$ sudo service tomcat9 start
calder@ren: ~$ ls -l /var/log/tomcat9/
[...]
calder@ren: ~$ sudo ls -l /var/log/tomcat9/
-rw-rwS--- 1 tomcat syslog 26276 Jun 23 21:31 catalina.2020-06-23.log
-rw-rwSr-- 1 tomcat syslog  4125 Jun 23 21:31 catalina.out
-rw-rwS--- 1 tomcat syslog 0 Jun 23 19:51 localhost.2020-06-23.log
-rw-rwS--- 1 tomcat syslog  1462 Jun 23 20:53
localhost_access_log.2020-06-23.txt

calder@ren: ~$ sudo cat /var/log/tomcat9/catalina.out

[2020-06-23 21:30:57] [info] Server version name:   Apache
Tomcat/9.0.31 (Ubuntu)
[2020-06-23 21:30:57] [info] Server built:  Feb 24 2020 22:37:00 UTC
[2020-06-23 21:30:57] [info] Server version number: 9.0.31.0
[2020-06-23 21:30:57] [info] OS Name:   Linux
[2020-06-23 21:30:57] [info] OS Version:5.4.0-37-generic
[2020-06-23 21:30:57] [info] Architecture:  amd64
[2020-06-23 21:30:57] [info] Java Home:
/usr/lib/jvm/java-11-openjdk-amd64
[2020-06-23 21:30:57] [info] JVM Version:
11.0.7+10-post-Ubuntu-3ubuntu1
[ . . . ]
[2020-06-23 21:30:59] [info] Deployment of web application archive
[/var/lib/tomcat9/webapps/ourtest.war] has finished in [1,563] ms
[2020-06-23 21:31:00] [info] Starting ProtocolHandler ["http-nio-8080"]
[2020-06-23 21:31:00] [info] Server startup in [2,549] milliseconds

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



Re: File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?

2020-06-23 Thread Brian


-Original Message-
From: Emmanuel Bourg 
Date: Monday, June 22, 2020 at 18:14
To: Tomcat Users List , Brian 
Subject: Re: File "catalina.out" not being created/populated when using Tomcat 
9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?

Le 22/06/2020 à 18:43, Brian a écrit :

> I'm not really an expert with Linux. It would seem to me that the "adm" 
group (to which syslog seems to belong) lacks a write permission

Indeed, rsyslog in Ubuntu runs as syslog:adm and needs special
permissions to write to /var/log/tomcat9. This issue should be reported
to Ubuntu.

The tomcat9 package in Debian isn't affected by this issue because
rsyslogd runs as root.


> OK, I did it and the write permission was added to the adm group. I 
restarted Tomcat and it worked, the catalina.out file got created! However, 
after I restarted the whole Ubuntu, I discovered that the permissions went back 
to how there were (not write for adm). Why is that?

The permissions on this directory are managed by systemd-tmpfiles. The
tomcat9 package defines the expected permissions in
/usr/lib/tmpfiles.d/tomcat9.conf and the permissions are enforced when
the system starts.

It's possible to override the default settings, you have to copy the
configuration file to /etc/tmpfiles.d/ and change the permissions on
/var/log/tomcat9 from 2750 to 2760:

  cp /usr/lib/tmpfiles.d/tomcat9.conf /etc/tmpfiles.d/
  sed -i s/2750/2760/ /etc/tmpfiles.d/tomcat9.conf

The write permissions for the adm group will then be persistent.


Hi Emmanuel,

Thanks a lot for your help, but unfortunately I think that something is still 
not working.
I copied the file running the cp command, and then edited the created file to 
replace "2750" with "2760", then restarted Ubuntu But I still have the same 
problem, catalina.out never gets created.
Then I tried editing the original file (/usr/lib/tmpfiles.d/tomcat9.conf) 
replacing "2750" with "2760", then restarted Ubuntu But I still have the 
same problem.
I verified that the permissions stay correct, I mean giving write permission to 
the adm group after I restart Ubuntu, and that DOES work! When I perform a "ls 
-l /var/log/", this is what I see for the "tomcat9" directory:

drwxrwS---  3 tomcatadm4096 Jun 23 11:31 tomcat9

Finally, I checked the syslog and this is what I found:

Jun 23 12:27:43 ip-172-31-92-155 systemd[1]: Starting Apache Tomcat 9 Web 
Application Server...
Jun 23 12:27:43 ip-172-31-92-155 systemd[1]: Started Apache Tomcat 9 Web 
Application Server.
Jun 23 12:27:43 ip-172-31-92-155 tomcat9[594]: NOTE: Picked up 
JDK_JAVA_OPTIONS:  --add-opens=java.base/java.lang=ALL-UNNAMED 
--add-opens=java.base/java.io=ALL-UNNAMED 
--add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
Jun 23 12:27:43 ip-172-31-92-155 rsyslogd: file 
'/var/log/tomcat9/catalina.out': open error: Permission denied [v8.2001.0 try 
https://www.rsyslog.com/e/2433 ]
Jun 23 12:27:44 ip-172-31-92-155 tomcat9[594]: Jun 23, 2020 12:27:44 PM 
org.apache.catalina.startup.VersionLoggerListener log
Jun 23 12:27:44 ip-172-31-92-155 tomcat9[594]: INFO: Server version name:   
Apache Tomcat/9.0.31 (Ubuntu)
.

It seems that rsyslogd is still unable to deal with 
"/var/log/tomcat9/catalina.out". 
What could be wrong now? Do you have any ideas? 

Brian



Emmanuel Bourg

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



Re: File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?

2020-06-23 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Emmanuel,

On 6/22/20 19:14, Emmanuel Bourg wrote:
> Le 22/06/2020 à 18:43, Brian a écrit :
>
>> I'm not really an expert with Linux. It would seem to me that the
>> "adm" group (to which syslog seems to belong) lacks a write
>> permission
>
> Indeed, rsyslog in Ubuntu runs as syslog:adm and needs special
> permissions to write to /var/log/tomcat9. This issue should be
> reported to Ubuntu.
>
> The tomcat9 package in Debian isn't affected by this issue because
> rsyslogd runs as root.
>
>
>> OK, I did it and the write permission was added to the adm group.
>> I restarted Tomcat and it worked, the catalina.out file got
>> created! However, after I restarted the whole Ubuntu, I
>> discovered that the permissions went back to how there were (not
>> write for adm). Why is that?
>
> The permissions on this directory are managed by systemd-tmpfiles.
> The tomcat9 package defines the expected permissions in
> /usr/lib/tmpfiles.d/tomcat9.conf and the permissions are enforced
> when the system starts.
>
> It's possible to override the default settings, you have to copy
> the configuration file to /etc/tmpfiles.d/ and change the
> permissions on /var/log/tomcat9 from 2750 to 2760:
>
> cp /usr/lib/tmpfiles.d/tomcat9.conf /etc/tmpfiles.d/ sed -i
> s/2750/2760/ /etc/tmpfiles.d/tomcat9.conf
>
> The write permissions for the adm group will then be persistent.
>
>
>> In any case, why is this permission required in my new VPS, if
>> the old one lacks it and catalina.out works perfectly?
>
> I guess your older VPS had the tomcat8 package installed. The
> tomcat9 package is different as it leverages several systemd
> features to improve the security and the reliability.

With this kind of service (and, similarly, Coty Sutherland's work @
RedHat), I might re-think my policy of always using the vanilla
packages from Apache.

It's *really* nice when the package-manager can do it all.

- -chris
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl7yHp4ACgkQHPApP6U8
pFjrOg//akrAF8ZQlS2d5943zClVfwoddOW+I2clK7IYqJcu4LIIMm07v73aVVhe
eAYLQLOZTXM6u3SHI4rsobGDO5QBb4wa0xxKEZFcq+pr809zzwvwd9gufuYfuNFj
xa37zyzQzv0vuhfHZNYy6eUhThVS9eSPLu0vZQnLxNExoMiVM3BNMm0evYjQHwO2
97BtwhTP9IBPjRFLvzyKCmhcotNbqY+bnn5610k5+rgBz5A/Az/ZBLHOhOb5cjWZ
1L/Ue2P86WWl2/5Dqu4IVrN1TQldyr2RQtCbcWjR4LhTKZoBNc+vyhFu/LExfexy
18mvoUY7jNKTwoJ7CiC0p7iy6Se89DzNqUzlCqUC6/1P9pRi9oYDBmeEUEnjaQ7E
tlw/GQbgALk8X+gq0hNMS9HOvlyZOZlN5iBS56cYFOje8iJrasDhxDcqWdhRqpsg
F1S42eGVk37oBpnY7dZcf/SoAmp/vIesGZ5iVi9qKSLgLbmmKGZo2/C4OnyMVkdD
+zMbcK6ClHCGK5lDVys0Hobc8gblLkUc2PY9yOxxD7Cyyml4hQ+0DzQYDbNwggAn
BAuElpOUDyzjyHYkLD12IP8ZC3ZcSZA/MnR1hHU6pbAC4tXA0sjhU6WaWP2wDIyS
hixxYgF8PoM9CwdHHnw6/ROpiqCZeIBn1NYNWcQmxMZALBWOUZ0=
=72na
-END PGP SIGNATURE-

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



Re: File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?

2020-06-23 Thread Emmanuel Bourg
Le 23/06/2020 à 02:53, Brian a écrit :

> Please do! It definitely looks like a bug.
> I just reported the bug here: 
> https://bugs.launchpad.net/ubuntu/+source/tomcat9/+bug/1884591

I've just uploaded tomcat9/9.0.36-1 in Debian and changed the
permissions [1] on the log directory. This will propagate to Ubuntu
sooner or later.

Emmanuel Bourg

[1] https://salsa.debian.org/java-team/tomcat9/-/commit/51128fe9

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



Re: File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?

2020-06-22 Thread Brian


-Original Message-
From: Emmanuel Bourg 
Reply-To: Tomcat Users List 
Date: Monday, June 22, 2020 at 15:36
To: "users@tomcat.apache.org" 
Subject: Re: File "catalina.out" not being created/populated when using Tomcat 
9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?

Le 22/06/2020 à 20:03, Christopher Schultz a écrit :

> It looks like whoever is responsible for packing Tomcat for Ubuntu has
> something missing, there. I suggest you file a bug with Ubuntu.

That must be me :) I'll get a look.

Emmanuel Bourg


Hi Emmanuel,

Please do! It definitely looks like a bug.
I just reported the bug here: 
https://bugs.launchpad.net/ubuntu/+source/tomcat9/+bug/1884591
 

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



Re: File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?

2020-06-22 Thread Emmanuel Bourg
Le 22/06/2020 à 18:43, Brian a écrit :

> I'm not really an expert with Linux. It would seem to me that the "adm" group 
> (to which syslog seems to belong) lacks a write permission

Indeed, rsyslog in Ubuntu runs as syslog:adm and needs special
permissions to write to /var/log/tomcat9. This issue should be reported
to Ubuntu.

The tomcat9 package in Debian isn't affected by this issue because
rsyslogd runs as root.


> OK, I did it and the write permission was added to the adm group. I restarted 
> Tomcat and it worked, the catalina.out file got created! However, after I 
> restarted the whole Ubuntu, I discovered that the permissions went back to 
> how there were (not write for adm). Why is that?

The permissions on this directory are managed by systemd-tmpfiles. The
tomcat9 package defines the expected permissions in
/usr/lib/tmpfiles.d/tomcat9.conf and the permissions are enforced when
the system starts.

It's possible to override the default settings, you have to copy the
configuration file to /etc/tmpfiles.d/ and change the permissions on
/var/log/tomcat9 from 2750 to 2760:

  cp /usr/lib/tmpfiles.d/tomcat9.conf /etc/tmpfiles.d/
  sed -i s/2750/2760/ /etc/tmpfiles.d/tomcat9.conf

The write permissions for the adm group will then be persistent.


> In any case, why is this permission required in my new VPS, if the old one 
> lacks it and catalina.out works perfectly?

I guess your older VPS had the tomcat8 package installed. The tomcat9
package is different as it leverages several systemd features to improve
the security and the reliability.

Emmanuel Bourg

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



Re: File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?

2020-06-22 Thread Emmanuel Bourg
Le 22/06/2020 à 10:44, calder a écrit :

> However, this is one reason we do not use "distro-specific" Tomcat
> installations (to include implementations of WebSphere and WebLogic).
> .
> For example, we grab the plain vanilla Tomcat ZIP and extract it to "/opt/"
> (as in "/opt/tomcat/") - we now have complete control over its
> configuration and runtime instantiation.

This is a valid strategy, but you miss the tight integration with the
system that comes out of the box with a distro specific package (proper
system service, started on boot, restarted on crashes, run by a non
privileged user allowed to bind to ports below 1024, sandboxed, with
logs in a consistent location). And you are still able to override some
aspects of the default configuration you might not like.

Emmanuel Bourg

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



Re: File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?

2020-06-22 Thread Emmanuel Bourg
Le 22/06/2020 à 20:03, Christopher Schultz a écrit :

> It looks like whoever is responsible for packing Tomcat for Ubuntu has
> something missing, there. I suggest you file a bug with Ubuntu.

That must be me :) I'll get a look.

Emmanuel Bourg

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



Re: File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?

2020-06-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Brian,

On 6/22/20 12:43, Brian wrote:
>
> -BEGIN PGP SIGNED MESSAGE- Hash: SHA256
>
> Brian,
>
> On 6/22/20 02:04, Brian wrote:
>>  Hello,
>>
>> I have been using Tomcat for about 18 years. As far as I can
>> remember, everything that I leave on the log with
>> System.out.println() has been found inside the file
>> "catalina.out" which has been nice. However, this seems to have
>> changed. I just migrated to Ubuntu 20.04 + Tomcat 9.0.31, and
>> installed Tomcat doing a "sudo apt install tomcat9". Now I see
>> that the file "catalina.out" never gets created, and that
>> everything that had been sent there is now being sent to the
>> Ubuntu/Linux/Debian log "syslog". I don't like that, I want to
>> keep having a separate/dedicated log for Tomcat (which is
>> something I check very often) and not havoing to search for it
>> inside syslog (which is something I rarely inspect).
>>
>> I have done some research, and this is what I have discovered (if
>> I understood everything correctly):
>>
>> - Tomcat now runs as a service inside something called "systemsd"
>> - For some reason, the people at Ubuntu/Debian/Linux decided
>> that Tomcat's log should be found inside syslog, instead of
>> staying independent inside "catalina.out". Why is that? I don't
>> know and I don't like it! - The other files inside
>> /var/log/tomcat get created, including the
>> "catalina.-MM-DD.log" files. But I dont' find my
>> "System.out.println()" messages there, which has always been the
>> case. - I have found, however, that syslog tries to create and
>> populate the "catalina.out" file as well, since I have found an
>> error inside syslog that says something like "rsyslogd: file
>> '/var/log/tomcat9/catalina.out': open error: Permission denied".
>> - I have also found a file "/etc/rsyslog.d/tomcat9.conf" which,
>> indeed, seams to indicate syslog that the file
>> "/var/log/tomcat9/catalina.out" must be populated. Which makes
>> sense and should solve my needs. - Considering the "Permission
>> denied" error message, I started playing with the permissions
>> (something that I really don't have much experience with). If I
>> remember correctly, I created the file "catalina.out" manually,
>> and the modified its properties so the owners are "tomcat/adm",
>> since the "syslog" process/user seems to be inside the "adm"
>> group. Restarted everything... and the "catalina.out" file got
>> created and populated!!! So it seems that the main obstacle here
>> is a lack of correct permissions so syslog can do what has been
>> told and populate the "catalina.out" file. Did I get it right? -
>> However, when I delete all the log files (which I do every once
>> in a while), the permissions that I assigned get lost and the
>> file doesn't get created anymore.
>>
>> What are we supposed to do to deal with this problem? Can/should
>> we do something so the Tomcat log doesn't go to syslog? If not,
>> and considering that it seems that syslog is trying to populate
>> the "catalina.out" file as it has been told, what should we do
>> to correct the permissions problem?
>
> What are the permissions of the /var/log/tomcat directory?
>
> Hello Chris,
>
> I did a "ls -l /var/log/". According to that, this is what I see
> for "/var/log/tomcat9": drwxr-s---  3 tomcatadm
> 4096 Jun 22 10:51 tomcat9
>
> I'm not really an expert with Linux. It would seem to me that the
> "adm" group (to which syslog seems to belong) lacks a write
> permission, but in my old instance (Tomcat 8.5.39 + Ubuntu 18.04)
> the "catalina.out" file works perfectly (gets created and
> populated) and this is what I see there, it doesn't seem to me that
> the adm group has a write permission there either: drwxr-x---  3
> tomcat8   adm   4096 Jun 22 10:00 tomcat8
>
> Perhaps you need to chmod g+w /var/log/tomcat ? - -chris
>
> OK, I did it and the write permission was added to the adm group. I
> restarted Tomcat and it worked, the catalina.out file got
> created! However, after I restarted the whole Ubuntu, I discovered
> that the permissions went back to how there were (not write for
> adm). Why is that? In fact, now I remember that I tried this
> before, but since I restarted the whole Ubuntu instead of just
> Tomcat, I never saw any progress. I didn't notice that it would
> have worked if I just restarted Tomcat.
>
> In any case, why is this permission required in my new VPS, if the
> old one lacks it and catalina.out works perfectly?

It looks like whoever is responsible for packing Tomcat for Ubuntu has
something missing, there. I suggest you file a bug with Ubuntu.

- -chris
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl7w8lwACgkQHPApP6U8
pFicVg/7BbuJTaZVf2jTBP9WupuWfVo5YeNy2VXsCYv26xXbzVZXOrDpjrXpPQ9/
yA4oz2c3MeWyyEqtSUeft6X7c8ayKKBbwPpGGc+/20VRsKDYv0aOiNd+MfpdmhOJ

Re: File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?

2020-06-22 Thread Brian

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Brian,

On 6/22/20 02:04, Brian wrote:
>  Hello,
>
> I have been using Tomcat for about 18 years. As far as I can
> remember, everything that I leave on the log with
> System.out.println() has been found inside the file "catalina.out"
> which has been nice. However, this seems to have changed. I just
> migrated to Ubuntu 20.04 + Tomcat 9.0.31, and installed Tomcat
> doing a "sudo apt install tomcat9". Now I see that the file
> "catalina.out" never gets created, and that everything that had
> been sent there is now being sent to the Ubuntu/Linux/Debian log
> "syslog". I don't like that, I want to keep having a
> separate/dedicated log for Tomcat (which is something I check very
> often) and not havoing to search for it inside syslog (which is
> something I rarely inspect).
>
> I have done some research, and this is what I have discovered (if I
> understood everything correctly):
>
> - Tomcat now runs as a service inside something called "systemsd" -
> For some reason, the people at Ubuntu/Debian/Linux decided that
> Tomcat's log should be found inside syslog, instead of staying
> independent inside "catalina.out". Why is that? I don't know and I
> don't like it! - The other files inside /var/log/tomcat get
> created, including the "catalina.-MM-DD.log" files. But I dont'
> find my "System.out.println()" messages there, which has always
> been the case. - I have found, however, that syslog tries to create
> and populate the "catalina.out" file as well, since I have found an
> error inside syslog that says something like "rsyslogd: file
> '/var/log/tomcat9/catalina.out': open error: Permission denied". -
> I have also found a file "/etc/rsyslog.d/tomcat9.conf" which,
> indeed, seams to indicate syslog that the file
> "/var/log/tomcat9/catalina.out" must be populated. Which makes
> sense and should solve my needs. - Considering the "Permission
> denied" error message, I started playing with the permissions
> (something that I really don't have much experience with). If I
> remember correctly, I created the file "catalina.out" manually, and
> the modified its properties so the owners are "tomcat/adm", since
> the "syslog" process/user seems to be inside the "adm" group.
> Restarted everything... and the "catalina.out" file got created and
> populated!!! So it seems that the main obstacle here is a lack of
> correct permissions so syslog can do what has been told and
> populate the "catalina.out" file. Did I get it right? - However,
> when I delete all the log files (which I do every once in a while),
> the permissions that I assigned get lost and the file doesn't get
> created anymore.
>
> What are we supposed to do to deal with this problem? Can/should we
> do something so the Tomcat log doesn't go to syslog? If not, and
> considering that it seems that syslog is trying to populate the
> "catalina.out" file as it has been told, what should we do to
> correct the permissions problem?

What are the permissions of the /var/log/tomcat directory?

Hello Chris,

I did a "ls -l /var/log/". According to that, this is what I see for 
"/var/log/tomcat9":
drwxr-s---  3 tomcatadm4096 Jun 22 10:51 tomcat9

I'm not really an expert with Linux. It would seem to me that the "adm" group 
(to which syslog seems to belong) lacks a write permission, but in my old 
instance (Tomcat 8.5.39 + Ubuntu 18.04) the "catalina.out" file works perfectly 
(gets created and populated) and this is what I see there, it doesn't seem to 
me that the adm group has a write permission there either:
drwxr-x---  3 tomcat8   adm   4096 Jun 22 10:00 tomcat8

Perhaps you need to chmod g+w /var/log/tomcat ?
- -chris

OK, I did it and the write permission was added to the adm group. I restarted 
Tomcat and it worked, the catalina.out file got created! However, after I 
restarted the whole Ubuntu, I discovered that the permissions went back to how 
there were (not write for adm). Why is that?
In fact, now I remember that I tried this before, but since I restarted the 
whole Ubuntu instead of just Tomcat, I never saw any progress. I didn't notice 
that it would have worked if I just restarted Tomcat.

In any case, why is this permission required in my new VPS, if the old one 
lacks it and catalina.out works perfectly? 




Re: File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?

2020-06-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Brian,

On 6/22/20 02:04, Brian wrote:
>  Hello,
>
> I have been using Tomcat for about 18 years. As far as I can
> remember, everything that I leave on the log with
> System.out.println() has been found inside the file "catalina.out"
> which has been nice. However, this seems to have changed. I just
> migrated to Ubuntu 20.04 + Tomcat 9.0.31, and installed Tomcat
> doing a "sudo apt install tomcat9". Now I see that the file
> "catalina.out" never gets created, and that everything that had
> been sent there is now being sent to the Ubuntu/Linux/Debian log
> "syslog". I don't like that, I want to keep having a
> separate/dedicated log for Tomcat (which is something I check very
> often) and not havoing to search for it inside syslog (which is
> something I rarely inspect).
>
> I have done some research, and this is what I have discovered (if I
> understood everything correctly):
>
> - Tomcat now runs as a service inside something called "systemsd" -
> For some reason, the people at Ubuntu/Debian/Linux decided that
> Tomcat's log should be found inside syslog, instead of staying
> independent inside "catalina.out". Why is that? I don't know and I
> don't like it! - The other files inside /var/log/tomcat get
> created, including the "catalina.-MM-DD.log" files. But I dont'
> find my "System.out.println()" messages there, which has always
> been the case. - I have found, however, that syslog tries to create
> and populate the "catalina.out" file as well, since I have found an
> error inside syslog that says something like "rsyslogd: file
> '/var/log/tomcat9/catalina.out': open error: Permission denied". -
> I have also found a file "/etc/rsyslog.d/tomcat9.conf" which,
> indeed, seams to indicate syslog that the file
> "/var/log/tomcat9/catalina.out" must be populated. Which makes
> sense and should solve my needs. - Considering the "Permission
> denied" error message, I started playing with the permissions
> (something that I really don't have much experience with). If I
> remember correctly, I created the file "catalina.out" manually, and
> the modified its properties so the owners are "tomcat/adm", since
> the "syslog" process/user seems to be inside the "adm" group.
> Restarted everything... and the "catalina.out" file got created and
> populated!!! So it seems that the main obstacle here is a lack of
> correct permissions so syslog can do what has been told and
> populate the "catalina.out" file. Did I get it right? - However,
> when I delete all the log files (which I do every once in a while),
> the permissions that I assigned get lost and the file doesn't get
> created anymore.
>
> What are we supposed to do to deal with this problem? Can/should we
> do something so the Tomcat log doesn't go to syslog? If not, and
> considering that it seems that syslog is trying to populate the
> "catalina.out" file as it has been told, what should we do to
> correct the permissions problem?

What are the permissions of the /var/log/tomcat directory?

Perhaps you need to chmod g+w /var/log/tomcat ?

- -chris
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl7w0hUACgkQHPApP6U8
pFgABA/7BwxNOI313uSbRMSFPpdilpxhTkmujrvcit+A8lpre0hSNOUw2Q6i38L6
uT536ff2TwrFoizfEz/ydEW8lZQoEOWejlXPU8eO3/ehi7Gpat645+a559rCjr3m
S5vfKw1UqrjKQXkeSlFGH1SFaKJfEnSKyjeH+/5yWVTL0z4G6Zatt9iZyUdHbPKh
cuTrSpgfuOlsPdqKvO/7Y7gWoLqb52+17gawN6rrviRHs6U1S9EIgTWk0of1JYe/
K2l2ob9DfuVJCW+byL5FPE0AEwzyWMfh1W1yEMRGJKsUHFv+5BaXXRyc/yh9/E/l
vqf+7OJPJ2V5Kp9KasX6NxBiyCGxH910lfyooeEIRAYmiWx61FD6OTcrklm5boEN
fT7KyeuujIhnQSIq+c+0rKX+t2DtyQCuqP/e5SFiUt4WL4xH85e5FaoExk2ZlOoP
E5phuijWPJakSTiXBG4cKRQyFqzLVqHSl6VbCHEzbj6rDHaiqOW0Wqs+Z2OV5q1k
c7vMiHbawiqlo+5NzB/kVG+HISMQvK0lmuLsZOUaGFv2E5L85UuQhp2KLD01j0AF
iEizODrxbs3AVs3+jx/LM6mXhqb6oCq93DLbWwuV0mhOTX6Dj1VxqkSUUiyyElD5
bCFl5dfyc0gc+daEAj32gshL9MBDPCkkyvBKO/N3Wdy2YnLP4GM=
=ltDw
-END PGP SIGNATURE-

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



Re: File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?

2020-06-22 Thread Chris Cheshire



> On Jun 22, 2020, at 4:44 AM, calder  wrote:
> 
> On Mon, Jun 22, 2020, 01:04 Brian  wrote
> 
> [ snip ]
> 
> - For some reason, the people at Ubuntu/Debian/Linux decided that Tomcat's
>> log should be found inside syslog, instead of staying independent inside
>> "catalina.out". Why is that? I don't know and I don't like it!
> 
> [ snip ]
> .
> Sorry - don't have a specific answer for your Ubuntu implementation.
> .
> However, this is one reason we do not use "distro-specific" Tomcat
> installations (to include implementations of WebSphere and WebLogic).
> .
> For example, we grab the plain vanilla Tomcat ZIP and extract it to "/opt/"
> (as in "/opt/tomcat/") - we now have complete control over its
> configuration and runtime instantiation.

+1

Also it is far better to use a logging framework than writing directly to 
System.out as you have more control over when and where the logs are written. 
You can use java.util.logging (juli) directly or even a facade like SLF4j and 
then use whatever implementation you like behind it. The advantage of the 
facade is that the implementation (logback, log4j, juli) can be changed with 
configuration and a new jar instead of code changes everywhere you write to the 
logs.

With either method you can write logs at different levels (trace, debug, info, 
warn error - juli does use different names though, same idea) and turn them 
on/off in configuration and even dynamically.

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



Re: File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?

2020-06-22 Thread calder
On Mon, Jun 22, 2020, 01:04 Brian  wrote

[ snip ]

- For some reason, the people at Ubuntu/Debian/Linux decided that Tomcat's
> log should be found inside syslog, instead of staying independent inside
> "catalina.out". Why is that? I don't know and I don't like it!

[ snip ]
.
Sorry - don't have a specific answer for your Ubuntu implementation.
.
However, this is one reason we do not use "distro-specific" Tomcat
installations (to include implementations of WebSphere and WebLogic).
.
For example, we grab the plain vanilla Tomcat ZIP and extract it to "/opt/"
(as in "/opt/tomcat/") - we now have complete control over its
configuration and runtime instantiation.