UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Closed Thread
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old December 17th, 2004, 08:38 AM
RikPeters RikPeters is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 4 RikPeters User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 7 sec
Reputation 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?

Reply With Quote
  #2  
Old December 17th, 2004, 11:42 PM
Perderabo Perderabo is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 121 Perderabo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 54 sec
Reputation Power: 5
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.

Reply With Quote
  #3  
Old December 18th, 2004, 03:15 AM
guggach guggach is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2004
Location: Middle Europa
Posts: 1,083 guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 19 h 47 m 32 sec
Reputation Power: 9
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 03:17 AM. Reason: typo

Reply With Quote
  #4  
Old December 18th, 2004, 05:58 AM
RikPeters RikPeters is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 4 RikPeters User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 7 sec
Reputation 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!

Reply With Quote
Closed Thread

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > starting script (chmod 777) but still permission denied


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway