[Bug 1964881] Re: Logging/Log rotation does not work for catalina.out

Andreas Hasenack 1964881 at bugs.launchpad.net
Wed Jul 20 17:28:08 UTC 2022


** Description changed:

+ [Impact]
+ 
+  * An explanation of the effects of the bug on users and
+ 
+  * justification for backporting the fix to the stable release.
+ 
+  * In addition, it is helpful, but not required, to include an
+    explanation of how the upload fixes this bug.
+ 
+ [Test Plan]
+ 
+  * detailed instructions how to reproduce the bug
+ 
+  * these should allow someone who is not familiar with the affected
+    package to reproduce the bug and verify that the updated package fixes
+    the problem.
+ 
+  * if other testing is appropriate to perform before landing this update,
+    this should also be described here.
+ 
+ [Where problems could occur]
+ 
+  * Think about what the upload changes in the software. Imagine the change is
+    wrong or breaks something else: how would this show up?
+ 
+  * It is assumed that any SRU candidate patch is well-tested before
+    upload and has a low overall risk of regression, but it's important
+    to make the effort to think about what ''could'' happen in the
+    event of a regression.
+ 
+  * This must '''never''' be "None" or "Low", or entirely an argument as to why
+    your upload is low risk.
+ 
+  * This both shows the SRU team that the risks have been considered,
+    and provides guidance to testers in regression-testing the SRU.
+ 
+ [Other Info]
+  
+  * Anything else you think is useful to include
+  * Anticipate questions from users, SRU, +1 maintenance, security teams and the Technical Board
+  * and address these questions in advance
+ 
+ [Original Description]
+ 
  In Ubuntu 20.04, with `tomcat9-9.0.31-1ubuntu0.1` (latest) package, `logrotated` is not able to write to `/var/log/tomcat/catalina.out`
  This could be fixed in a newer package but was not backported:
  https://bugs.launchpad.net/ubuntu/+source/tomcat9/+bug/1861881
  
  In Ubuntu 22.04, with `tomcat9-9.0.58-1` (latest)  package, `logrotated`
  is not able to rotate `/var/log/tomcat/catalina.out`
  
  Because the `catalina.out` is created with `syslog:adm` ownerships.
  `syslog` user does not have enough permissions to change this.
  
  This causes following error:
  
  rsyslogd: error during config processing: omfile: chown for file
  '/var/log/tomcat9/catalina.out' failed: Operation not permitted
  [v8.2112.0 try https://www.rsyslog.com/e/2207 ]
  
  At the same time, the  `/etc/logrotate.d/tomcat9` has `su tomcat adm`
  directive. Therefore the `logrotated` is not able to truncate the
  `/var/log/tomcat/catalina.out`
  
  This causes logrotate to copy the contents of `/var/log/tomcat/catalina.out` to as if it would be rotated. As `catalina.out` is never truncated, each rotated file ends up having the contents of `catalina.out` from the beginning of the tomcat installation. This causes the log sizes to keep increasing as no actual log rotation is being done.
- --- 
+ ---
  ProblemType: Bug
  ApportVersion: 2.20.11-0ubuntu79
  Architecture: amd64
  CasperMD5CheckResult: pass
  DistroRelease: Ubuntu 22.04
  InstallationDate: Installed on 2022-02-27 (18 days ago)
  InstallationMedia: Ubuntu 22.04 LTS "Jammy Jellyfish" - Alpha amd64 (20220121)
  Package: tomcat9 9.0.58-1
  PackageArchitecture: all
  ProcVersionSignature: Ubuntu 5.15.0-18.18-generic 5.15.12
  RebootRequiredPkgs: Error: path contained symlinks.
  Tags:  jammy
  Uname: Linux 5.15.0-18-generic x86_64
  UpgradeStatus: No upgrade log present (probably fresh install)
  UserGroups: N/A
  _MarkForUpload: True

-- 
You received this bug notification because you are a member of Ubuntu
Sponsors Team, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/1964881

Title:
  Logging/Log rotation does not work for catalina.out

Status in tomcat9 package in Ubuntu:
  Fix Released
Status in tomcat9 source package in Focal:
  In Progress
Status in tomcat9 source package in Jammy:
  In Progress
Status in tomcat9 package in Debian:
  New

Bug description:
  [Impact]

   * An explanation of the effects of the bug on users and

   * justification for backporting the fix to the stable release.

   * In addition, it is helpful, but not required, to include an
     explanation of how the upload fixes this bug.

  [Test Plan]

   * detailed instructions how to reproduce the bug

   * these should allow someone who is not familiar with the affected
     package to reproduce the bug and verify that the updated package fixes
     the problem.

   * if other testing is appropriate to perform before landing this update,
     this should also be described here.

  [Where problems could occur]

   * Think about what the upload changes in the software. Imagine the change is
     wrong or breaks something else: how would this show up?

   * It is assumed that any SRU candidate patch is well-tested before
     upload and has a low overall risk of regression, but it's important
     to make the effort to think about what ''could'' happen in the
     event of a regression.

   * This must '''never''' be "None" or "Low", or entirely an argument as to why
     your upload is low risk.

   * This both shows the SRU team that the risks have been considered,
     and provides guidance to testers in regression-testing the SRU.

  [Other Info]
   
   * Anything else you think is useful to include
   * Anticipate questions from users, SRU, +1 maintenance, security teams and the Technical Board
   * and address these questions in advance

  [Original Description]

  In Ubuntu 20.04, with `tomcat9-9.0.31-1ubuntu0.1` (latest) package, `logrotated` is not able to write to `/var/log/tomcat/catalina.out`
  This could be fixed in a newer package but was not backported:
  https://bugs.launchpad.net/ubuntu/+source/tomcat9/+bug/1861881

  In Ubuntu 22.04, with `tomcat9-9.0.58-1` (latest)  package,
  `logrotated` is not able to rotate `/var/log/tomcat/catalina.out`

  Because the `catalina.out` is created with `syslog:adm` ownerships.
  `syslog` user does not have enough permissions to change this.

  This causes following error:

  rsyslogd: error during config processing: omfile: chown for file
  '/var/log/tomcat9/catalina.out' failed: Operation not permitted
  [v8.2112.0 try https://www.rsyslog.com/e/2207 ]

  At the same time, the  `/etc/logrotate.d/tomcat9` has `su tomcat adm`
  directive. Therefore the `logrotated` is not able to truncate the
  `/var/log/tomcat/catalina.out`

  This causes logrotate to copy the contents of `/var/log/tomcat/catalina.out` to as if it would be rotated. As `catalina.out` is never truncated, each rotated file ends up having the contents of `catalina.out` from the beginning of the tomcat installation. This causes the log sizes to keep increasing as no actual log rotation is being done.
  ---
  ProblemType: Bug
  ApportVersion: 2.20.11-0ubuntu79
  Architecture: amd64
  CasperMD5CheckResult: pass
  DistroRelease: Ubuntu 22.04
  InstallationDate: Installed on 2022-02-27 (18 days ago)
  InstallationMedia: Ubuntu 22.04 LTS "Jammy Jellyfish" - Alpha amd64 (20220121)
  Package: tomcat9 9.0.58-1
  PackageArchitecture: all
  ProcVersionSignature: Ubuntu 5.15.0-18.18-generic 5.15.12
  RebootRequiredPkgs: Error: path contained symlinks.
  Tags:  jammy
  Uname: Linux 5.15.0-18-generic x86_64
  UpgradeStatus: No upgrade log present (probably fresh install)
  UserGroups: N/A
  _MarkForUpload: True

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/tomcat9/+bug/1964881/+subscriptions




More information about the Ubuntu-sponsors mailing list