Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perl 5.004_05 permission denied in shellscript error #380

Closed
p5pRT opened this issue Aug 13, 1999 · 3 comments
Closed

Perl 5.004_05 permission denied in shellscript error #380

p5pRT opened this issue Aug 13, 1999 · 3 comments

Comments

@p5pRT
Copy link

p5pRT commented Aug 13, 1999

Migrated from rt.perl.org#1215 (status was 'resolved')

Searchable as RT1215$

@p5pRT
Copy link
Author

p5pRT commented Aug 13, 1999

From david.meleedy@analog.com

====
akbar-345​: myconfig

Summary of my perl5 (5.0 patchlevel 4 subversion 5) configuration​:
  Platform​:
  osname=sunos, osvers=4.1.4, archname=sun4-sunos
  uname='sunos akbar 4.1.4 2 sun4m '
  hint=recommended, useposix=true, d_sigaction=define
  bincompat3=y useperlio=undef d_sfio=undef
  Compiler​:
  cc='gcc', optimize='-O3', gccversion=2.95 19990728 (release)
  cppflags='-I/cpd/gnu/include -I/cpd/misc/include -I/usr/local/include'
  ccflags ='-I/cpd/gnu/include -I/cpd/misc/include -I/usr/local/include'
  stdchar='unsigned char', d_stdstdio=define, usevfork=false
  intsize=4, longsize=4, ptrsize=, doublesize=
  alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries​:
  ld='ld', ldflags ='-L/cpd/gnu/lib -L/cpd/misc/lib -L/usr/local/lib'
  libpth=/cpd/gnu/lib /cpd/misc/lib /usr/local/lib /lib /usr/lib /usr/ucblib
  libs=-lnsl -lgdbm -ldbm -ldl -lm -lc -lposix
  libc=/lib/libc.so.1.9, so=so
  useshrplib=false, libperl=libperl.a
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
  cccdlflags='-fpic', lddlflags='-assert nodefinitions -L/cpd/gnu/lib -L/cpd/misc/lib -L/usr/local/lib'

I just compiled 5.004_05, and the problem is that whenever
I have a perlscript referring to the location of perl in
the wrapper, e.g. #!/cpd/gnu/modules/perl5.004_05/bin/perl ,
I get a permission denied error. I am using tcsh 6.07.02.

i.e.

====
akbar-55​: ls -l foo1.perl
-rwxrwxr-x 1 dmeleedy 62 Aug 13 19​:55 foo1.perl*
akbar-56​: cat foo1.perl
#!/cpd/gnu/modules/perl5.004_05/bin/perl

print "hi there\n";

akbar-57​: ./foo1.perl
./foo1.perl​: Permission denied.

akbar-58​: ls -l /cpd/gnu/modules/perl5.004_05/bin/perl
-rwxr-xr-x 2 dmeleedy 712704 Aug 13 00​:29 /cpd/gnu/modules/perl5.004_05/bin/perl*

====

====
I found a really kludgy workaround​:

akbar-59​: cat foo.perl
#!/bin/sh
exec perl "$0".real ${1+"$@​"}

akbar-60​: cat foo.perl.real
print "hi there\n";

akbar-61​: ./foo.perl
hi there

====

But I have had to use this wrapper on everything! like h2ph
I copy h2ph to h2ph.real, and then use the above bourne shell wrapper
to get it to work.

Any ideas to get this fixed would be greatly appreciated.

-Dave

========================================================================
David Meleedy Analog Devices, Inc.
David.Meleedy@​analog.com Three Technology Way
Phone​: 781 461 3494 Norwood, MA 02062-9106 USA

@p5pRT
Copy link
Author

p5pRT commented Aug 14, 1999

From [Unknown Contact. See original ticket]

David Meleedy <david.meleedy@​analog.com> wrote

I just compiled 5.004_05, and the problem is that whenever
I have a perlscript referring to the location of perl in
the wrapper, e.g. #!/cpd/gnu/modules/perl5.004_05/bin/perl ,
I get a permission denied error. I am using tcsh 6.07.02.

You have a pathname which is too long. Many platforms restrict
the length of the #! line to 32 characters.

When you ran Configure and replied to the question

  I can use the #! construct to start perl on your system. This will
  make startup of perl scripts faster, but may cause problems if you
  want to share those scripts and perl is not in a standard place
  ($binexp/perl) on all your platforms. The alternative is to force
  a shell by starting the script with a single '​:' character.

  What shall I put after the #! to start up perl ("none" to not use #!)?

you should have received a warning

  WARNING​: Some systems limit the #! command to 32 characters.
  If you experience difficulty running Perl scripts with #!, try
  installing Perl in a directory with a shorter pathname.

There are several ways round the problem​:

a) Rebuild Perl using a shorter pathname.

b) Rebuild Perl, replying 'none' to the above question.

c) Create a symlink to your Perl with a shorter pathname (e.g. from
  /usr/bin/perl. You'll also need to update all the scripts which
  are installed with Perl (such as perldoc) to use this name on the
  #! line.

Mike Guy

@p5pRT
Copy link
Author

p5pRT commented Aug 18, 1999

From [Unknown Contact. See original ticket]

On Fri, 13 Aug 1999 at 20​:07​:52 -0400, David Meleedy wrote​:

Here is the output of myconfig​:

#!/cpd/gnu/modules/perl5.004_05/bin/perl
  <------------ too long -------------->

Many systems can't hack #! names of more than a certain length; 32 chars
is common. It looks as if you're running into that.

Try getting your sysadmins to put perl into a sensible place;
/usr/local/bin/perl is semi-standard. It may already be in
/usr/bin/perl without them knowing :-) And you could get them to upgrade
to 5.00503 or so while they're at it.

I'd be very reluctant to put names like the above into #!, since it will
change with every upgrade. Stick with your workround if you can't get
/usr/bin/perl or /usr/local/bin/perl or whatever.

Try a symbolic link from
$HOME/bin/perl -> /cpd/gnu/modules/perl5.004_05/bin/perl
That might do the trick.

Ian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant