Why is systemd-logind.service masked? - problems with kodi

I had a problem with following command:

# dbus-send --print-reply --system --dest=org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.CanReboot
Error org.freedesktop.systemd1.UnitMasked: Unit systemd-logind.service is masked.

I don’t use this command directly, but kodi on my rpi3 with dietpi seems to do something similar for getting info about shutdown/reboot availability. I asked at kodi-forums: https://forum.kodi.tv/showthread.php?tid=359374&pid=2998375#pid2998375

The solution was this:

# sudo systemctl unmask systemd-logind.service
Removed /etc/systemd/system/systemd-logind.service.

/etc/systemd/system/systemd-logind.service seemed to link to /dev/null before


Is this dietpi-specific (don’t think I had this with raspbian)? What’s the background of this and what’s the implication of unmasking this (what I did)?

Thanks for your help!

1 Like

Hi,

many thanks for your message. Indeed service systemd-logind is mask by default on DietPi systems. There is an option inside /boot/dietpi.txt to have it unmask during first inital setup/boot

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

Later on, you would need to use following, if the service is needed.

systemctl unmask systemd-logind.service
systemctl enable systemd-logind.service
systemctl start systemd-logind.service
1 Like

Hi,

Thanks for your answer, didn’t look in /boot/dietpi.txt (that’s quite new to me)
So the service is masked cause dietpi doesn’t need it in normal operation and this reduces resources?

correct. DietPi is starting with a minimal (diet) setup. If needed it could be unmask and started.

without systemd-logind.service what would be the preferred graceful shutdown?

poweroff?