# How work Supervisor

**URL:** <https://forum.legato.io/t/how-work-supervisor/4788>\
**Category:** Legato Application Framework\
**Created:** [October 29, 2019, 1:30pm UTC](https://forum.legato.io/t/how-work-supervisor/4788 "2019-10-29T13:30:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zuuuuk](https://avatars.discourse-cdn.com/v4/letter/z/e5b9ba/32.png) [@zuuuuk](https://forum.legato.io/u/zuuuuk)\
**Post date:** [October 29, 2019, 1:30pm UTC](https://forum.legato.io/t/how-work-supervisor/4788/1 "2019-10-29T13:30:34Z")

</div>

Hello .  
i read legato framework 18.06 file supervisor.c  
C:\Legato\Packages\legato.framework.18.6.4.wp85-wp750x-201811231214\resources\legato\framework\daemons\linux\supervisor\supervisor.c  
I see code  
// All the framework daemons are active now. Now set the reboot expiry timer if it is not a  
// RO system.  
if (!isReadOnly)  
{  
LE\_INFO(“Not a read-only system. Configuring boot expire timer.”);  
// If we have a writable system, create and start the quick-reboot timer.  
RebootTimer = le\_timer\_Create(“Reboot”);  
le\_timer\_SetHandler(RebootTimer, HandleRebootExpiry);

le\_timer\_SetMsInterval(RebootTimer, GetBootExpirePeriod());  
le\_timer\_SetWakeup(RebootTimer, false);  
le\_timer\_Start(RebootTimer);

```
}

```

**1) But what causes HandleRebootExpiry() ?**  
**Under what circumstances will be called HandleRebootExpiry() ?**

static size\_t GetBootExpirePeriod  
(  
void  
)  
{  
int period;

// Read the user defined timeout from config tree  
le\_cfg\_IteratorRef\_t iterRef = le\_cfg\_CreateReadTxn(BOOT\_CFG\_PATH);  
period = le\_cfg\_GetInt(iterRef, BOOT\_TIMEOUT\_PATH, DEFAULT\_BOOT\_PERIOD);  
le\_cfg\_CancelTxn(iterRef);

```
LE_INFO("Boot timeout period = %d ms (~%d seconds)", period, period/1000);

return (size_t)period;

```

}  
**2) How to change the timeout value in the system?**  
**BOOT\_CFG\_PATH**

---

<div class="post-metadata">

**Author:** ![lotam](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@lotam](https://forum.legato.io/u/lotam)\
**Post date:** [November 4, 2019, 6:32am UTC](https://forum.legato.io/t/how-work-supervisor/4788/2 "2019-11-04T06:32:55Z")

</div>

Hi zuuuuk,

Below my understanding

1. This used to monitor does system boot correctly and stable for certain time (specified by BOOT\_CFG\_PATH, BOOT\_TIMEOUT\_PATH).  
So, system run normally (without reboot) will cause the timer expire and called the HandleRebootExpiry().

2. We can use Config Tree API to specify your desired timeout value or use target tool “config”.  
[Config Tree - Legato Docs](https://docs.legato.io/latest/legatoServicesConfigTree.html)

Hope it helps.  
Thx
