-----Original Message-----
From: Emmanuel Bourg <ebo...@apache.org>
Date: Monday, June 22, 2020 at 18:14
To: Tomcat Users List <users@tomcat.apache.org>, Brian <brian...@emailbb.com>
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 tomcat    adm                4096 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

Reply via email to