Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

bad interpretor error when running scripts off an NFS share

by GaijinPunch (Pilgrim)
on Oct 17, 2009 at 02:24 UTC ( #801698=perlquestion: print w/ replies, xml ) Need Help??
GaijinPunch has asked for the wisdom of the Perl Monks concerning the following question:

Howdy
I rebuilt my main machine recently, leaving my file server in tact. Now, when I run scripts stored on the file server (accessed through NFS) I get the dreaded "bad inerpreter: Permission Denied" error from bash. The shebang line is fine, and they run fine when copied over locally. As such, Perl is installed just fine on the non-file server machine (and the file server for that matter). What blatant error am I missing?

Comment on bad interpretor error when running scripts off an NFS share
Re: bad interpretor error when running scripts off an NFS share
by GrandFather (Cardinal) on Oct 17, 2009 at 07:55 UTC

    Check for bad line end characters on the shebang line. A new line character (lf) is expected - a carriage return (cr) or cr/lf pair will cause grief of the nature you describe.


    True laziness is hard work
      Yeah, checked that first. I think copying the file to the machine locally and running it without a hitch is also confirmation that that is not the problem.

        Some ideas to try

        • compare the hex dumps (od -x, hd, xxd, ...) of the first few lines. On the file server locally, "copied" version (how did you copy it?) and accessed-via-nfs.
        • implicit conversion might also be part of the mount options. What OS is the server, what is the client?
        • strace -o log -e file SCRIPTNAME # what files are accessed?
        • strace -o log -e file perl ./SCRIPTNAME # (use cat -vet when viewing the log)

        cu
        Peter

        Maybe the NFS share is mounted as "noexec"? (I think that would produce the exact error you're getting, whereas some trailing junk char(s) in the shebang line would rather produce "... No such file or directory").

        What does mount show for the share in question?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://801698]
Approved by planetscape
Front-paged by planetscape
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2014-07-12 06:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (238 votes), past polls