Force restart after env-var update

iptables

#1

Hi All,

I wondered if there’s any resin_ config setting which would force the device to restart when an environment variable is updated? We have some env vars which control iptables behaviour, and the best way to ensure that new rules get applied properly, is to restart the device, not just the resin app. I know this sounds a bit old-school, and we could do things like iptables-save / restore etc etc, however for our purposes a good old device restart would be preferable.

Thanks!


#2

Hi cmoss,

We currently do not provide hooks to environment variables changes; it is something the team has discussed in the past and we are considering implementing, but is ultimately not available right now.

A workaround I can suggest for the time being is to setup a service that uses the API to poll the env vars on a device and take appropriate actions once a change is detected.

Finally I would suggest to be extra careful with iptables as it could get the device offline, leaving us unable to access it and restore it. Going through iptables-save / restore sounds like the safest option for this use case.

Cheers,
Giovanni