Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

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:

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

Replies are listed 'Best First'.
Re: bad interpretor error when running scripts off an NFS share
by GrandFather (Sage) 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.

        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?

        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)


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://801698]
Approved by planetscape
Front-paged by planetscape
and a soft breeze sighs...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2018-04-19 17:44 GMT
Find Nodes?
    Voting Booth?