Restarting device from within application

Hi,

I know what I am asking about is a listed anti pattern :

However, and I had the same issue before using OpenBalena, sometimes, the raspberry pi zero looses network access for no reason. I wasted too much time already trying to figure out a logical reason for this problem. The fix I implemented previously was a simple check every once in a while for network access (both DNS and my personal server), and if there is none, I just restart the device.
It’s really a simple solution that guaranties the minimum downtime.

My problem is as follow: How do I restart the device from within my Docker application ?

I cannot call shutdown or /sbin/shutdown. Why is that ? How can I request a shutdown differently ?

Thanks in advance for your help.
Tim Winkelmann

Hello you probably want something like this Interacting with the balena Supervisor - Balena Documentation .

So the way to do what you describe is to interact with the supervisor.

1 Like

Hey,

I implemented the reboot by calling the supervisor. Thanks for the tip.

Tim

Glad it’s working :slight_smile: