#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2004
    Posts
    4
    Rep Power
    0

    starting script (chmod 777) but still permission denied


    Hi,

    I want to start a script when i receive an email.
    So i made the following line in /etc/aliases

    start: "|/path/to/script/script"

    now when i mail to start@domain.com it tries to start the script ( is see in the mail log). But it returns this error:


    Dec 17 13:57:07 web01 local[22508]: fatal: execvp /path/to/script/script: Permission denied
    Dec 17 13:57:08 web01 postfix/local[22495]: 173C7B0005: to=<start@domain.com>, relay=local, delay=1, status=bounced (Command died with status 1: "/path/to/script/script")

    so it tries to start it but it has no permission

    When i run it from the commanline it works like a charm

    i have chmod 777 the file and chown root:root

    What can be wrong?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    121
    Rep Power
    14
    I would look at /path/to/script/. Can the mailer read those directories? And don't chmod your script to 777. Use 755. A world writable script is a security problem.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jul 2004
    Location
    Middle Europa
    Posts
    1,198
    Rep Power
    17
    when a progr runs on cmd-line and has troubles
    running by a deamon is mostly an ENVIRONMENT issue.

    there are situations error messages are incomplete, confusing
    wrong.
    may be is not a permission problem, sure NOT of your script,
    but if in it you start an other program AND the deamon
    is not allowed to do that .....
    example:
    put in a file (say: runme) the string: #!/bin/qqq
    give permisions: chmod 755 runme
    then start it: ./runme
    the error will be: ./runme: Command not found

    ??? the A: not ./runme but /bin/qqq does not exists.

    as perderarbo wrote: 777 is for dos-experts.
    Last edited by guggach; December 18th, 2004 at 04:17 AM. Reason: typo
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2004
    Posts
    4
    Rep Power
    0
    thanks for the replies,

    i know i have to chmod 755 it, but hey when that didn't work with an permission denied error i tried 777

    I think i found the problem, perderabo came with the answer.
    The mailer couldn't read the dir, so it said permission denied.

    Thanks for the solution guys!

IMN logo majestic logo threadwatch logo seochat tools logo