Re: cannot execute make-fstab in Debian?

2020-04-08 Thread Andrei POPESCU
On Ma, 07 apr 20, 14:53:01, Greg Wooledge wrote:
> 
> At this point, it's pretty clear the file system is mounted without
> exec permission, so just fix the mount options.

Most likely the script is trying to execute some other scripts and/or 
executables on the
same filesystem, so that's why it fails.

$ mount | grep tbig
/dev/sdb1 on /media/tbig type fuseblk 
(rw,noexec,noatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)
$ bash -x /media/tbig/test.sh 
+ echo 'Successful!'
Successful!
+ source /media/tbig/sourced.sh
++ echo Sourced
Sourced
+ /media/tbig/executed.sh
/media/tbig/test.sh: line 7: /media/tbig/executed.sh: Permission denied
+ bash /media/tbig/executed.sh
Executed!


In this is case it's probably easiest to just mount the filesystem with 'exec'.

Kind regards,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser


signature.asc
Description: PGP signature


Re: cannot execute make-fstab in Debian?

2020-04-07 Thread Greg Wooledge
On Tue, Apr 07, 2020 at 08:46:07PM +0200, to...@tuxteam.de wrote:
> On Wed, Apr 08, 2020 at 01:36:06AM +0800, kaye n wrote:
> > On Tue, Apr 7, 2020 at 3:51 PM Andrei POPESCU 
> > wrote:
> > 
> > >
> > > > I tried that. I commented my line ( in /etc/fstab )
> > > >
> > > > UUID=2E7B-BA02   /media/myflashdrive   vfat
> > > >
> > > user,rw,noauto,uid=1000,gid=users,umask=0,dmask=0,fmask=0,users,exec,x-systemd.device-timeout=5s,
> > > > 00
> > > >
> > > > and executed
> > > >
> > > > bash ./run_game.sh
> > > >
> > > > it would'nt run.
> > >
> > > My crystal ball is clouded this morning.
> > >
> > > How about showing the error messages and the script?
> > >
> > 
> > kaye@laptop:/media/kaye/flashdrive/myfiles/games/SuperTuxKart-1.1-linux$
> > ./run_game.sh
> > bash: ./run_game.sh: Permission denied
> > 
> > kaye@laptop:/media/kaye/flashdrive/myfiles/games/SuperTuxKart-1.1-linux$
> > bash ./run_game.sh
> > Running 64-bit version...
> > ./run_game.sh: line 17:
> > /media/kaye/flashdrive/myfiles/games/SuperTuxKart-1.1-linux/bin-64/supertuxkart:
> > Permission denied
> 
> [...]
> 
> Three things would  be interesting:
> 
>  ls -l ./run_game.sh
>  head -5 ./run_game.sh
>  ls -l 
> /media/kaye/flashdrive/myfiles/games/SuperTuxKart-1.1-linux/bin-64/supertuxkart

At this point, it's pretty clear the file system is mounted without
exec permission, so just fix the mount options.

Remember that "users" implies "noexec", too.  If you want to keep "users",
you should add "exec" explicitly.



Re: cannot execute make-fstab in Debian?

2020-04-07 Thread tomas
On Wed, Apr 08, 2020 at 01:36:06AM +0800, kaye n wrote:
> On Tue, Apr 7, 2020 at 3:51 PM Andrei POPESCU 
> wrote:
> 
> >
> > > I tried that. I commented my line ( in /etc/fstab )
> > >
> > > UUID=2E7B-BA02   /media/myflashdrive   vfat
> > >
> > user,rw,noauto,uid=1000,gid=users,umask=0,dmask=0,fmask=0,users,exec,x-systemd.device-timeout=5s,
> > > 00
> > >
> > > and executed
> > >
> > > bash ./run_game.sh
> > >
> > > it would'nt run.
> >
> > My crystal ball is clouded this morning.
> >
> > How about showing the error messages and the script?
> >
> 
> kaye@laptop:/media/kaye/flashdrive/myfiles/games/SuperTuxKart-1.1-linux$
> ./run_game.sh
> bash: ./run_game.sh: Permission denied
> 
> kaye@laptop:/media/kaye/flashdrive/myfiles/games/SuperTuxKart-1.1-linux$
> bash ./run_game.sh
> Running 64-bit version...
> ./run_game.sh: line 17:
> /media/kaye/flashdrive/myfiles/games/SuperTuxKart-1.1-linux/bin-64/supertuxkart:
> Permission denied

