The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

problem with cron

Discussion in 'General Discussion' started by mickalo, Mar 19, 2006.

  1. mickalo

    mickalo Well-Known Member

    Joined:
    Apr 16, 2002
    Messages:
    765
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    N.W. Iowa
    Hello,

    there appears to be a problem with the files in the /etc/cron.d folder, all of sudden they seem to stop working. verified that crond is running and have restarted, but it doesn't seem to execute any of the files in the /etc/cron.d folder

    is there something else that may be stopping them from being executed? Nothing has changed in this folder, all files where working fine then all of sudden seem to stop. the other cron folders(daily,weekly..etc) seem to be working tho.

    any help would be appreciated.

    Mickalo
     
  2. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    I've noticed this in my Logwatch for the last few days and have been trying to find out anything about it. It may be related...

    --------------------- Cron Begin ------------------------
    Files with bad mode:
    /etc/cron.d/bfd
    ---------------------- Cron End -------------------------


    WHM 10.8.0 cPanel 10.8.1-R113
    CentOS 3.6 i686 - WHM X v3.1.0

    BTW... the file /etc/cron.d/bfd was 755. While doing some reading at rfx networks, I noticed that that file is now set to 644 when installing bfd. I tried changing the mode to that yesterday, but still had the entry in this morning's logwatch.
     
  3. jupiter

    jupiter Member

    Joined:
    Oct 1, 2004
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    Has anyone found an answer to this problem? I've tried just about everything I could thinkof including reinstalling BFD, fiddling with permissions and more..
    my bfd cron line is
    */10 * * * * root /usr/local/sbin/bfd -q
    and even when I manually try and run the cron file vial command line
    ./bfd I get this
    ./bfd: line 3: */10: No such file or directory
    I also get that result in my log files including this one
    crond[5410]: (*system*) BAD FILE MODE (/etc/cron.d/bfd)

    I even tried removing it from my /etc/cron.d location and added it to
    the master root crontab file adding it via crontab -e and I still get
    the error.
    I also checked the permissions on the /usr/local/bfd/bfd and all is
    what everyone sais it should be and the symlink is ok and working
    from the /usr/local/sbin/ area

    I'm stumped..

    If anyone has the fix tothis I would appreciate it being posted to this thread.
    Search is my friend, yes and I'm all about searched out! lol

    Jupiter,
     
    #3 jupiter, Oct 26, 2006
    Last edited: Oct 26, 2006
  4. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Means the file permissions are getting screwed up by something:

    chmod 644 /etc/cron.d/*
     
  5. jupiter

    jupiter Member

    Joined:
    Oct 1, 2004
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for the response Stumpty, I Even tried that with the same/similar results...
    When I did do the 644 I get permission denied

    root@jupiter [/etc/cron.d]# ls -alS
    total 16
    drwx--x--x 71 root root 8192 Oct 26 12:48 ../
    drwxr-xr-- 2 root root 4096 Oct 26 12:48 ./
    -rw-r--r-- 1 root root 76 Oct 26 12:48 bfd
    root@jupiter [/etc/cron.d]# ./bfd
    -bash: ./bfd: Permission denied
    root@jupiter [/etc/cron.d]#

    I even accessed as su root so executing a file should be no problem.

    and as soon as I 754 it as suggested in one google search or even 755
    I get this
    root@jupiter [/etc/cron.d]# chmod 754 bfd
    root@jupiter [/etc/cron.d]# ./bfd
    ./bfd: line 3: */10: No such file or directory
    root@jupiter [/etc/cron.d]#


    The files and directory exists that it's suppose to access.
    Whats really weird is that provides a nice error in my
    /var/log/cron
    BUT as soon as I remove the /etc/cron.d/bfd all together and add a line to
    my /var/spool/cron/root

    this is the line
    */10 * * * * /usr/local/bfd/bfd -q > /dev/null 2>&1

    I dont get the error any more and it seems to run fine although I dont have any proof of it yet other than getting no more errors in my /var/log/cron regarding the new addition.

    It is suppose to be able to run via /etc/cron.d/bfd but why on earth would it deliver such an error from there... The permissions seem to be fine on the /etc/cron.d folder and cron jobs are indeed working on the box itself...


    Jupiter
     
  6. jupiter

    jupiter Member

    Joined:
    Oct 1, 2004
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    Yep it works great as long as there is no /etc/cron.d/bfd and I simply add a line to the crontab file in /var/spool/cron/root
    with a direct path to the program instead of the symlink one that was in the /etc/cron.d/bfd file (which incidentallky I tried changing to a direct path as well with same error result)
    Simply add this line to my main root crontab and it worked like a charm.
    */10 * * * * /usr/local/bfd/bfd -q > /dev/null 2>&1

    I just had a block report that came in via email as I posted my previous post...

    I still am scratching my head as to why the /etc/cron.d seems to be a dud location for
    the bfd cron directive. mmmmmm

    Time for a coffee before I need a therapist as a result of this perplexing glitch..

    Jupiter
     
  7. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    You cannot run the files in /etc/cron.d/ they're in crontab format, not shell scripts.
     
  8. pavemen

    pavemen Active Member

    Joined:
    Oct 8, 2003
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    644 and 755 do not work as logwatch keeps complaining about bad file mode. any other ideas?
     
  9. pavemen

    pavemen Active Member

    Joined:
    Oct 8, 2003
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    any more info?
     
  10. pavemen

    pavemen Active Member

    Joined:
    Oct 8, 2003
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    i keep getting noticed from logwatch about this. it will be fixed one day all by itself, then it will be listed in logwatch again

    how can i tell if these scripts are running, even with the bad file mode notice?
     
Loading...

Share This Page