DietPi v6.28.0, RPi Zero W, gpio-shutdown not working

I have just done a new install of DietPi v6.28.0 on a RPi Zero W.
After the updates and setup etc, I added the following line to config.txt (ie sudo nano /DietPi/config.txt):-


After a reboot, pressing the button that I have connected to GPIO20 and GND, nothing happens.
I am using GPIO20 because I require I2C and I2C uses GPIO2 and GPIO3.

I am using the same method of shutdown on a RPi3 that has been upgraded a couple of times to DietPi v6.28.0 (cannot remember which version it started out on) and it works as designed.

Could someone suggest where I should start looking as to why this is not working?


OK. It’s been a while but I have found the solution.
Apparently systemd-logind is masked and blocks the detection of a shutdown signal.

more info in this page:-

The way to fix the problem is to:-
1 - Change the following line in dietpi.txt before first boot.

Unmask (enable) systemd-logind service (including dbus), which is masked by default on DietPi



2 - If you have completed installation, do the following commands:-

sudo apt install dbus
sudo systemctl unmask systemd-logind
sudo systemctl start systemd-logind

I hope this helps someone out.