Every morning my devices reboot in order to reestablish their cellular connection.
(this may be an issue in itself. Perhaps I should try to solve the problem with the cell connection rather than rebooting, but I’ll still need to occasionally reboot when all other cell connection restoration steps have been tried, so this thread is still relevant.)
When the device reboots, the first container that it starts doesn’t have access to the
/dev/video0 device. I thought this was because it didn’t have enough time, but even after adding an infinite wait loop that merely checks if
/dev/video0 is available it still hangs indefinitely.
Restarting the container solves the problem. In other words, this is only an issue for the first container that’s started right after reboot.
Replicating the Problem
All you need to do to see the problem in action is reboot this test device:
I have granted support access to it. You should expect to see:
Device /dev/video0 not found Device /dev/video0 not found Device /dev/video0 not found ... Device /dev/video0 not found Device /dev/video0 not found
A potential solution is:
if "/dev/video0" is connected: run startup script else: kill and restart container
I don’t want to do this because:
- It’s not the right way to solve the problem—this isn’t happening on older OSs and I shouldn’t need to restart a container to get it to connect to a device that’s already there.
- I am trying to leave my
restart: "no"so that I can get emails when devices aren’t working and ssh into the container to debug it with its (broken) state maintained.