Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 609200 - run-parts needs man page, does not like files with underscore?
run-parts needs man page, does not like files with underscore?
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: crontabs (Show other bugs)
5.5
All Linux
low Severity high
: rc
: ---
Assigned To: Marcela Mašláňová
qe-baseos-daemons
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-29 12:08 EDT by Scott Dowdle
Modified: 2010-07-27 02:40 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-07-26 09:49:16 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Scott Dowdle 2010-06-29 12:08:57 EDT
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 09:49:16 EDT
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 10:51:21 EDT
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 02:40:16 EDT
(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

Note You need to log in before you can comment on or make changes to this bug.