[...]

Three things would  be interesting:

 ls -l ./run_game.sh
 head -5 ./run_game.sh
 ls -l 
/media/kaye/flashdrive/myfiles/games/SuperTuxKart-1.1-linux/bin-64/supertuxkart

Cheers
-- tomás


signature.asc
Description: Digital signature


Re: cannot execute make-fstab in Debian?

2020-04-07 Thread kaye n
On Tue, Apr 7, 2020 at 3:51 PM Andrei POPESCU 
wrote:

>
> > I tried that. I commented my line ( in /etc/fstab )
> >
> > UUID=2E7B-BA02   /media/myflashdrive   vfat
> >
> user,rw,noauto,uid=1000,gid=users,umask=0,dmask=0,fmask=0,users,exec,x-systemd.device-timeout=5s,
> > 00
> >
> > and executed
> >
> > bash ./run_game.sh
> >
> > it would'nt run.
>
> My crystal ball is clouded this morning.
>
> How about showing the error messages and the script?
>

kaye@laptop:/media/kaye/flashdrive/myfiles/games/SuperTuxKart-1.1-linux$
./run_game.sh
bash: ./run_game.sh: Permission denied

kaye@laptop:/media/kaye/flashdrive/myfiles/games/SuperTuxKart-1.1-linux$
bash ./run_game.sh
Running 64-bit version...
./run_game.sh: line 17:
/media/kaye/flashdrive/myfiles/games/SuperTuxKart-1.1-linux/bin-64/supertuxkart:
Permission denied

kaye@laptop:/media/kaye/flashdrive/myfiles/games/SuperTuxKart-1.1-linux$
sudo bash ./run_game.sh
[sudo] password for kaye:
Running 64-bit version...
./run_game.sh: line 17:
/media/kaye/flashdrive/myfiles/games/SuperTuxKart-1.1-linux/bin-64/supertuxkart:
Permission denied

kaye@laptop:/media/kaye/flashdrive/myfiles/games/SuperTuxKart-1.1-linux$
sudo ./run_game.sh
sudo: ./run_game.sh: command not found

Thank you!


Re: cannot execute make-fstab in Debian?

2020-04-07 Thread Andrei POPESCU
On Ma, 07 apr 20, 03:15:21, kaye n wrote:
> On Mon, Apr 6, 2020 at 7:28 PM Andrei POPESCU 
> wrote:
> 
> > > As for the flash drive, I have to add this line to the /etc/fstab file
> > (so
> > > I can run .sh files from the flash drive)
> >
> > Actually you don't, you can just use 'bash myshellscript.sh' instead ;)
> >
> 
> I tried that. I commented my line ( in /etc/fstab )
> 
> UUID=2E7B-BA02   /media/myflashdrive   vfat
> user,rw,noauto,uid=1000,gid=users,umask=0,dmask=0,fmask=0,users,exec,x-systemd.device-timeout=5s,
> 00
> 
> and executed
> 
> bash ./run_game.sh
> 
> it would'nt run.

My crystal ball is clouded this morning.

How about showing the error messages and the script?

Kind regards,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser


signature.asc
Description: PGP signature


Re: cannot execute make-fstab in Debian?

2020-04-06 Thread kaye n
On Mon, Apr 6, 2020 at 7:28 PM Andrei POPESCU 
wrote:

> > As for the flash drive, I have to add this line to the /etc/fstab file
> (so
> > I can run .sh files from the flash drive)
>
> Actually you don't, you can just use 'bash myshellscript.sh' instead ;)
>

I tried that. I commented my line ( in /etc/fstab )

UUID=2E7B-BA02   /media/myflashdrive   vfat
user,rw,noauto,uid=1000,gid=users,umask=0,dmask=0,fmask=0,users,exec,x-systemd.device-timeout=5s,
00

and executed

bash ./run_game.sh

it would'nt run.

Then I uncommented the line and I could run the game again by executing

bash ./run_game.sh.

Just a reminder, the above line is for my flash drive.

No big deal though. As long as it's working I'm happy. But I wouldn't mind
learning something from you guys.

