Shutdown BBB with lithium battery backup - works in 2015 version, not in BBB IoT 2020 version.

Our BBB has a backup battery to allow for a clean shutdown when external power is removed.

We have that working fine on a “BeagleBoard.org Debian Image 2015-11-12” image.

However the BBB does not shutdown when running from a “BeagleBoard.org Debian Buster IoT Image 2020-04-06” from a fresh install.

The closest hint I found is BBB Battery shutdown - #23 by John_Syn : apparently some kernels will convert the detection of power loss into a power button press.

I have examined the setup of the 2015 image but could determine what is causing the board to shutdown when power is lost. acpid is not installed.
‘/etc/default/halt’ exists on the old system which is provided by initscripts, which was not installed. I susspose that system takes that over.

I installed acpid but that did not help (and I purged it after test). acpi_listen did not reveal events when unplugging the external power.

For information, installing ‘initscripts’ indicated:
Setting up insserv (1.18.0-2) …
insserv: FATAL: service mountkernfs has to exists for service udev
insserv: FATAL: service dnsmasq is missed in the runlevels 2 3 4 5 to use service exim4
insserv: FATAL: service urandom has to exists for service networking
insserv: FATAL: service mountdevsubfs has to exists for service hwclock

How can I have the BBB shutdown after external power (5V DC) is lost ?

I’ve now essentially set up safe_shutdown.py from https://github.com/pehrtree/beaglebone_snippets (using ‘monit’ to ensure it is running).

That works fine - the system shuts down after 10 seconds of absence of power.