How to bundle multiple apps in a single file with no system image

Our code consists of 5 apps that communicate with each other via shared memory. We currently do updates by sending down 5 .update files, each one made with mkapp. We’d like to have just one file that contains the 5 apps.

I tried specifying the 5 programs in the “executable” section of the adef file, and also specifying those same programs in the “processes->run” section of the adef file. That worked, but it looks like a single app to the Legato system. I am unable to use “app stop” to stop just one component of our system.

I tried using mksys, and that did provide 5 separate apps, but it also included a system image which makes the file 40 times bigger!

Is there a way to build a .update file which contains 5 separate apps, and no system image?

Thanks!

Ken

you can combine those 5 apps into one legato app, just like what you did to specify 5 programs in the “executable” section of the adef file, but also specify “start: manual” to manually start the application.

After that you can run each component by “app runProc”
e.g.
app runProc hello1 hello1 --exe=hello1 &
app runProc hello1 hello2 --exe=hello1 &

To stop the component, you can find out the pid and kill the process.




root@swi-mdm9x28-wp:~# app runProc hello1 hello1 --exe=hello1 &
root@swi-mdm9x28-wp:~# ps aux | grep hello
root      4439  0.1  0.6   3156  1036 pts/0    S    08:14   0:00 app runProc hello1 hello1 --exe=hello1
root      4440  0.1  0.6   3048  1072 ?        S    08:14   0:00 hello1
root      4524  0.0  0.3   2324   516 pts/0    S+   08:14   0:00 grep hello
root@swi-mdm9x28-wp:~# app runProc hello1 hello2 --exe=hello1 &
root@swi-mdm9x28-wp:~# ps aux | grep hello
root      4439  0.0  0.6   3156  1036 pts/0    S    08:14   0:00 app runProc hello1 hello1 --exe=hello1
root      4440  0.0  0.6   3048  1072 ?        S    08:14   0:00 hello1
root      4532  0.3  0.6   3156  1036 pts/0    S    08:15   0:00 app runProc hello1 hello2 --exe=hello1
root      4533  0.3  0.6   3048  1076 ?        S    08:15   0:00 hello2
root      4555  0.0  0.3   2324   516 pts/0    S+   08:15   0:00 grep hello
root@swi-mdm9x28-wp:~# kill 4533
[2]+  Done                       app runProc hello1 hello2 --exe=hello1

root@swi-mdm9x28-wp:~# ps aux | grep hello
root      4439  0.0  0.6   3156  1036 pts/0    S    08:14   0:00 app runProc hello1 hello1 --exe=hello1
root      4440  0.0  0.6   3048  1072 ?        S    08:14   0:00 hello1
root      4850  0.0  0.3   2324   516 pts/0    S+   08:15   0:00 grep hello


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] atServerIntegrationTest
[running] hello1

Thanks for the reply. I tried using app runProc on my system, but it doesn’t exist. Is it a new feature in the R15 release? We haven’t moved to that yet.

Also, the start:manual step is not what we want. Unless your’e suggesting start:manual when doing a debugging build? But we were hoping for a way to do this for debugging on a production system. We also specify faultAction: restartApp for the processes, so I’m guessing if I kill them, they will just restart.

Our dream would be something like the output of mksys, but without the system update part. But my testing seems to indicate that is not possible.

Let me know if you have any other nuggets of information to share.

Thanks!.

Ken

“app runProc” is basic command in legato

Btw, for your original trial, have you tried the kill the pid of your 5 components? Can it be stopped?

In my test, I don’t see problem to just kill one component:


root@swi-mdm9x28-wp:~# ps aux | grep hello
apphell+  2373  0.0  0.6   3048  1068 ?        S    08:04   0:00 hello1
apphell+  2374  0.0  0.6   3048  1060 ?        S    08:04   0:00 hello2
root      2611  0.0  0.3   2324   516 pts/0    S+   08:04   0:00 grep hello
root@swi-mdm9x28-wp:~# killall hello2
root@swi-mdm9x28-wp:~# ps aux | grep hello
apphell+  2373  0.0  0.6   3048  1068 ?        S    08:04   0:00 hello1
root      2788  0.0  0.3   2324   516 pts/0    S+   08:05   0:00 grep hello
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] atServerIntegrationTest
[running] hello1

Here is my .adef file:



//start: manual
executables:
{
	hello1 = ( hello1Component )
	hello2 = ( hello1Component )
}

processes:
{
	envVars:
	{
		LE_LOG_LEVEL = DEBUG
	}

	run:
	{
		( hello1 )
		( hello2)
	}

	maxCoreDumpFileBytes: 512K
	maxFileBytes: 512K
	
	
	//faultAction: reboot
	faultAction: restartApp 
}

version: 1.0.0
maxFileSystemBytes: 512K

sandboxed: true