Invoking shell scripts from Legato app

We’re trying to invoke some simple shell scripts from an unsandboxed Legato app that uses the WP 7603 but have so far been unable to do so. The scripts are present on the module (installed manually at this point) and we can run them all manually so I don’t think there are any path or permissions issues. It seems as though something is needed by Legato, I presume in the .adef, but don’t know what that is.

This seems like such a simple requirement I can’t believe it’s going to require customizing linux as installed on the module with Yocto or anything of that complexity, and assume it’s just something we’ve overlooked? We’re invoking the scripts using calls with this format: system(“/bin/sh /home/scripts/test_script”);

Any help would be appreciated as we’re stymied at this point.

I remember there should not be problem, you can see here : (maybe without the /bin/sh??? )

Thanks for the response. Unfortunately removing /bin/sh made no difference (I think I tried with and without it - should have mentioned that). Looking at the return from the system call it’s 32512, which seems like it might be a path issue, but I’m using the full path. I even tried changing to the script dir first but that didn’t work. Something to do with busybox maybe?

Following your link it looks like some of the previous user’s issues were resolved by upgrading from 17.11 but we’re already using a newer legato than that (18.10.3).

So your system(“/tmp/test.sh”) call runs just like that? Nothing had to be added to the .adef?

I don’t see problem on WP76 FW R13.
You can use my hello6.tar.gz.
hello6.tar.gz (314.7 KB)

root@swi-mdm9x28-wp:~# chmod 777 /tmp/test.sh
root@swi-mdm9x28-wp:~# /tmp/test.sh
root@swi-mdm9x28-wp:~# ls /tmp/123.txt
/tmp/123.txt
root@swi-mdm9x28-wp:~# cat /tmp/123.txt
123
root@swi-mdm9x28-wp:~# rm /tmp/123.txt
root@swi-mdm9x28-wp:~# ls /tmp/
hello6.wp76xx.update legato test.sh
hosts pkgdwl thermal_engi_ipc
ld.so.cache psm_socket tmpfdbtable.txt
ld.so.conf sock0
root@swi-mdm9x28-wp:~# update /tmp/hello6.wp76xx.update
Unpacking package: 100% ++++++++++++++++++++++++++++++++++++++++++++++++++
Applying update: 100% ++++++++++++++++++++++++++++++++++++++++++++++++++
SUCCESS
root@swi-mdm9x28-wp:~# app status
[running] atAirVantage
[running] atQmiLinker
[running] atService
[running] audioService
[running] avcService
[running] cellNetService
[running] dataConnectionService
[running] fwupdateService
[running] gpioService
[running] modemService
[running] portService
[running] positioningService
[running] powerMgr
[running] qmiAirVantage
[running] secStore
[stopped] smsInboxService
[stopped] spiService
[stopped] tools
[stopped] voiceCallService
[stopped] wifi
[stopped] wifiApTest
[stopped] wifiClientTest
[running] wifiService
[stopped] wifiWebAp
[stopped] hello6
root@swi-mdm9x28-wp:~# ls /tmp/
hello6.wp76xx.update legato test.sh
hosts pkgdwl thermal_engi_ipc
ld.so.cache psm_socket tmpfdbtable.txt
ld.so.conf sock0
root@swi-mdm9x28-wp:~# app start hello6
root@swi-mdm9x28-wp:~# ls /tmp/
123.txt ld.so.conf sock0
hello6.wp76xx.update legato test.sh
hosts pkgdwl thermal_engi_ipc
ld.so.cache psm_socket tmpfdbtable.txt
root@swi-mdm9x28-wp:~#

Thanks jyijyi, confirmed it works with FW R13. Unfortunately that version is not supported by Dev. Studio so we may have to use it unsupported, or move to VS Code (had been hoping to defer that for a while…)

Are you using wp76 module?
I remember there is fw r13 in developer studio for wp76 module.

That version shows up as one of the available packages and is what we’ve installed, however according to the notifications tab it’s not supported. At the moment we’re using it anyway as it does seem to work.

@dave-k ,
Please post the response for cat /etc/legato/version . I am suspecting that you are running R13.1 not R13 which could be the reason why you are getting this warning about the version .

this warning actually does not have problem, I usually see this but I can still download application to it.