Permission denied for executing batch file on linux compute node
22 views (last 30 days)
Show older comments
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]);
end
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!
0 Comments
Accepted Answer
Walter Roberson
on 11 Feb 2022
Edited: Walter Roberson
on 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 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!