Problem running processes


#1

Hi everyone,

I have a problem running processes through the shell after install and run the app, for example, with ‘modemDemo’ example:

root@swi-mdm9x15:/opt/legato/apps/modemDemo/bin# pwd /opt/legato/apps/modemDemo/bin root@swi-mdm9x15:/opt/legato/apps/modemDemo/bin# ls modemDemo send

root@swi-mdm9x15:/opt/legato/apps/modemDemo/bin# ./send "+18005550199" "hello world" ./send: error while loading shared libraries: /opt/legato/apps/modemDemo/bin/../lib/liblegato.so: file too short

Legato Application Framework 14.10.0 Beta
Developer Studio 3.2

When I tried this example (and others) in the previous version (14.07.0 Beta) I didn’t have this ‘problem’. Could be a bad setup of my devstudio? Someone with same error execution & legato-af version?

Note: if the process is executed by the ‘.adef’ file when the app is started, ‘send’ process is properly launched.

Thanks! :wink:


#2

Hello Daniel,

The problem you are encountering is that the send command is compiled to expect it’s shared libs in certain directories. Also, the binding configration is setup such that the send command needs to run inside of the app.

If you use the tool, execInApp, you can execute a process within a given application sandbox. (Provided that the executable you want to run is bound inside of that sandbox.)

So, to run the send command from the command line you can issue the following command:

If this is something you wish to do often, you can create a shell script to simplify this.

#!/bin/sh
execInApp modemDemo /bin/send "$@"

So, if the script file is called send and has been placed in your path, then it looks more like:

I hope this helps,
-Kelly


#3

Thank you for your quick answer. I’ve tested and it works properly!

Also, I’ve check the ‘exeInApp’ documentation:
http://www.legato.io/legato-docs/14_10/tools_exec_in_app.html

In the previous version (legato-af 14.07) I used to execute the processes without this command tool but I’ve noticed that is the right way to do it.

Thanks