# System reboots whenever applying an update

**URL:** <https://forum.legato.io/t/system-reboots-whenever-applying-an-update/3405>\
**Category:** Legato Application Framework\
**Created:** [July 5, 2018, 6:18pm UTC](https://forum.legato.io/t/system-reboots-whenever-applying-an-update/3405 "2018-07-05T18:18:54Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![nvd](https://avatars.discourse-cdn.com/v4/letter/n/82dd89/32.png) [@nvd](https://forum.legato.io/u/nvd)\
**Post date:** [July 5, 2018, 6:18pm UTC](https://forum.legato.io/t/system-reboots-whenever-applying-an-update/3405/1 "2018-07-05T18:18:54Z")

</div>

Hello all,

For some reason, whenever I apply an app update or system update, the system reboots (Legato 18.04 on WP85).

The following log snippet seems suspect to me:

```auto
Jul 5 17:07:17 swi-mdm9x15 user.info Legato: INFO | supervisor[485]/supervisor T=main | supervisor.c SigChildHandler() 781 | Reaping unconfigured child process 1179.
Jul 5 17:07:18 swi-mdm9x15 user.info Legato: INFO | updateDaemon[518]/updateDaemon T=main | supCtrl.c supCtrl_RestartLegato() 126 | Requesting Legato restart.

```

More than anything, I’m really curious where this problem came from as this appears pseudo-random from my point of view.

If anyone has any ideas it would be much appreciated.

---

<div class="post-metadata">

**Author:** ![oabid](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/oabid/32/446_2.png) [@oabid](https://forum.legato.io/u/oabid)\
**Post date:** [July 6, 2018, 2:11pm UTC](https://forum.legato.io/t/system-reboots-whenever-applying-an-update/3405/2 "2018-07-06T14:11:40Z")

</div>

Hello Nick,

When launching a system update (FOTA), the update daemon installs and reboots systematically the board in order to apply the changes. This behaviour is expected when installing a complete Legato (.cwe in general).

It’s not the case when launching an app update (SOTA), the install is done on the run-time without needing a reboot.

This probably explains why it seems pseudo-random from your side. However, if you notice a reboot after a SOTA job, please let me know in order to investigate further.

Best regards,

---

<div class="post-metadata">

**Author:** ![nvd](https://avatars.discourse-cdn.com/v4/letter/n/82dd89/32.png) [@nvd](https://forum.legato.io/u/nvd)\
**Post date:** [July 6, 2018, 5:13pm UTC](https://forum.legato.io/t/system-reboots-whenever-applying-an-update/3405/3 "2018-07-06T17:13:25Z")

</div>

Hey @oabid,

I’m seeing this with app updates as well (I’ve been applying system updates using `update` from an Ubuntu environment). It’s definitely a “new” problem for me, so something changed, but I’m really not sure where. I would definitely love to get this resolved as it makes development slower.

Thanks!

---

<div class="post-metadata">

**Author:** ![oabid](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/oabid/32/446_2.png) [@oabid](https://forum.legato.io/u/oabid)\
**Post date:** [July 9, 2018, 8:07am UTC](https://forum.legato.io/t/system-reboots-whenever-applying-an-update/3405/4 "2018-07-09T08:07:15Z")

</div>

Okay, let’s investigate this together. Can you, please, share your target configuration (type, legato version, firmware version) ?

If possible, can you provide the binaries of you app or maybe the list of services used in the app? I’ll try to set up the same environment and launch few SOTA jobs.

Also, if you can reproduce the reboot systematically, a full debug log during the download/install would be great.

Thank’s,

---

<div class="post-metadata">

**Author:** ![nvd](https://avatars.discourse-cdn.com/v4/letter/n/82dd89/32.png) [@nvd](https://forum.legato.io/u/nvd)\
**Post date:** [July 9, 2018, 8:45pm UTC](https://forum.legato.io/t/system-reboots-whenever-applying-an-update/3405/5 "2018-07-09T20:45:10Z")

</div>

Hey @oabid,

We have several Legato apps on our GitHub that produce this issue ([BRNKL by Barnacle Systems · GitHub](https://github.com/brnkl)). We’re running a WP85 with release 15 firmware (`SWI9X15Y_07.12.14.00 r34472`) with Legato 18.04.

I’ll post some more complete debug logs for the install/download by the end of the day.

Thanks!

---

<div class="post-metadata">

**Author:** ![nvd](https://avatars.discourse-cdn.com/v4/letter/n/82dd89/32.png) [@nvd](https://forum.legato.io/u/nvd)\
**Post date:** [July 26, 2018, 8:30pm UTC](https://forum.legato.io/t/system-reboots-whenever-applying-an-update/3405/6 "2018-07-26T20:30:17Z")

</div>

Hey @oabid,

My apologies for letting this sit. Some logs showing an install of our [GPS app](https://github.com/brnkl/legato-gps-monitor) can be found here: [gps-install.log · GitHub](https://gist.github.com/nvandoorn/0ec6da6b4f7d5ab1ebaa385f1b088366)

---

<div class="post-metadata">

**Author:** ![oabid](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/oabid/32/446_2.png) [@oabid](https://forum.legato.io/u/oabid)\
**Post date:** [July 27, 2018, 11:08am UTC](https://forum.legato.io/t/system-reboots-whenever-applying-an-update/3405/7 "2018-07-27T11:08:34Z")

</div>

Thank’s for the logs.  
I see that the reboot is due to a fault occurred in `sensorToCloud` application afther the installation of the `GPS app`. Here is the log:

```
DBUG | gpsMonitor[1289]/location T=main | location.c getLocation() 64 | Checking GPS position
INFO | gpsMonitor[1289]/location T=main | location.c getLocation() 87 | Failed to get reading... retrying in 1 seconds
INFO | watchdog[557]/watchdogDaemon T=main | watchdog.c CleanUpClosedClient() 355 | Client session closed
DBUG | digitalService[853]/framework T=main | brnkl_digital_server.c CleanupClientData() 148 | Client 0xb6fb05f4 is closed !!!
INFO | supervisor[518]/supervisor T=main | proc.c proc_SigChildHandler() 2035 | Process 'sensorToCloud' (PID: 926) has exited with exit code 1.
WRN- | _appStopClient[1290]/framework T=main | LE_FILENAME CreateSocket() 550 | Socket opened as standard i/o file descriptor 2!
*EMR* | supervisor[518]/supervisor T=main | app.c app_SigChildHandler() 3415 | Process 'sensorToCloud' in app 'sensorToCloud' faulted: Rebooting system.
*EMR* | supervisor[518]/supervisor T=main | supervisor.c framework_Reboot() 693 | Supervisor going down to trigger reboot.
DBUG | gpsMonitor[1289]/location T=main | location.c getLocation() 64 | Checking GPS position

```

So, my first guess is that in the .adef file of the application `sensorToCloud`, the behaviour in case of a fault is set to reboot: `faultAction: reboot`. If this is the case, I suggest reducing the severity to `faultAction: restart` to restart only the process. Check this page for further details: [Application Definition .adef - Legato Docs](https://docs.legato.io/latest/defFilesAdef.html)

Now, we need to dig further to get the origin of the fault in the `sensorToCloud` application.

Regards,

---

<div class="post-metadata">

**Author:** ![nvd](https://avatars.discourse-cdn.com/v4/letter/n/82dd89/32.png) [@nvd](https://forum.legato.io/u/nvd)\
**Post date:** [July 30, 2018, 10:16pm UTC](https://forum.legato.io/t/system-reboots-whenever-applying-an-update/3405/8 "2018-07-30T22:16:19Z")

</div>

Hey @oabid,

Thanks for the suggestions. How should I go about debugging this fault? It only happens when installing apps and the logs do not seem to provide any clues.

---

<div class="post-metadata">

**Author:** ![oabid](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/oabid/32/446_2.png) [@oabid](https://forum.legato.io/u/oabid)\
**Post date:** [September 10, 2018, 9:46am UTC](https://forum.legato.io/t/system-reboots-whenever-applying-an-update/3405/9 "2018-09-10T09:46:30Z")

</div>

Hey,  
Any news about the fault origin on the sensorToCloud app?

Can you enable full logs on Legato “log level debug” and give it another try? Or, if possible, can you provide me the app source code, I’ll do the test on my side.

Thank’s,

---

<div class="post-metadata">

**Author:** ![dbeckwith](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/dbeckwith/32/663_2.png) [@dbeckwith](https://forum.legato.io/u/dbeckwith)\
**Post date:** [May 31, 2019, 10:44pm UTC](https://forum.legato.io/t/system-reboots-whenever-applying-an-update/3405/10 "2019-05-31T22:44:47Z")

</div>

@oabid I have taken over this project from Nick and I’m experiencing the same issue. It seems like if the `.adef` is set to `faultAction: reboot` when the update is getting applied the app sees it as a fault and reboots which roles back everything. Any thoughts about how to deal with this?

---

<div class="post-metadata">

**Author:** ![plu](https://avatars.discourse-cdn.com/v4/letter/p/e19b73/32.png) [@plu](https://forum.legato.io/u/plu)\
**Post date:** [June 6, 2019, 8:31am UTC](https://forum.legato.io/t/system-reboots-whenever-applying-an-update/3405/11 "2019-06-06T08:31:46Z")

</div>

HI @dbeckwith,  
as Oabid suggested in previous post, try to reduce the severity to `faultAction: restart` to restart only the process.  
Check this page for further details: [Application Definition .adef - Legato Docs](https://docs.legato.io/latest/defFilesAdef.html)  
Best Regards

---

<div class="post-metadata">

**Author:** ![dbeckwith](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/dbeckwith/32/663_2.png) [@dbeckwith](https://forum.legato.io/u/dbeckwith)\
**Post date:** [June 6, 2019, 3:21pm UTC](https://forum.legato.io/t/system-reboots-whenever-applying-an-update/3405/12 "2019-06-06T15:21:07Z")

</div>

@plu, Thank you for the response! Couple of follow up questions:

1. Why `restart` and not `restartApp`?

2. If I want to keep `reboot` as the `faultAction` then should is there a signal we can intercept which would allow the app to shutdown gracefully? In our experience we have chosen `reboot` because we have had issues with reliably recovering our AirVantage data sessions.

3. Is this a known bug in the update process?

Thanks

---

<div class="post-metadata">

**Author:** ![mehdiALL1](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@mehdiALL1](https://forum.legato.io/u/mehdiALL1)\
**Post date:** [July 4, 2019, 3:36pm UTC](https://forum.legato.io/t/system-reboots-whenever-applying-an-update/3405/13 "2019-07-04T15:36:32Z")

</div>

@dbeckwith,  
Can you share me the app source code, I’ll do the test on my side.  
Regards

---

<div class="post-metadata">

**Author:** ![dbeckwith](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/dbeckwith/32/663_2.png) [@dbeckwith](https://forum.legato.io/u/dbeckwith)\
**Post date:** [July 4, 2019, 4:11pm UTC](https://forum.legato.io/t/system-reboots-whenever-applying-an-update/3405/14 "2019-07-04T16:11:06Z")

</div>

@mehdiALL1 It wasn’t one app in particular that caused the reset. Perhaps I can share a small sample if I understand more what you are looking for.

---

<div class="post-metadata">

**Author:** ![mehdiALL1](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@mehdiALL1](https://forum.legato.io/u/mehdiALL1)\
**Post date:** [July 5, 2019, 2:35pm UTC](https://forum.legato.io/t/system-reboots-whenever-applying-an-update/3405/15 "2019-07-05T14:35:53Z")

</div>

@dbeckwith, ah if this issue is happening with all apps, so, there is something wrong in your system. I noticed that you use Legato 18.04 on WP85 ! which is incompatible with the release 15 component.

Regards

---

<div class="post-metadata">

**Author:** ![dbeckwith](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/dbeckwith/32/663_2.png) [@dbeckwith](https://forum.legato.io/u/dbeckwith)\
**Post date:** [July 5, 2019, 3:27pm UTC](https://forum.legato.io/t/system-reboots-whenever-applying-an-update/3405/16 "2019-07-05T15:27:27Z")

</div>

@mehdiALL1 This also happens in Legato 18.09.0 with Release 16 which we moved to. It’s not all apps that exhibit this problem just some custom apps will randomly do this when updating.

---

<div class="post-metadata">

**Author:** ![mehdiALL1](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@mehdiALL1](https://forum.legato.io/u/mehdiALL1)\
**Post date:** [July 5, 2019, 3:46pm UTC](https://forum.legato.io/t/system-reboots-whenever-applying-an-update/3405/17 "2019-07-05T15:46:06Z")

</div>

@dbeckwith, The release 16 is based on 18.06.1, not 18.09.0 as you can check here: [https://source.sierrawireless.com/resources/airprime/software/wpx5xx/wpx5xx-firmware-release-16/](https://source.sierrawireless.com/resources/airprime/software/wpx5xx/wpx5xx-firmware-release-16/)

Your custom apps are built with which version of legato? (app info appName).

For example, if your applications are built with legato 18.04.0 and the legato of your module is not 18.04.0, this can also cause problems. That is why is very important to respect the versions of the component of your image and legato.

I propose to flash your module with the release 16 (so have a legato 18.06.1 in the module) and build your apps with Lagato 18.06.1 and apply an app update, it should work without rebooting

Regards

---

<div class="post-metadata">

**Author:** ![dbeckwith](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/dbeckwith/32/663_2.png) [@dbeckwith](https://forum.legato.io/u/dbeckwith)\
**Post date:** [July 8, 2019, 9:56pm UTC](https://forum.legato.io/t/system-reboots-whenever-applying-an-update/3405/18 "2019-07-08T21:56:13Z")

</div>

@mehdiALL1, The Legato version running on the WP85 is 18.09.0 and the apps we are built against 18.09.0.

Are you saying that we can’t take advantage of newer Legato versions because R16 isn’t built against 18.09.0?

Thanks,  
Darren

---

<div class="post-metadata">

**Author:** ![mehdiALL1](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@mehdiALL1](https://forum.legato.io/u/mehdiALL1)\
**Post date:** [July 9, 2019, 12:09pm UTC](https://forum.legato.io/t/system-reboots-whenever-applying-an-update/3405/19 "2019-07-09T12:09:01Z")

</div>

@dbeckwith, I just wanted to say that may be the cause of your issue. you can do the test with the right versions to check that.  
Regards
