From 63bd9605cff7dc1b6656da2a71d557d44a760ceb Mon Sep 17 00:00:00 2001 From: "Vipul Gupta (@vipulgupta2048)" Date: Wed, 2 Nov 2022 11:50:31 +0000 Subject: [PATCH] patch: Update locks behavior for config changes Signed-off-by: Vipul Gupta (@vipulgupta2048) --- docs/update-locking.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/update-locking.md b/docs/update-locking.md index edc75778..d40dfa54 100644 --- a/docs/update-locking.md +++ b/docs/update-locking.md @@ -5,7 +5,7 @@ excerpt: Locking updates to the release that is running on your balenaOS devices # Update locks -Locking updates means that the balena supervisor will not be able to kill the services running on the device. This is meant to be used at critical sections of your code where you don't want to be interrupted, or to ensure that updates are only installed at certain times. +Locking updates means that the balena supervisor will not be able to kill the services running on the device for an update. This is meant to be used at critical sections of your code where you don't want the process to be interrupted, or to ensure that updates are installed only at certain times. Moreover, any configuration changes that will reboot the device won't trigger reboots if locks are applied. Config changes not requiring a reboot will be applied as usual. In order to do this, users can create a lockfile in a way that it has exclusive access, which will prevent the device supervisor from killing and restarting the app. As with any other lockfile, the supervisor itself will create such a file before killing the app, so you should only create it in exclusive mode. This means that the lockfile should only be created if it doesn't already exist. The exclusive access is achieved by opening the lockfile with the [O_EXCL and O_CREAT flags](https://linux.die.net/man/3/open), and several tools exist to simplify this process with examples given [below](#creating-the-lockfile).