Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/bin/bash: bad interpreter: Permission denied [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
flickerfly
l33t
l33t


Joined: 08 Nov 2002
Posts: 677
Location: Lanham, MD

PostPosted: Thu Feb 12, 2004 3:06 pm    Post subject: /bin/bash: bad interpreter: Permission denied [solved] Reply with quote

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
View user's profile Send private message
beefcommando
n00b
n00b


Joined: 29 Apr 2003
Posts: 2
Location: WA

PostPosted: Mon Feb 16, 2004 9:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
flickerfly
l33t
l33t


Joined: 08 Nov 2002
Posts: 677
Location: Lanham, MD

PostPosted: Mon Feb 16, 2004 9:39 pm    Post subject: Reply with quote

I'm finding it also affects perl scripts with #!/bin/perl as the first line.

I did try to remerge bash and that didn't make a difference.
_________________
An Evil Genious' Guide to Sheeple and How To Avoid Becoming One | 0x4C9EF4A
Back to top
View user's profile Send private message
cram
Guru
Guru


Joined: 17 Nov 2002
Posts: 312
Location: Saskatoon, Canada

PostPosted: Mon Feb 16, 2004 10:18 pm    Post subject: Reply with quote

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
View user's profile Send private message
mikeraach
Apprentice
Apprentice


Joined: 20 Jan 2003
Posts: 168

PostPosted: Tue Feb 17, 2004 3:30 am    Post subject: Reply with quote

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
View user's profile Send private message
RJG
Tux's lil' helper
Tux's lil' helper


Joined: 07 Feb 2003
Posts: 109
Location: Toronto, ON, Canada

PostPosted: Tue Feb 17, 2004 3:53 am    Post subject: Reply with quote

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:
Code:

man mount


I'm not sure if this is optimal, but it does fix the 'bad interpreter' errors.
Back to top
View user's profile Send private message
flickerfly
l33t
l33t


Joined: 08 Nov 2002
Posts: 677
Location: Lanham, MD

PostPosted: Tue Feb 17, 2004 1:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
beefcommando
n00b
n00b


Joined: 29 Apr 2003
Posts: 2
Location: WA

PostPosted: Wed Feb 18, 2004 1:01 am    Post subject: Reply with quote

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
View user's profile Send private message
timfreeman
Tux's lil' helper
Tux's lil' helper


Joined: 19 May 2003
Posts: 142
Location: Chicago

PostPosted: Wed Mar 24, 2004 6:29 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum