Decoding another bash error

samtregar on 2006-12-08T18:52:36

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


Same thing here

Mr. Muskrat on 2006-12-08T19:34:26

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.

Re:Same thing here

samtregar on 2006-12-08T19:50:32

/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

Re:Same thing here

Mr. Muskrat on 2006-12-08T20:12:45

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.