Your message dated Mon, 30 May 2011 23:02:32 +0000
with message-id <[email protected]>
and subject line Bug#627859: fixed in cron 3.0pl1-117
has caused the Debian Bug report #627859,
regarding cron: won't reload file after fixed syntax error or missing newline 
at EOF
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
627859: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=627859
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: cron
Version: 3.0pl1-116
Severity: normal

I ran into this on Ubuntu Natty initially, but I can reproduce this on
Debian Unstable, too.

It seems to be a more seldom and not yet fixed special case of the
otherwise fixed http://bugs.debian.org/555954. As parts of #555954
definitely have been fixed, I decided not to reopen #555954 but file a
new bug report and just refer to #555954.

Here's how to reproduce the issue manually (a script for automated
testing of the issue can be found later in this bug report):

Create two valid crontab files in /etc/cron.d/, e.g test1 and test2. (I
used "echo sometext `date` >> /tmp/cron-test" as command and changed the
string "sometext" every time I edited the file.

Then remove the final newline from test1. cron will spit out the
following warning via syslog:

  May 24 23:05:01 nemo cron.info /usr/sbin/cron[1474]: (*system*test1) ERROR 
(Missing newline before EOF, this crontab file will be ignored)

The cronjobs from test2 will continue to work, those in test1 won't.

Now fix the missing newline in test1 by adding it again. It still won't
run the cronjobs in there until you either:

  * Edit _another_ file in /etc/cron.d/, e.g. test2
  * Create a new in /etc/cron.d/, e.g. test3
  * Delete a file from /etc/cron.d/, e.g. test2
  * Restart cron.

If I produce a syntax error like in http://bugs.debian.org/555954
(e.g. by writing "syntax error" on a line of its own in test1 without a
leading "#"), the same applies.

So the "cron won't pick up new files in this directory" part of #555954
is fixed, but the "cron won't reload it" unfortunately isn't.

IMHO cron should at least stat files in /etc/cron.d with known syntax
errors every time and recheck their syntax if the mtime has changed, not
only if other (valid) files have changed, vanished or popped up.

The "mv local-test{~,}" pf Josip in [1] doesn't cover respectively
avoids this case as it also changes other files in the directory (it
removes "local-test~") which seems to trigger that cron checks _all_
files again.

  [1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=555954#101

With regards to Xavier's tests as described at
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=555954#129 I can't
reproduce his results with the commands he gave for Squeeze. (I even
used vi as he did, but that may result in one out of idontknowhowmany
packages in Debian. Here it results in using nvi. :-) I suspect that
possibly other files in the directory have been touched accidentially,
too, or the bug has been reintroduced since then, but the cron package
in Sid is still the same as in Squeeze, so the changed would have to be
in another package then...

So to be sure that I run the test without the danger of collateral
changes, I fully automated it. See script, syslog and output below.

I monitored the syslog with "logread -f | fgrep -i --color cron" of the
installed busybox-syslogd package, but a "tail -F /var/log/syslog | grep
-i cron" or similar should work fine on systems with a normal syslog
daemon, too.

The script:

---snip---
#!/bin/sh

# Create the test crontabs
echo 'syntax error' > test1
echo '* * * * * root echo test2 `date` >> /tmp/cron-test' > test2

#  See what's all in /etc/cron.d/
ls -la --full-time /etc/cron.d/

# Sleep for two minutes. Now at least once, the syntax error should pop
# up in the syslog and test2 should be executed twice.
sleep 120

# Fix crontab file test1
echo '* * * * * root echo test1-fixed `date` >> /tmp/cron-test' > test1

# Sleep for another two minutes. Only test2 should be executed.
sleep 120

# Now change test2
echo '* * * * * root echo test2-changed `date` >> /tmp/cron-test' > test2

# Sleep for another two minutes. Both, test1 and test2 should be executed.
sleep 120
---snap---

Executing the script with "sh -x" yields the following output:

---snip---
+ echo syntax error
+ echo * * * * * root echo test2 `date` >> /tmp/cron-test
+ ls -la --full-time /etc/cron.d/
total 44
drwxr-xr-x   2 root root  4096 2011-05-25 00:16:08.000000000 +0200 .
drwxr-xr-x 197 root root 20480 2011-05-24 23:53:33.000000000 +0200 ..
-rw-r--r--   1 root root   244 2008-03-09 20:58:31.000000000 +0100 anacron
-rw-r--r--   1 root root   699 2009-10-11 15:27:58.000000000 +0200 dphys-config
-rw-r--r--   1 root root   102 2008-03-14 01:27:59.000000000 +0100 .placeholder
-rw-r--r--   1 root root    13 2011-05-25 00:16:08.000000000 +0200 test1
-rw-r--r--   1 root root    51 2011-05-25 00:16:08.000000000 +0200 test2
+ sleep 120
+ echo * * * * * root echo test1-fixed `date` >> /tmp/cron-test
+ sleep 120
+ echo * * * * * root echo test2-changed `date` >> /tmp/cron-test
+ sleep 120
---snap---

Syslog output filtered for cron entries during that time (line feeds
added manually after each one-minute block):

---snip---
May 25 00:17:01 nemo cron.err cron[1474]: Error: bad minute; while reading 
/etc/cron.d/test1
May 25 00:17:01 nemo cron.info /usr/sbin/cron[1474]: (*system*test1) ERROR 
(Syntax error, this crontab file will be ignored)
May 25 00:17:01 nemo authpriv.info CRON[32267]: pam_unix(cron:session): session 
opened for user root by (uid=0)
May 25 00:17:01 nemo authpriv.info CRON[32266]: pam_unix(cron:session): session 
opened for user root by (uid=0)
May 25 00:17:01 nemo authpriv.debug CRON[32267]: pam_limits(cron:session): 
Unknown kernel rlimit 'Max realtime timeout' ignored
May 25 00:17:01 nemo authpriv.debug CRON[32266]: pam_limits(cron:session): 
Unknown kernel rlimit 'Max realtime timeout' ignored
May 25 00:17:01 nemo cron.info /USR/SBIN/CRON[32268]: (root) CMD (echo test2 
`date` >> /tmp/cron-test)
May 25 00:17:01 nemo cron.info /USR/SBIN/CRON[32269]: (root) CMD (   cd / && 
run-parts --report /etc/cron.hourly)
May 25 00:17:01 nemo authpriv.info CRON[32266]: pam_unix(cron:session): session 
closed for user root
May 25 00:17:01 nemo authpriv.info CRON[32267]: pam_unix(cron:session): session 
closed for user root

May 25 00:18:01 nemo authpriv.info CRON[32284]: pam_unix(cron:session): session 
opened for user root by (uid=0)
May 25 00:18:01 nemo authpriv.debug CRON[32284]: pam_limits(cron:session): 
Unknown kernel rlimit 'Max realtime timeout' ignored
May 25 00:18:01 nemo cron.info /USR/SBIN/CRON[32285]: (root) CMD (echo test2 
`date` >> /tmp/cron-test)
May 25 00:18:01 nemo authpriv.info CRON[32284]: pam_unix(cron:session): session 
closed for user root

May 25 00:19:01 nemo authpriv.info CRON[32300]: pam_unix(cron:session): session 
opened for user root by (uid=0)
May 25 00:19:01 nemo authpriv.debug CRON[32300]: pam_limits(cron:session): 
Unknown kernel rlimit 'Max realtime timeout' ignored
May 25 00:19:01 nemo cron.info /USR/SBIN/CRON[32301]: (root) CMD (echo test2 
`date` >> /tmp/cron-test)
May 25 00:19:01 nemo authpriv.info CRON[32300]: pam_unix(cron:session): session 
closed for user root

May 25 00:20:01 nemo authpriv.info CRON[32326]: pam_unix(cron:session): session 
opened for user root by (uid=0)
May 25 00:20:01 nemo authpriv.debug CRON[32326]: pam_limits(cron:session): 
Unknown kernel rlimit 'Max realtime timeout' ignored
May 25 00:20:01 nemo cron.info /USR/SBIN/CRON[32327]: (root) CMD (echo test2 
`date` >> /tmp/cron-test)
May 25 00:20:01 nemo authpriv.info CRON[32326]: pam_unix(cron:session): session 
closed for user root

May 25 00:21:01 nemo cron.info /usr/sbin/cron[1474]: (*system*test2) RELOAD 
(/etc/cron.d/test2)
May 25 00:21:01 nemo authpriv.info CRON[32343]: pam_unix(cron:session): session 
opened for user root by (uid=0)
May 25 00:21:01 nemo authpriv.info CRON[32342]: pam_unix(cron:session): session 
opened for user root by (uid=0)
May 25 00:21:01 nemo authpriv.debug CRON[32343]: pam_limits(cron:session): 
Unknown kernel rlimit 'Max realtime timeout' ignored
May 25 00:21:01 nemo authpriv.debug CRON[32342]: pam_limits(cron:session): 
Unknown kernel rlimit 'Max realtime timeout' ignored
May 25 00:21:01 nemo cron.info /USR/SBIN/CRON[32344]: (root) CMD (echo 
test2-changed `date` >> /tmp/cron-test)
May 25 00:21:01 nemo cron.info /USR/SBIN/CRON[32345]: (root) CMD (echo 
test1-fixed `date` >> /tmp/cron-test)
May 25 00:21:01 nemo authpriv.info CRON[32343]: pam_unix(cron:session): session 
closed for user root
May 25 00:21:01 nemo authpriv.info CRON[32342]: pam_unix(cron:session): session 
closed for user root

May 25 00:22:01 nemo authpriv.info CRON[32361]: pam_unix(cron:session): session 
opened for user root by (uid=0)
May 25 00:22:01 nemo authpriv.debug CRON[32361]: pam_limits(cron:session): 
Unknown kernel rlimit 'Max realtime timeout' ignored
May 25 00:22:01 nemo authpriv.info CRON[32360]: pam_unix(cron:session): session 
opened for user root by (uid=0)
May 25 00:22:01 nemo authpriv.debug CRON[32360]: pam_limits(cron:session): 
Unknown kernel rlimit 'Max realtime timeout' ignored
May 25 00:22:01 nemo cron.info /USR/SBIN/CRON[32362]: (root) CMD (echo 
test2-changed `date` >> /tmp/cron-test)
May 25 00:22:01 nemo cron.info /USR/SBIN/CRON[32363]: (root) CMD (echo 
test1-fixed `date` >> /tmp/cron-test)
May 25 00:22:01 nemo authpriv.info CRON[32361]: pam_unix(cron:session): session 
closed for user root
May 25 00:22:01 nemo authpriv.info CRON[32360]: pam_unix(cron:session): session 
closed for user root
---snap---

Contents of /tmp/cron-test afterwards:

---snip---
test2 Wed May 25 00:17:01 CEST 2011
test2 Wed May 25 00:18:01 CEST 2011
test2 Wed May 25 00:19:01 CEST 2011
test2 Wed May 25 00:20:01 CEST 2011
test2-changed Wed May 25 00:21:01 CEST 2011
test1-fixed Wed May 25 00:21:01 CEST 2011
test2-changed Wed May 25 00:22:01 CEST 2011
test1-fixed Wed May 25 00:22:01 CEST 2011
---snap---

IMHO this shows that http://bugs.debian.org/555954 is definitely not
fully fixed.

-- Package-specific info:
--- EDITOR:

--- usr/bin/editor:
/usr/bin/zile

--- /usr/bin/crontab:
-rwxr-sr-x 1 root crontab 30248 Dec 19 00:46 /usr/bin/crontab

--- /var/spool/cron
drwxr-xr-x 3 root root 4096 May 11  2008 /var/spool/cron

--- /var/spool/cron/crontabs
drwx-wx--T 2 root crontab 4096 Mar 14  2008 /var/spool/cron/crontabs

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (600, 'stable'), (500, 'testing'), (400, 
'oldstable'), (110, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.39-1-686-pae (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages cron depends on:
ii  adduser                      3.112+nmu2  add and remove users and groups
ii  debianutils                  4           Miscellaneous utilities specific t
ii  dpkg                         1.16.0.3    Debian package management system
ii  libc6                        2.13-4      Embedded GNU C Library: Shared lib
ii  libpam-runtime               1.1.2-3     Runtime support for the PAM librar
ii  libpam0g                     1.1.2-3     Pluggable Authentication Modules l
ii  libselinux1                  2.0.98-1+b1 SELinux runtime shared libraries
ii  lsb-base                     3.2-27      Linux Standard Base 3.2 init scrip

Versions of packages cron recommends:
ii  lockfile-progs                0.1.15     Programs for locking and unlocking
ii  postfix [mail-transport-agent 2.8.3-1    High-performance mail transport ag

Versions of packages cron suggests:
ii  anacron                       2.3-14     cron-like program that doesn't go 
pn  checksecurity                 <none>     (no description available)
ii  logrotate                     3.7.8-6    Log rotation utility

Versions of packages cron is related to:
pn  libnss-ldap                   <none>     (no description available)
pn  libnss-ldapd                  <none>     (no description available)
pn  libpam-ldap                   <none>     (no description available)
pn  libpam-mount                  <none>     (no description available)
pn  nis                           <none>     (no description available)
pn  nscd                          <none>     (no description available)

-- no debconf information

--- End Message ---
--- Begin Message ---
Source: cron
Source-Version: 3.0pl1-117

We believe that the bug you reported is fixed in the latest version of
cron, which is due to be installed in the Debian FTP archive:

cron_3.0pl1-117.diff.gz
  to main/c/cron/cron_3.0pl1-117.diff.gz
cron_3.0pl1-117.dsc
  to main/c/cron/cron_3.0pl1-117.dsc
cron_3.0pl1-117_i386.deb
  to main/c/cron/cron_3.0pl1-117_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Christian Kastner <[email protected]> (supplier of updated cron package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Sun, 08 May 2011 01:21:15 +0200
Source: cron
Binary: cron
Architecture: source i386
Version: 3.0pl1-117
Distribution: unstable
Urgency: low
Maintainer: Javier Fernandez-Sanguino Pen~a <[email protected]>
Changed-By: Christian Kastner <[email protected]>
Description: 
 cron       - process scheduling daemon
Closes: 478967 537073 578856 579640 609780 615855 622645 625491 625493 625495 
627859
Changes: 
 cron (3.0pl1-117) unstable; urgency=low
 .
   * Makefile:
     - Fixed integration of cron-internal debug code into the package building
       process. Instead of having to modify debian/rules, this can now driven by
       DEB_BUILD_OPTIONS=debug
     - Removed hard-coded compiler flags, honoring those provided by
       dpkg-buildflags instead
   * do_command.c:
     - When logging the end of cron jobs, log the PID of the actually exec'ed
       user command, not the PID of the parent. Closes: #609780
   * database.c:
     - Split crontab security checks (type, owner, mode, links) into separate
       tests with individual error messages instead of the cryptic message
       "WRONG INODE INFO". Closes: #625493
     - Extended the ability to recover from broken symlinks (added in -110) to
       also recover from failed security checks above. Fixes to these were not
       being detected as cron only looks at mtime. Closes: #625495
     - Also recover from syntax errors. Fixes to these did change mtime, but
       were ignored as cron permanently removes broken crontabs from its
       database of files to check. Closes: #627859
   * cron.8:
     - Documented the fact that /etc/crontab and files in /etc/cron.d must not
       be group- or other-writable. Closes: #625491, LP: #741979
   * crontab.5:
     - Specify parse order of crontabs (thanks, Jonathan Amery). Closes: #622645
   * debian/control:
     - Bumped Standards-Version to 3.9.2 (no changes needed)
     - Added missing Build-Depends on libaudit-dev
     - Removed Conflicts for nonexistent package suidmanager
     - Removed Conflicts for lockfile-progs (which should have been a Breaks
       anyway) as we no longer rely on it, we use flock from util-linux instead
     - Changed architecture-specific Build-Depends on libselinux1-dev to
       linux-any instead of negating all other OSes
   * debian/cron.default:
     - Merged the LSBNAMES option with EXTRA_OPTS. Both where used to pass
       options to the daemon, making one of them redundant
     - Added the ability to disable the daily lost+found check by setting the
       new variable CHECK_LOSTFOUND to "no". Closes: #579640
   * debian/cron.init:
     - Don't call start-stop-daemon directly, use LSB init functions instead.
       Among other things, this works around the cron daemon not deleting its
       pidfile from /var/run/. Closes: #615855
     - Added $network to Should-Start
   * debian/rules:
     - Converted to dh syntax. This included replacing some manually executed
       steps with debhelper file-automated ones (eg: cron.man, cron.examples)
       to lessen clutter
     - Completely rewrote the PAM/SELinux/audit integration parts. PAM support
       was being skipped on kfreebsd and hurd, and audit support was completely
       broken. From now on:
       + PAM is enabled by default on all platforms
       + SELinux is enabled by default on linux-any
       + audit is disabled by default on all platforms
       All of these can be driven by DEB_BUILD_OPTIONS (see debian/rules)
     - Do not compress example perl scripts
   * debian/{prerm,postrm,postinst}:
     - Let dh_installinit manage stopping/(re)starting of jobs instead of
       calling invoke-rc.d ourselves
   * debian/standard.daily:
     - Backup of /etc/{passd,group} is no longer performed by cron; the task
       was handed over to src:shadow (see #554170). In Squeeze, this task will
       be performed redundantly by both packages (as discussed on
       debian-release)
     - Rewrite locking and lost+found-checking code, based on a submission to
       the BTS by Justin B. Rye. Closes: #478967, #537073, LP: #257367
     - Parse /etc/mtab instead of /proc/mounts; the former makes handling bind
       mounts easier. Closes: #578856
     - Pull in /etc/cron/default for CHECK_LOSTFOUND (see above)
   * debian/copyright:
     - Convert to DEP5 format (r173)
   * debian/watch:
     - Added watch file to silence a lintian warning, even though the last
       upstream release was in 2004
   * Packaging (general): removed a lot of cruft which seems to have accumulated
     over time. This included all the cron-se stuff, which appears to have been
     a remnant from the SELinux integration process, and was either not being
     used anymore or completely broken. Also, the patches/ directory was
     removed, as that location has a specific meaning and the patches in there
     were no longer relevant.
Checksums-Sha1: 
 b05295fceecdd9702c66dfb3b561c0f0bb1481f9 1219 cron_3.0pl1-117.dsc
 1d69b6cd9eb94bd0201f70700892028676a7e874 88976 cron_3.0pl1-117.diff.gz
 43c7665efa16c0eb55401cb6145026f56bae31a9 95814 cron_3.0pl1-117_i386.deb
Checksums-Sha256: 
 6719500e6714d797b21bc1dccc44d03332a909f4a76832515e6c0b3856dc4927 1219 
cron_3.0pl1-117.dsc
 1705799cac874cfa171064d8a9764140fcf3618c8f004e01f5eeda5dd47898e7 88976 
cron_3.0pl1-117.diff.gz
 28d7f2917dc40e211b269e41d7f9e0661c9a1167a6297a49db780d21c1e73fbb 95814 
cron_3.0pl1-117_i386.deb
Files: 
 ce23eb8cacdfbeefdd79f77bbb87fbcb 1219 admin important cron_3.0pl1-117.dsc
 757abb9a1f1c65da068d2e1cb945996b 88976 admin important cron_3.0pl1-117.diff.gz
 a4c1e1d0ecfbd1253f4e7cb59bec6a2a 95814 admin important cron_3.0pl1-117_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iD8DBQFN5BSOsandgtyBSwkRAj03AJ4pRKEmbLXXN2LLWI/DxGtDAqdKTwCeM3jL
l8/VkIFBH9WaJWiSZrQDr4k=
=DDkG
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to