Permission denied for executing batch file on linux compute node

21 Ansichten (letzte 30 Tage)
On a local unbuntu 20.04 os, I have followed the MATLAB example of building code-generated model file (as rsim.tlc system target) on this link. Everything worked fine (using MATLAB R2020b update 6). But when I migrated the files onto a compute node in a university cluster (with MATLAB R2020b initial version), and repeating the same steps for calling the batch script, now matlab is giving me error saying permission denied. The permission denied error came when the code was executed to the following step in the example:
batFileName = 'rtwdemo_rsim_vdp_run_scr';
[stat, res] = system(['.' filesep batFileName]);
if stat ~= 0
error(['Error running batch file ''', batFileName, ''' :', res]);
I packaged the above script into a file named run_batch.m and the error was:
Error using run_batch (line 4)
Error running batch file 'rtwdemo_rsim_vdp_run_scr' :/bin/bash: ./rtwdemo_rsim_vdp_run_scr: Permission denied
I am not sure what `Permission denied` indicates out of the system() function. Sure, I don't have sudo (super-user) status on the cluster node. But I didn't need the sudo status to run this example perfectly in my local Ubuntu 20.04 laptop. So I'm stuck here. Eventuall I'd like to be able to run this exmaple on the cluster node.
Any tip is appreciated!

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 11 Feb. 2022
Bearbeitet: Walter Roberson am 11 Feb. 2022
!chmod ugo+x ./rtwdemo_rsim_vdp_run_scr
That should only be needed once.
If the file happens to be on a filesystem that is mounted with no-execute set, then a different approach would be needed.
  2 Kommentare
Tong Zhao
Tong Zhao am 11 Feb. 2022
Bearbeitet: Tong Zhao am 11 Feb. 2022
Update: I realized that running the batch script involved calling a few files, and I only changed permission on one of them. After changing the permission on all of them using
chmod ugo+x *
The stat=126 error went away, but I got a stat=1 error instead. I don't know what it means...
Displaying stat:
Displaying res:
./rtwdemo_rsim_vdp -p rtwdemo_rsim_vdp_prm_sets.mat@1 -o rtwdemo_rsim_vdp_run1.mat -L 3600 1> rtwdemo_rsim_vdp_run_scr.log 2>&1
./rtwdemo_rsim_vdp -p rtwdemo_rsim_vdp_prm_sets.mat@2 -o rtwdemo_rsim_vdp_run2.mat -L 3600 1> rtwdemo_rsim_vdp_run_scr.log 2>&1
./rtwdemo_rsim_vdp -p rtwdemo_rsim_vdp_prm_sets.mat@3 -o rtwdemo_rsim_vdp_run3.mat -L 3600 1> rtwdemo_rsim_vdp_run_scr.log 2>&1
Update: ok, I further checked a log that is produced by the batch script, and it says:
/lib64/ version `GLIBC_2.29' not found (required by ./rtwdemo_rsim_vdp)
Seems like I need a specific glibc 2.29 package for the cluster node. I've asked the admin, and got the feedback that glibc is at the core of the system, it is unlikely I can get around it, so if I needed to run this I'll have to downgrade to fit what is available in the cluster node. But this is a whole another issue. For the initial question, Walter has answered it correctly.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)


Mehr zu Deployment, Integration, and Supported Hardware finden Sie in Help Center und File Exchange




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by