Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> Scrip Interpreter Directive Error, interpreter directive causes script fail
jbrook
post Jun 6 2005, 10:08 AM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 3
Joined: 6-June 05
Member No.: 5,091



I have a really strange.
Working on setting up bugzilla on a RH 2.6.11 box and ran into the following:
The script interpreter directive causes a script not to run. After much digging and trying and poking I have found the following (really):
In my (or other) home directories a script of the form
#!/usr/bin/perl
Print 'Hello Perl Worldn'

Works fine as does
#!/bin/bash
Echo 'Hello Bash World'

Put them both in /var and the bash one works, the perl does not. (it returns to the command prompt with no action or message.) Put them both in /var/www and neither work.
Execute either of the ones in the home directory FROM /var/www and they work. Execute either in the /var/www directory FROM the home directory and neither works.

I have been working in *nix for many years and this has me completely mystified. I am sure I am overlooking something simple, but have no idea what.
Thanks for any push.
julian
Go to the top of the page
 
+Quote Post
Corey
post Jun 6 2005, 11:59 AM
Post #2


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 1,254
Joined: 21-September 02
From: St John's, Newfoundland, Canada
Member No.: 3



I really don't know what the problem could be. But, in my experiences, when something really weird is happening, i usually look towards permissions. I don't know if the different directories have different owners and maybe that's cause a problem someway, off the top of my head i don't really know how, but, like i said, permission problems can sometimes be the weirdest to notice.


--------------------
Corey Quilliam
(former) Linuxhelp.ca Administrator
cquilliam-AT-gmail-dot-com

Want to help out Linuxhelp.net? Check out our Linuxhelp Wiki and see if there are some articles you would like to submit!!

--
Ubuntu 8.04 64-bit - Work Laptop (HP-Compaq NC6400 Core2)
Kubuntu 8.04 64-bit - Desktop (HP m8120n QuadCore)
Ubuntu 6.04 - Server (I'm not upgrading this baby until support runs out in 2012) (Some old POS dell)
Go to the top of the page
 
+Quote Post
jbrook
post Jun 6 2005, 02:14 PM
Post #3


Whats this Lie-nix Thing?
*

Group: Members
Posts: 3
Joined: 6-June 05
Member No.: 5,091



I've tried it as root which should answer any permission problems, no luck. I suspect links, perhaps with a relative path, but have not found anything yet. But if it were links I would think that when I try to run the one in /var/www from a home directory it would run like the "local" one does, but it doesn't. First thought was i was running in a restricted shell, but i checked that and that was before i found that it was location sensitive. Really strange. No point in trying to configure bugzilla till i get this resolved since it heavily uses scripts that point to perl.
Go to the top of the page
 
+Quote Post
DS2K3
post Jun 6 2005, 02:38 PM
Post #4


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,284
Joined: 14-November 04
From: Southampton, Hampshire
Member No.: 4,165



Perhaps perl is trying to run as another user (suid gone wrong?) - Try starting an infinite loop, and then using "ps -Al" to see what it's running as. Might be an idea to kill it when you're done...

D


--------------------
Fixed your problem? Let us know!
richard@linuxhelp.net

www.Gathr.co.uk Online Event Management
Go to the top of the page
 
+Quote Post
jbrook
post Jun 6 2005, 03:52 PM
Post #5


Whats this Lie-nix Thing?
*

Group: Members
Posts: 3
Joined: 6-June 05
Member No.: 5,091



Unfortunately it is not interpreter dependent. I have tried it under bash, ksh, bsh. and have had the script directive (#!) specify bash, sh, and perl. all do the same. I also put a ps -f in the test to see what was running, but it doesn't get there, with the interpreter directive it exits immediately. Since i can run the scripts (if they are elsewhere) from in /var/www but cannot run them in /var/www from elsewhere it looks to be location dependent only. Is there any config that I dont know about that restricts what you can execute or what commands are available in specific directories? Who handles the script interpreter directive if it is there, the individual shell or the kernel?

Well I just tried something and it sort of worked. i moved the directory i was really concerned with (/var/www/html/perl.dl to /dddd. the test still did not work. created a /eeee directory. tared the files from /dddd and put them in /eeee. the test works. moved /eeee to /var/www/html/perl.dl and did the test and it worked.
haven't a clue as to why. both directories have the same owners, group and permissions (and size). I hate problems that i get around and never know why. they are just waiting to bite me again. ???
julian
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 21st October 2017 - 08:10 PM