Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

samtregar (2699)

samtregar
  (email not shown publicly)
http://sam.tregar.com/

Journal of samtregar (2699)

Friday December 08, 2006
01:52 PM

Decoding another bash error

[ #31856 ]

Again I've been confused by a bash error message. And again, Google was little help, so I figured I'd post it here so perhaps others won't search in vain.

Here's the error, encountered trying to run a Perl script on a USB drive from my Fedora Core 5 machine:

$ bin/krang_ctl restart
-bash: bin/krang_ctl: /usr/bin/perl: bad interpreter: Permission denied

The "bad interpreter" part led me on a mission to make sure Perl was installed ok. It was, and scripts in other locations ran fine. Then I spent some time investigating the "Permission defined" angle, but I couldn't find a permissions problem anywhere.

Finally I looked at how the USB disk was mounted and there it was:

# grep Cube /etc/mtab
/dev/sda1 /media/Cube ext3 rw,nosuid,noexec,nodev 0 0

Note the "noexec" there! Fedora auto-mounted this disk with "noexec" turned on. I still don't know how to tell Fedora not to do that, but I do know how to fix it after the fact:

# mount /media/Cube/ -o remount,exec

After that the problem went away. How the heck having "noexec" on a mounted filesystem triggers a "bad interpreter" error in bash, I have no idea...

Hope that helps someone!

-sam

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • We ran into this when we tried to run our installer from DVD. We had to edit /etc/fstab to set exec instead of noexec. I believe that there is yet another step you have to take to keep this from resetting every time you boot. I'll post an update once I figure out what it is.
    • /etc/fstab sounds right for a DVD mount. Fedora uses something else to mount USB devices on-demand. Some dude in #fedora said it was HAL, but if so I can't find any way to tell it what mount options to use...

      -sam

      • It does in fact use HAL to mount DVDs; thanks for the reminder. If I remember correctly we had to edit the options in /usr/share/hal/fdi/90defaultpolicy/storage-policy.fdi.