The gateway uses systemd as it’s init/service manager. This article helps you add your own service or unit file to start your application automatically after boot process is finished and make it persistent between updates.
Describes gateways firmware update process
Describes gateways persist_move operation
Describes gateways updatehooks operations