View previous topic :: View next topic |
Author |
Message |
flickerfly l33t
Joined: 08 Nov 2002 Posts: 677 Location: Lanham, MD
|
Posted: Thu Feb 12, 2004 3:06 pm Post subject: /bin/bash: bad interpreter: Permission denied [solved] |
|
|
When I try to run a script I just wrote (or a cron job last night that used to run fine)...
Code: | -bash: ./conv.sh: /bin/bash: bad interpreter: Permission denied |
If I su in and run the same commands as root I get the same error so I'm thinking it isn't really a permissions issue. I also tried to run a script with /bin/ksh and received the same error. I can simply run bash from the command line as # /bin/bash and it starts up just fine.
I'm guessing my latest gcc update caused some issues between programs and I need to recompile something. Anyone know what? Or am I off on that conclusion? I'm guessing not bash cause ksh also has issues (and sh, but that's just a bash link). _________________ An Evil Genious' Guide to Sheeple and How To Avoid Becoming One | 0x4C9EF4A
Last edited by flickerfly on Wed Mar 24, 2004 1:26 pm; edited 1 time in total |
|
Back to top |
|
|
beefcommando n00b
Joined: 29 Apr 2003 Posts: 2 Location: WA
|
Posted: Mon Feb 16, 2004 9:26 pm Post subject: |
|
|
I have this same problem! It happens when i'm trying to run a script for VNC, and I cant start the ut2004 demo because of it. Probably other times too.
Anyone figure out how to fix it? |
|
Back to top |
|
|
flickerfly l33t
Joined: 08 Nov 2002 Posts: 677 Location: Lanham, MD
|
|
Back to top |
|
|
cram Guru
Joined: 17 Nov 2002 Posts: 312 Location: Saskatoon, Canada
|
Posted: Mon Feb 16, 2004 10:18 pm Post subject: |
|
|
Quote: | I'm finding it also affects perl scripts with #!/bin/perl as the first line. |
perl usually lives at /usr/bin/perl, not /bin/perl; and although bash is usually at /bin/bash, if for some reaon it is elsewhere, that could be the source of your problem What do you see when you do a 'which bash'? _________________ aaarggghhhh.
Good point Chewie. |
|
Back to top |
|
|
mikeraach Apprentice
Joined: 20 Jan 2003 Posts: 168
|
Posted: Tue Feb 17, 2004 3:30 am Post subject: |
|
|
I had this exact same problem ( /bin/bash: bad interpreter: Permission denied) when I had a seperate /home partition and I was trying to compile something from source.
I have no idea why, but it seems like something doesn't like being on seperate partitions. To fix this I just made /dev/hda7 (my home dir) to mount /mnt/home, then I did a mount /mnt/home /home --bind and my problems were fix. |
|
Back to top |
|
|
RJG Tux's lil' helper
Joined: 07 Feb 2003 Posts: 109 Location: Toronto, ON, Canada
|
Posted: Tue Feb 17, 2004 3:53 am Post subject: |
|
|
The problem is that other partitions that are mounted don't get mounted with the 'exec' flag.
I had to put the following in /etc/fstab to get my other partitions to be able to run anything set to +x:
Code: |
/dev/hda6 /home reiserfs defaults 0 0
|
I have no idea why 'defaults' isn't actually set by default....
To see what options you can put in /etc/fstab check out:
I'm not sure if this is optimal, but it does fix the 'bad interpreter' errors. |
|
Back to top |
|
|
flickerfly l33t
Joined: 08 Nov 2002 Posts: 677 Location: Lanham, MD
|
Posted: Tue Feb 17, 2004 1:15 pm Post subject: |
|
|
cram, chock that up to memory error. I just typed it wrong here, I have it right there. In fact it used to run, but no longer.
RJG, I added the exec option in /etc/fstab. I'll try to remember to come back and mark this resolved if it works next reboot. I've got too much running at the moment.
It seems funny that it would have used to work without that. My home directory is on NFS so maybe that has something to do with it. :shrug: _________________ An Evil Genious' Guide to Sheeple and How To Avoid Becoming One | 0x4C9EF4A |
|
Back to top |
|
|
beefcommando n00b
Joined: 29 Apr 2003 Posts: 2 Location: WA
|
Posted: Wed Feb 18, 2004 1:01 am Post subject: |
|
|
Wow, the fstab was the last place I would think to fix a problem that only seems to appear with bash... but it fixed it for me.
Thanks for the help! |
|
Back to top |
|
|
timfreeman Tux's lil' helper
Joined: 19 May 2003 Posts: 142 Location: Chicago
|
Posted: Wed Mar 24, 2004 6:29 am Post subject: |
|
|
Thanks for the fix. I want to mention in case it helps someone else that you need to put the exec or suid flags after user or users in /etc/fstab.
After catting /etc/mtab the first 10 times in disbelief I decided to investigate why the hell the flags weren't taking effect, and it's because of the order. The user/s flag resets back to noexec, nodev, nosuid. _________________ ||| |
|
Back to top |
|
|
|