# Running update command using system() function

**URL:** <https://forum.legato.io/t/running-update-command-using-system-function/4721>\
**Category:** Legato Application Framework\
**Created:** [September 19, 2019, 6:44am UTC](https://forum.legato.io/t/running-update-command-using-system-function/4721 "2019-09-19T06:44:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![akshaysk](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/akshaysk/32/1212_2.png) [@akshaysk](https://forum.legato.io/u/akshaysk)\
**Post date:** [September 19, 2019, 6:44am UTC](https://forum.legato.io/t/running-update-command-using-system-function/4721/1 "2019-09-19T06:44:32Z")

</div>

Hi there ,  
I am trying to run update command to install an application say helloworld using library function → system() but it doesn’t work even the **sandoxed is made false**.

#########################################  
{  
char cmd[200];  
LE\_INFO(“INSTALLING NEW APP\n”);  
**strcpy(cmd,“/legato/systems/current/bin/update /home/root/helloworld.wp76xx.update”);**  
LE\_INFO(“EXECUTING %s\n”,cmd);  
**system(cmd);**  
}  
#########################################

Please let me know some pointers to overcome this issue .

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [September 19, 2019, 6:48am UTC](https://forum.legato.io/t/running-update-command-using-system-function/4721/2 "2019-09-19T06:48:07Z")

</div>

is it because there is a space after /home/root?

---

<div class="post-metadata">

**Author:** ![akshaysk](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/akshaysk/32/1212_2.png) [@akshaysk](https://forum.legato.io/u/akshaysk)\
**Post date:** [September 19, 2019, 6:50am UTC](https://forum.legato.io/t/running-update-command-using-system-function/4721/3 "2019-09-19T06:50:03Z")

</div>

Hi @jyijyi ,  
No there is no space after /home/root/

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [September 19, 2019, 7:10am UTC](https://forum.legato.io/t/running-update-command-using-system-function/4721/4 "2019-09-19T07:10:27Z")

</div>

I don’t see problem to install application using system().  
system(“/legato/systems/current/bin/update /tmp/audioPlaybackRec.wp76xx.update”);

root@swi-mdm9x28:~# app status  
[running] atAirVantage  
[running] atQmiLinker  
[running] atService  
[running] audioService  
[running] avcService  
[stopped] batteryService  
[running] cellNetService  
[running] dataConnectionService  
[stopped] dataPushTest  
[running] dataRouter  
[running] devMode  
[stopped] drTool  
[running] fwupdateService  
[running] gpioService  
[running] ledService  
[running] modemService  
[running] mqttClient  
[running] portService  
[running] positioningService  
[running] powerMgr  
[running] qmiAirVantage  
[stopped] redSensorToCloud  
[running] secStore  
[stopped] smsInboxService  
[stopped] socialService  
[stopped] spiService  
[stopped] tools  
[stopped] voiceCallService  
[stopped] wifi  
[stopped] wifiApTest  
[stopped] wifiClientTest  
[running] wifiService  
[stopped] wifiWebAp  
[stopped] UART\_TCP\_Demo1  
root@swi-mdm9x28:~#  
root@swi-mdm9x28:~# update /tmp/hello123.wp76xx.update  
Unpacking package: 100% ++++++++++++++++++++++++++++++++++++++++++++++++++  
Applying update: 100% ++++++++++++++++++++++++++++++++++++++++++++++++++  
SUCCESS  
root@swi-mdm9x28:~#  
root@swi-mdm9x28:~# app status  
[running] atAirVantage  
[running] atQmiLinker  
[running] atService  
[running] audioService  
[running] avcService  
[stopped] batteryService  
[running] cellNetService  
[running] dataConnectionService  
[stopped] dataPushTest  
[running] dataRouter  
[running] devMode  
[stopped] drTool  
[running] fwupdateService  
[running] gpioService  
[running] ledService  
[running] modemService  
[running] mqttClient  
[running] portService  
[running] positioningService  
[running] powerMgr  
[running] qmiAirVantage  
[stopped] redSensorToCloud  
[running] secStore  
[stopped] smsInboxService  
[stopped] socialService  
[stopped] spiService  
[stopped] tools  
[stopped] voiceCallService  
[stopped] wifi  
[stopped] wifiApTest  
[stopped] wifiClientTest  
[running] wifiService  
[stopped] wifiWebAp  
[stopped] UART\_TCP\_Demo1  
[running] hello123  
[stopped] audioPlaybackRec

---

<div class="post-metadata">

**Author:** ![akshaysk](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/akshaysk/32/1212_2.png) [@akshaysk](https://forum.legato.io/u/akshaysk)\
**Post date:** [September 19, 2019, 7:14am UTC](https://forum.legato.io/t/running-update-command-using-system-function/4721/5 "2019-09-19T07:14:55Z")

</div>

Hi @jyijyi ,  
Thanks for the update . Looks weird but it worked for me as well , The reason for failure cases in earlier try is unknown .
