How to configure /etc/systemd/system.conf from image?

Hi!

I was reading an article about activating the watchdog for BalenaOS. Basicly, to configure the watchdog in BalenaOS, I have to change the following file:
/etc/systemd/system.conf

Is there an easy way to modify/flash this file in my BalenaOS base image for my devices?

For example, right now my system connections for my devices are easily read/writable because its accable on /mnt/boot/system-connections

Thanks!

Hi

Before that, I’d like to understand a bit about what you mean by activating the watchdog. We already check for some device health metrics, which could work for you. What is it exactly that you are trying to do?

Hi @anujdeshpande,

I have a scheduled reboot at night that is sometimes failing. It results to the following 2 situations sometimes:

-Device stays online, but containers are stopped
-Device will not come back online after reboot. After manually re plug the power cycle of that device, it comes back online again.

This was my motivation to search for some configuration to make sure my device will reboot properly

So I would like to add the following

RuntimeWatchdogSec=10

in the /etc/systemd/system.conf

My question is how to edit this file so it keeps the same config after device reboot/restart?

Hey @robbie, rather than modify the system watchdog what we normally recommend for this type of action is to use our SDK or Supervisor API to trigger a reboot from inside your own application container.

For example, if you add the label io.balena.features.supervisor-api=1 to your application container, then you could schedule a curl command to reboot the device:

curl -X POST --header "Content-Type:application/json" \
    "$BALENA_SUPERVISOR_ADDRESS/v1/reboot?apikey=$BALENA_SUPERVISOR_API_KEY"

Is this how you are currently rebooting the device and having problems?

Also, if you could fill us in on why the reboot is required at all, we may be able to get a better understanding of the problem we are trying to solve.