Public bug reported:

Steps to reproduce:

Install  Ubuntu 7.10.  Install the tomcat5.5 package, and make sure the
anacron package is *not* installed (which is the case if you use the
server install CD).  Use "sudo touch -m -t 198101010000
/var/log/tomcat5.5/test.log" to create a log file older than two weeks.
Wait a day, and notice that /var/log/tomcat5.5/test.log is still there,
although manually running "sudo /etc/cron.daily/tomcat5.5" from a
command line *does* delete it.

Reason:  /etc/crontab uses run-parts(8) to run the scripts in
/etc/cron.{hourly,daily,weekly,monthly} if anacron is not installed.
The run-parts(8) command only runs scripts that match /[a-zA-Z0-9_-]+/
by default (according to the manpage), and the "tomcat5.5" script
contains a period.  This causes run-parts to silently ignore the
tomcat5.5 script.

I see four potential solutions to this:

1. rename the cron job to something like "tomcat5".  This means it will
not have the same name as the package, which is bad, but seems to be the
solution in other places.

2. add the --lsbsysinit switch to the run-parts command in /etc/crontab.
This means that the *.disabled scripts will also be run, which is
potentially bad, but only if users actually create them.

3. rename the package to something that doesn't contain a period
(tomcat55? tomcat5-5? tomcat5 version 5.5.x?), to follow the debian
package naming conventions.  This means you have to deal with the
transitional package headache, probably breaking a lot of existing
systems.  This is bad.

4. change run-parts to allow something like
/[a-zA-Z0-9_-]+([0-9]+(\.[0-9]+)*)?/, to allow for things like mysql-
server-5.0 and other common package names that include a version string
at the end, but not things like foo.disabled.  This might break things
in other places where run-parts is used, which is bad.

** Affects: tomcat5.5 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
tomcat5.5 cronjob doesn't run (wrong name for run-parts)
https://bugs.launchpad.net/bugs/159661
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to