Permission denied for executing batch file on linux compute node
21 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Walter Roberson
2022-2-11
编辑:Walter Roberson
2022-2-11
!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 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!