Bug 653132

Summary: run-parts update broke existing crontab files
Product: [Fedora] Fedora Reporter: Tom Horsley <horsley1953>
Component: crontabsAssignee: Marcela Mašláňová <mmaslano>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: high    
Version: 14CC: bojan, goodyca48, mmaslano, redhat, tmraz
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-11-15 06:35:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tom Horsley 2010-11-14 16:01:23 UTC
Description of problem:

Since ancient days, the run-parts script has been invoked thusly in
many crontabs:

run-parts /etc/cron.daily

But the latest version of run-parts contains this line:

for i in $(LC_ALL=C; echo $1*[^~,]) ; do

and when you echo /etc/cron.daily* you get back just /etc/cron.daily*

This results in no scripts in cron.daily being run, same for all the
other things run-parts is invoked by.


Version-Release number of selected component (if applicable):
crontabs-1.11-1.20101109git.fc14.noarch


How reproducible:
100%

Steps to Reproduce:
1.use existing old crontab
2.update the crontabs rpm
3.
  
Actual results:
no scripts from any of the directories passed to run-parts are run

Expected results:
run the individual scripts

Additional info:

OK, I can fix it by passing the directory name with a trailing slash, but
I never had to do that before. How hard would it be for run-parts to do
something like:

case d in $1
do
*/) dir=$1
*) dir="$1/"
esac

(Or whatever the syntax should be for a case - I can never quite remember :-).

Comment 1 Деян 2010-11-14 16:13:34 UTC
I can reproduce the issue on a recent Fedora 14 installation.

Comment 2 Tom Horsley 2010-11-14 16:52:53 UTC
There is also more breakage in the run-parts script. If I run it on
a sample directory with a couple of scripts in it, I get this:

zooty> run-parts /home/tom/tab 
zooty> run-parts /home/tom/tab/
/usr/bin/run-parts: line 69: [: ==: unary operator expected
/home/tom/tab/1one:

run-parts 
/usr/bin/run-parts: line 69: [: ==: unary operator expected
/home/tom/tab/2two:

works!

The $list and $test references in the script need to be
written "$list" and "$test" or list and test need to be
initialized to 0 up front so the symbols will be defined.

Comment 3 Bojan Smojver 2010-11-14 22:32:34 UTC
Bumping up priority/severity. Really annoying - cron.daily not running any more. Please fix ASAP.

Comment 4 Marcela Mašláňová 2010-11-15 06:35:35 UTC

*** This bug has been marked as a duplicate of bug 652268 ***