View previous topic :: View next topic |
Author |
Message |
commander-keen n00b
Joined: 09 Oct 2013 Posts: 47 Location: Europe
|
Posted: Wed Oct 30, 2013 6:52 am Post subject: [SOLVED] shell-scripts not executable though x bit set |
|
|
Hello,
I recently installed Gentoo. My problem is: I can't launch scripts but i do not understand why.
I have my personal scripts in ~/bin/, which is part of the PATH variable:
maex@celadon:~ $ echo $PATH
/usr/share/tomcat7/bin/:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i486-pc-linux-gnu/gcc-bin/4.6.3:/home/maex/bin:/opt/android/tools:/opt/android/platform-tools
so randomly picking one script the permissions look good (x bit is set):
-rwx------ 1 maex users 229 Oct 18 09:50 publish
But when I try to launch the script, I get this:
maex@celadon:~ $ publish
bash: /home/maex/bin/publish: Permission denied
Same when I try to launch them directly from ~/bin
maex@celadon:bin $ ./publish
bash: ./publish: Permission denied
But: I can do this (without knowing the difference):
maex@celadon:bin $ . publish
(note the blank between dot and publish)
Someone told me this may be linked to fstab settings, since I can launch the scripts when they lie e.g. in /tmp
fstab for my home partition looks like this:
/dev/sda3 /home ext3 user 0 1
Thanks in advance,
Max
Last edited by commander-keen on Wed Oct 30, 2013 8:36 am; edited 1 time in total |
|
Back to top |
|
|
snkmoorthy Guru
Joined: 19 Nov 2002 Posts: 376
|
Posted: Wed Oct 30, 2013 7:18 am Post subject: |
|
|
what is the shell interpreter set in the script?
|
|
Back to top |
|
|
blu3bird Retired Dev
Joined: 04 Oct 2003 Posts: 614 Location: Munich, Germany
|
Posted: Wed Oct 30, 2013 8:28 am Post subject: Re: shell-scripts not executable though x bit set |
|
|
commander-keen wrote: | /dev/sda3 /home ext3 user 0 1 |
The mount option user implies the noexec option which prevents executions.
You can either exec bash publish, this way you won't really execute publish but /bin/bash which is not on that filesystem. Or you could change your fstab to user,exec and remount or reboot. _________________ Black Holes are created when God divides by zero! |
|
Back to top |
|
|
commander-keen n00b
Joined: 09 Oct 2013 Posts: 47 Location: Europe
|
Posted: Wed Oct 30, 2013 8:35 am Post subject: Re: shell-scripts not executable though x bit set |
|
|
[quote="blu3bird"]Or you could change your fstab to [i]user,exec[/i] and remount or reboot.[/quote]
Yes!
Thank you! |
|
Back to top |
|
|
py-ro Veteran
Joined: 24 Sep 2002 Posts: 1734 Location: Velbert
|
Posted: Wed Oct 30, 2013 11:53 am Post subject: |
|
|
And "." is the same as "source".
|
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21631
|
Posted: Wed Oct 30, 2013 9:27 pm Post subject: |
|
|
Why did you make /home mountable by normal users? On most systems, you want to mount that filesystem automatically at startup and never worry about having users mount it. |
|
Back to top |
|
|
|