Results 1 to 7 of 7

Thread: Can't Run Shell Script

  1. #1

    Default Can't Run Shell Script

    openSUSE 11.3 KDE 4.4.4

    I am having the same problem as here

    Basically I can't run shell scripts from the file manager.
    There is no specialized application for files of the type shell script (application/x-shellscript).
    The file can be opened in a more generic application as file type plain text document (text/plain), or you can try to install a specialized application for file type shell script (application/x-shellscript).
    Do you want to try to install a specialized application?
    As you can see from this command line output, the file is executable.
    Code:
    myuser@linux-h87v:/media/data/myuser/apps/jetbrains/idea-IU-98.402/bin> ls -l idea.sh
    -rwxr-xr-x 1 myuser users 3395 2010-11-19 17:34 idea.sh
    I thought that since all shell scripts are showing the same behaviour that openSUSE isn't configuring itself correctly on installation.
    And strangely, I didn't have this problem last month when I was running openSUSE 11.3 KDE 4.5.2.

    The file is in my data partition so wasn't wiped out when I reinstalled.
    I created the same username when I reinstalled so it should still be owned by myuser.
    I chown'd the file as well just for good measure but I still can't get it to run.

    This then led me to run the script again but from the command line and I got a permission denied error.

    I created a new file in my home directory and this was runnable from the command line and from Dolphin but it appears to have the same permission settings

    I did notice on first login after installation an error about not being able to save bookmarks or something, the rest of the error being:
    Permission denied. This error message will only be shown once. The cause of the error needs to be fixed as quickly as possible, which is most likely a full hard drive.

    As a side note: if it is a strange access permission thing then the error message shown by Dolphin is misleading/incorrect.

  2. #2
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: Can't Run Shell Script

    What are the mount options on this partition?

    mount | grep /media

  3. #3

    Default Re: Can't Run Shell Script

    Code:
    /dev/mapper/system-data on /media/data type ext4 (rw,noexec,nosuid,nodev,acl)
    /etc/fstab looks like this
    Code:
    /dev/system/swap     swap                 swap       defaults              0 0
    /dev/system/rootSuse /                    ext4       acl,user_xattr        1 1
    /dev/disk/by-id/ata-Hitachi_HTS723216L9A362_081014FC3200NCG1TBDD-part5 /boot                ext3       defaults              1 2
    /dev/disk/by-id/ata-Hitachi_HTS723216L9A362_081014FC3200NCG1TBDD-part2 /media/Documents     ntfs-3g    user,noauto,users,gid=users,fmask=133,dmask=022,locale=en_GB.UTF-8 0 0
    /dev/disk/by-id/ata-Hitachi_HTS723216L9A362_081014FC3200NCG1TBDD-part1 /media/Windows       ntfs-3g    user,noauto,users,gid=users,fmask=133,dmask=022,locale=en_GB.UTF-8 0 0
    /dev/system/data     /media/data          ext4       user,acl              1 2
    proc                 /proc                proc       defaults              0 0
    sysfs                /sys                 sysfs      noauto                0 0
    debugfs              /sys/kernel/debug    debugfs    noauto                0 0
    devpts               /dev/pts             devpts     mode=0620,gid=5       0 0

  4. #4
    Join Date
    Jul 2010
    Location
    Adelaide, Australia
    Posts
    963

    Default Re: Can't Run Shell Script

    Quote Originally Posted by opticyclic View Post
    Code:
    /dev/mapper/system-data on /media/data type ext4 (rw,noexec,nosuid,nodev,acl)
    /etc/fstab looks like this
    Code:
    /dev/system/swap     swap                 swap       defaults              0 0
    /dev/system/rootSuse /                    ext4       acl,user_xattr        1 1
    /dev/disk/by-id/ata-Hitachi_HTS723216L9A362_081014FC3200NCG1TBDD-part5 /boot                ext3       defaults              1 2
    /dev/disk/by-id/ata-Hitachi_HTS723216L9A362_081014FC3200NCG1TBDD-part2 /media/Documents     ntfs-3g    user,noauto,users,gid=users,fmask=133,dmask=022,locale=en_GB.UTF-8 0 0
    /dev/disk/by-id/ata-Hitachi_HTS723216L9A362_081014FC3200NCG1TBDD-part1 /media/Windows       ntfs-3g    user,noauto,users,gid=users,fmask=133,dmask=022,locale=en_GB.UTF-8 0 0
    /dev/system/data     /media/data          ext4       user,acl              1 2
    proc                 /proc                proc       defaults              0 0
    sysfs                /sys                 sysfs      noauto                0 0
    debugfs              /sys/kernel/debug    debugfs    noauto                0 0
    devpts               /dev/pts             devpts     mode=0620,gid=5       0 0
    try changing this line in fstab:
    Code:
    /dev/system/data     /media/data          ext4       user,acl              1 2
    to
    Code:
    /dev/system/data     /media/data          ext4       user,acl,exec              1 2
    Notice the exec option. In your mount command it showed noexec which means no executable

    Then restart
    Desktop: Gigabyte GA-Z270-HD3 - Core i7 7700K - openSUSE Leap 42.2 KDE
    Laptop: HP EliteBook 8770W - Core i7 3940XM - openSUSE Leap 42.2 KDE

  5. #5

    Default Re: Can't Run Shell Script

    Aarrgghh! I knew the answer to that one!

    The questions now are:
    1) Why does the installer set up the mount without the exec option? Don't most people want it?
    2) Why does Dolphin give that strange message rather than "Permission Denied"?

  6. #6
    Join Date
    Jul 2010
    Location
    Adelaide, Australia
    Posts
    963

    Default Re: Can't Run Shell Script

    Quote Originally Posted by opticyclic View Post
    Aarrgghh! I knew the answer to that one!

    The questions now are:
    1) Why does the installer set up the mount without the exec option? Don't most people want it?
    2) Why does Dolphin give that strange message rather than "Permission Denied"?
    To answer question number 1:
    From:
    How to edit and understand /etc/fstab

    exec and noexec exec lets you execute binaries that are on that partition, whereas noexec doesn't let you do that. noexec might be useful for a partition that contains binaries you don't want to execute on your system, or that can't even be executed on your system. This might be the case of a Windows partition.

    exec is the default option, which is a good thing. Imagine what would happen if you accidentally used the noexec option with your Linux root partition...
    So exec should have been default I am not sure why it did noexec instead however on my 1TB data drive it is by default mounted with exec option


    And I have no idea about number 2, sorry - maybe ask on the KDE forum? (Index page • KDE Community Forums)
    Desktop: Gigabyte GA-Z270-HD3 - Core i7 7700K - openSUSE Leap 42.2 KDE
    Laptop: HP EliteBook 8770W - Core i7 3940XM - openSUSE Leap 42.2 KDE

  7. #7
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Can't Run Shell Script

    On 2010-12-13 20:06, opticyclic wrote:

    > The questions now are:
    > 1) Why does the installer set up the mount without the exec option?


    Security.

    > Don't most people want it?


    No :-P

    /They/ know better. >:-)

    Noexec is used by default or by yast for data partitions. You are the admin
    and have to change the defaults when you need >:-)

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.2 x86_64 "Emerald" at Telcontar)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •