Help - Search - Members - Calendar
Full Version: Scrip Interpreter Directive Error
Linuxhelp > Support > Technical Support
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
Print 'Hello Perl Worldn'

Works fine as does
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.
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.
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.
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...

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. ???
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2018 Invision Power Services, Inc.