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.

Questions about the exim_chmod.pl script

Discussion in 'General Discussion' started by PWSowner, May 30, 2004.

  1. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    On my server I have a script called exim_chmod.pl at /var/log/exim_chmod.pl. All the script does is check the permissions of the /var/log/exim_mainlog file and if they are not 644, it gets changed to 644. The exim_chmod.pl script is set as a root cron job to run every 7 minutes.

    Sounds simple enough, but here's the problem.

    Any time I run the "fix mail perms" from WHM, the exim_chmod.pl script has it's permissions changed to 640 making it non executeable. Every 7 minutes I get an email from root saying:

    /bin/sh: /var/log/exim_chmod.pl: /usr/bin/perl: bad interpreter: Permission denied

    I have to go in and change the script permissions back to executeable.


    My questions:

    - Does everyone have this script on their server?
    - Does everyone have the following entry in their /var/spool/cron/root file?
    */7 * * * * /var/log/exim_chmod.pl > /dev/null
    - If the first 2 are yes, do you have to rest the permissions when you fix mail permissions from WHM?

    I'm trying to figure out if this is normal. Thanks for any input you may have.
     
  2. Faldran

    Faldran Well-Known Member

    Joined:
    May 28, 2002
    Messages:
    136
    Likes Received:
    0
    Trophy Points:
    16
    Try moving the script to the root dir. When I used it there, never had a problem.. ( you use it for Mail-Watch, right )

     
  3. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    Re: Re: Questions about the exim_chmod.pl script

    Thanks. I forgot all about Mail-Watch. I installed it last summer and quit using it last fall. That explains my problem. Since I'm not using Mail-Watch now, I'll just remove the script and cron job.

    Thanks again. I've been trying to figure this out for months. :eek:
     
  4. perlchild

    perlchild Well-Known Member

    Joined:
    Sep 1, 2002
    Messages:
    279
    Likes Received:
    0
    Trophy Points:
    16
    Re: Re: Re: Questions about the exim_chmod.pl script

    Just as a suggestion, if you find something executable in a log directory, always move it elsewhere(or suspect it's a hack) executables don't belong with data, and they belong even less in the same place as logs...
    It's just messy.

    /root/bin and /usr/local/bin are better place for your scripts.
     
Loading...

Share This Page