Thanks!!


Re: cannot execute make-fstab in Debian?

2020-04-06 Thread tomas
On Mon, Apr 06, 2020 at 02:34:07PM +0300, Andrei POPESCU wrote:
> On Lu, 06 apr 20, 12:41:26, to...@tuxteam.de wrote:
> > > 
> > > *UUID=2E7B-BA02   /media/myflashdrive   vfat
> > > user,rw,noauto,uid=1000,gid=users,umask=0,dmask=0,fmask=0,users,exec,x-systemd.device-timeout=5s,
> > > 00 *
> > 
> > It looks right to me (I asume the asterisks at the start and end
> > of the line are added by you for emphasis)
> 
> Most likely by the e-mail client when generating plain text from html.

Indeed, good catch.

Cheers
-- t


signature.asc
Description: Digital signature


Re: cannot execute make-fstab in Debian?

2020-04-06 Thread Andrei POPESCU
On Lu, 06 apr 20, 12:41:26, to...@tuxteam.de wrote:
> > 
> > *UUID=2E7B-BA02   /media/myflashdrive   vfat
> > user,rw,noauto,uid=1000,gid=users,umask=0,dmask=0,fmask=0,users,exec,x-systemd.device-timeout=5s,
> > 00 *
> 
> It looks right to me (I asume the asterisks at the start and end
> of the line are added by you for emphasis)

Most likely by the e-mail client when generating plain text from html.

@kaye: most of us only read the plain text version of your message. If 
possible please refrain from sending html to the list, as the result on 
the receiver's end is unpredictable.

If you really can't avoid it, don't bother adding any formatting (bold, 
etc.), it will only make things more difficult for us to read.

Kind regards,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser


signature.asc
Description: PGP signature


Re: cannot execute make-fstab in Debian?

2020-04-06 Thread tomas
On Mon, Apr 06, 2020 at 02:27:57PM +0300, Andrei POPESCU wrote:

[...]

> That line has several issues [...]

Your comb sure is finer than mine, thanks :-)

Cheers
-- t


signature.asc
Description: Digital signature


Re: cannot execute make-fstab in Debian?

2020-04-06 Thread Andrei POPESCU
On Lu, 06 apr 20, 18:30:02, kaye n wrote:
> Sorry about that.  I should have tested it first.
> 
> What I'm trying to achieve is to be able to save files and to run
> executable files (like  .sh file) from an NTFS partition of the hard drive,
> as well as from a USB flash drive.
> 
> It seems that in Debian, I can already do that in an NTFS partition of the
> hard drive, can you confirm?
> 
> As for the flash drive, I have to add this line to the /etc/fstab file (so
> I can run .sh files from the flash drive)

Actually you don't, you can just use 'bash myshellscript.sh' instead ;)

If this doesn't work for you (why?) read below.

> *UUID=2E7B-BA02   /media/myflashdrive   vfat
> user,rw,noauto,uid=1000,gid=users,umask=0,dmask=0,fmask=0,users,exec,x-systemd.device-timeout=5s,
> 00 *

That line has several issues, e.g. in Debian users are not automatically 
members of the 'users' group.

'uid': use the number shown by running 'id' as your user. It is '1000' 
for the user created during the installation process.

'gid=users' is needed only if you need the flash drive to be accessible 
by more users in which case you must add them manually to that group 
('adduser alice users').

If only you need access use your own gid instead (should be the same as 
your uid).

'dmask'/'fmask' are redundant if you already specify 'umask=0'. Normally 
I would suggest 'dmask=002' and 'fmask=113'. but you need 'fmask=003' or 
similar, so it doesn't make a big difference.

'exec' is only needed because you specify 'users' (do you need it?). See 
'man mount' for what it does.

