Found a bug - looking for suggestions

A project log for Easy RasPi configuration

Allow customers to easily configure your RasPi product.

Peter WalshPeter Walsh 11/30/2020 at 17:390 Comments

I found a bug in the way AppDaemon responds to program exit.

Normally the AppDaemon will reboot the system if the user App exits. This is by design, to keep the application running because most problems can be fixed with a reboot.

The reboot is cancelled if a user is logged in to the system, also by design. The idea is that that user is probably debugging the system or otherwise engaged, and you don't want to boot users from the system anyway.

This works well for the command-line version of Raspbian: by default no users are logged in, and logged-in users are shown on the "users" command. The default GUI version automatically logs in the pi user, so the "users" command shows users logged in even if no one is on the system. This means that the AppDaemon won't reboot the system if the user App fails.

I could change the system to not reboot if an SSH user is logged in. That would boot GUI users of the user App fails, but that's probably OK because if you're debugging the system through an attached display and KB you should disable the AppDaemon anyway.

If I don't change anything, the default GUI system will never reboot the system when the app fails. OTOH that might be OK because the user really shouldn't be automatically logging in the user.

Any suggestions?