Bug 609200

Summary: run-parts needs man page, does not like files with underscore?
Product: Red Hat Enterprise Linux 5 Reporter: Scott Dowdle <dowdle>
Component: crontabsAssignee: Marcela Mašláňová <mmaslano>
Status: CLOSED NOTABUG QA Contact: qe-baseos-daemons
Severity: high Docs Contact:
Priority: low    
Version: 5.5   
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-07-26 13:49:16 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 Scott Dowdle 2010-06-29 16:08:57 UTC
Description of problem:

run-parts does not seem to like files with underscore in the name... at least I was having a problem with cron.daily saying it executing but getting no report from logwatch.  Somewhere (I can't find it now) I found a webpage that claimed that run-parts was very picky about the filenames used and that it did not like underscores.  Turns out I had a number of scripts with underscores in them (provided by a third-party application named MailScanner).  Simply renaming those scripts and changing the _'s to -'s fixed the problem.

It is fine if that is a case but run-parts really needs a man page that describes this issue.

Having some files with _'s in the name really seems to cause unpredictable behavior from run-parts as I would get logwatch reports usually once a week or less frequently even though it was in the cron.daily folder.


Version-Release number of selected component (if applicable):
crontabs-1.10-8

How reproducible:
Put file with underscores (I'm sure there are additional illegal characters that people would use) in any of the directories processed by run-parts.  At some point the scripts will fail to execute and not provide the output expected of them.  There doesn't seem to be any errors in any of the logs.

Additional info:

Either fix run-parts where it can handle a more diverse range of filenames or document the problems it has in a man page.  In either event, a man page isn't a bad idea.

Comment 1 Marcela Mašláňová 2010-07-26 13:49:16 UTC
I can't reproduce this behaviour.

You can check RHEL's run-parts script doesn't filter _. This issue shouldn't be related to crontabs. It could be permission of your script, setting of your shell, whatever else.

<snip>
# Ignore *~ and *, scripts
for i in $1/*[^~,] ; do
    [ -d $i ] && continue
    # Don't run *.{rpmsave,rpmorig,rpmnew,swp} scripts
    [ "${i%.rpmsave}" != "${i}" ] && continue
        [ "${i%.rpmorig}" != "${i}" ] && continue
        [ "${i%.rpmnew}" != "${i}" ] && continue
        [ "${i%.swp}" != "${i}" ] && continue
    [ "${i%,v}" != "${i}" ] && continue
</snip>

If you can give me really good reproducer, then please feel free to reopen.

Comment 2 Scott Dowdle 2010-07-26 14:51:21 UTC
Simply renaming the scripts made the problem go away.

I didn't say it was filtering on _ but from what I understand there are a number of filename characters that run-parts does not like.

When it acts up the behavior is really unpredictable.  Sometimes your scripts will execute and other times they won't.  It is truly bizarre and very hard to troubleshoot unless you know to get rid of _ in the filename.

Comment 3 Marcela Mašláňová 2010-07-27 06:40:16 UTC
(In reply to comment #2)
> Simply renaming the scripts made the problem go away.
> 
> I didn't say it was filtering on _ but from what I understand there are a
> number of filename characters that run-parts does not like.
> 
I say run-parts doesn't like files which ends with: rpmsave, rpmorig, swp, ~ and contains ^ or ~.

> When it acts up the behavior is really unpredictable.  Sometimes your scripts
> will execute and other times they won't.  It is truly bizarre and very hard to
> troubleshoot unless you know to get rid of _ in the filename.    
I've created job with underscore in cron.daily and I'll see whether it's reproducible.

Job:
-rw-r--r--. /etc/cron.daily/test_file