'x-systemd.device-timeout' is redundant as well due to 'noauto' (systemd 
shouldn't even attempt to mount it).


Kind regards,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser


signature.asc
Description: PGP signature


Re: cannot execute make-fstab in Debian?

2020-04-06 Thread tomas
On Mon, Apr 06, 2020 at 06:30:02PM +0800, kaye n wrote:
> Sorry about that.  I should have tested it first.
> 
> What I'm trying to achieve is to be able to save files and to run
> executable files (like  .sh file) from an NTFS partition of the hard drive,
> as well as from a USB flash drive.
> 
> It seems that in Debian, I can already do that in an NTFS partition of the
> hard drive, can you confirm?

If it is mounted, yes.

> As for the flash drive, I have to add this line to the /etc/fstab file (so
> I can run .sh files from the flash drive)
> 
> *UUID=2E7B-BA02   /media/myflashdrive   vfat
> user,rw,noauto,uid=1000,gid=users,umask=0,dmask=0,fmask=0,users,exec,x-systemd.device-timeout=5s,
> 00 *

It looks right to me (I asume the asterisks at the start and end
of the line are added by you for emphasis)

Note that you don't /have/ to add something to the fstab
to have it mounted. It'd make sense if you plan to mount
this specific media often, though.

> In the other distro, I would delete the existing /etc/fstab file, execute 
> *sudo
> make-fstab* in order to generate a new fstab file, and in that fstab file
> there would be a line for the flash drive.

That means that "make-fstab" would construct an fstab from the currently
mounted devices? I can't help it, that sounds somewhat daredevil to me.
But of course, each one gets to choose her own thrills ;-D

> I would then edit that line to
> make it look like the one above so that I can run .sh files from the flash
> drive.

Ah, that's why the exec option is up there, OK.

> As make-fstab command doesn't exist in Debian, I just added the above line
> to /etc/fstab and it seems to have solved the problem.  But can you confirm
> that line as well? I'm not an expet.

Yes, it looks fine to me. But, as I said, if it's not a frequent operation,
you might want to either mount manually or let some automounter do the
job for you (most desktop environments do the latter).

Me? I prefer to mount manually: when lights get out, I at least get some
direct feedback on my actions ;-)

Cheers
-- tomás


signature.asc
Description: Digital signature


Re: cannot execute make-fstab in Debian?

2020-04-06 Thread kaye n
Sorry about that.  I should have tested it first.

What I'm trying to achieve is to be able to save files and to run
executable files (like  .sh file) from an NTFS partition of the hard drive,
as well as from a USB flash drive.

It seems that in Debian, I can already do that in an NTFS partition of the
hard drive, can you confirm?

As for the flash drive, I have to add this line to the /etc/fstab file (so
I can run .sh files from the flash drive)

*UUID=2E7B-BA02   /media/myflashdrive   vfat
user,rw,noauto,uid=1000,gid=users,umask=0,dmask=0,fmask=0,users,exec,x-systemd.device-timeout=5s,
00 *

In the other distro, I would delete the existing /etc/fstab file, execute *sudo
make-fstab* in order to generate a new fstab file, and in that fstab file
there would be a line for the flash drive.  I would then edit that line to
make it look like the one above so that I can run .sh files from the flash
drive.

As make-fstab command doesn't exist in Debian, I just added the above line
to /etc/fstab and it seems to have solved the problem.  But can you confirm
that line as well? I'm not an expet.

Thank you!





On Mon, Apr 6, 2020 at 6:02 PM  wrote:

> On Mon, Apr 06, 2020 at 05:54:32PM +0800, kaye n wrote:
> > Hello Friends!
> >
> > I assume this is the correct syntax?
> >
> > sudo make-fstab
> >
> > I can execute it in another distro but not in my Debian.
>
> Perhaps you might tell us what the error message looks like. My guess
> is that there is no command with that name.
>
> Probably your "other distro" (which?) has a distro-specific command,
> but we can only guess what it is supposed to do. Apt-file search
> doesn't come up with a package providing a command with that name.
>
> What are you trying to achieve?
>
> Cheers
> -- tomás
>


Re: cannot execute make-fstab in Debian?

2020-04-06 Thread tomas
On Mon, Apr 06, 2020 at 05:54:32PM +0800, kaye n wrote:
> Hello Friends!
> 
> I assume this is the correct syntax?
> 
> sudo make-fstab
> 
> I can execute it in another distro but not in my Debian.

Perhaps you might tell us what the error message looks like. My guess
is that there is no command with that name.

Probably your "other distro" (which?) has a distro-specific command,
but we can only guess what it is supposed to do. Apt-file search
doesn't come up with a package providing a command with that name.

What are you trying to achieve?

Cheers
-- tomás


signature.asc
Description: Digital signature