You are not logged in.

#1 2025-08-16 04:56:18

mt_arch_user
Member
From: Montana, USA
Registered: 2023-01-17
Posts: 105

SOLVED Script won't run

I'm using Arch, Wayland, KDE

I created a file I wanted to use to learn systemctl timers.

#!/bin/bash

echo "This is the line you wanted to see"

sleep 30s

exit 0

It is created in

~/Development/StoreBackup

and is named sb.sh

I made it executable.
As StoreBackup is the default directory, I tried to run it by ./sb.sh
I get a permission denied error.
ls -l sb.sh shows:

-rwxr-xr-x 1 bart bart 74 Aug 15 22:28 sb.sh

I copied it to ~/bin and it runs.

ls -l shows:

drwxr-xr-x  2 bart bart     4096 Aug 15 22:28  StoreBackup

ls -l shows:

drwxr-xr-x  2 bart bart  4096 Aug 15 22:19  bin

Why won't it run in ~/Development/StoreBackup but will run in ~/bin ?

Last edited by mt_arch_user (2025-08-16 18:12:53)

Offline

#2 2025-08-16 06:45:30

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,712

Re: SOLVED Script won't run

Most likely a noexec mount or explicit exec mount for ~/bin only

findmnt -T ~/bin
findmnt -T ~/Development/StoreBackup

Offline

#3 2025-08-16 08:22:40

mt_arch_user
Member
From: Montana, USA
Registered: 2023-01-17
Posts: 105

Re: SOLVED Script won't run

seth wrote:

Most likely a noexec mount or explicit exec mount for ~/bin only

findmnt -T ~/bin
findmnt -T ~/Development/StoreBackup
[bart@ASU-X870E ~]$ findmnt -T ~/bin
TARGET SOURCE         FSTYPE OPTIONS
/home  /dev/nvme0n1p3 ext4   rw,relatime

[bart@ASU-X870E ~]$ findmnt -T ~/Development/StoreBackup/
TARGET                 SOURCE    FSTYPE OPTIONS
/home/bart/Development /dev/sda4 ext4   rw,nosuid,nodev,noexec,relatime,data=ordered

How did that noexec get in there?  Or for that matter, the nosuid and nodev?
Here's the line fron /etc/fstab:

LABEL=Development                          /home/bart/Development       ext4       rw,noauto,nofail,user,data=ordered 0  0

The important thing is how do I remove them?

Offline

#4 2025-08-16 10:18:04

Xephon
Member
Registered: 2024-12-22
Posts: 189

Re: SOLVED Script won't run

https://man.archlinux.org/man/mount.8#F … NT_OPTIONS

user
Allow an ordinary user to mount the filesystem. The name of the mounting user is written to the mtab file (or to the private libmount file in /run/mount on systems without a regular mtab) so that this same user can unmount the filesystem again. This option implies the options noexec, nosuid, and nodev (unless overridden by subsequent options, as in the option line user,exec,dev,suid).

Offline

#5 2025-08-16 18:12:23

mt_arch_user
Member
From: Montana, USA
Registered: 2023-01-17
Posts: 105

Re: SOLVED Script won't run

Huh!  When did that happen?  I've used the lines in my fstab for a long time and this is the first time I've run into this.
Thinking about it, it's a pretty good idea as it could be used to prevent a user running some script he installed from a link in an email.

Thanks for this!  I learned something.  Count that day lost when you don't learn something new.

Offline

Board footer

Powered by FluxBB