In older days that I used to run Fluxbox, in order to be able to shutdown my computer I need to allow passwordless root access via sudo
to the command
shutdown
by running viedit
and doing the appropriate changes.
Also when the computer shutdown my computer is perfmormed over terminal via the shutdown
command, root access is needed.
But modern Desktop GUI implementations such as KDE/GNOME/LXDE/XFCE etc etc the shutdown is by default rootless (no root password is required). And I wonder how theese desktop GUIS manage to "perform"/notify the kernel that the computer is shutting down without the need of root access?
upowerd
. Alsopolicykit
plays a role here but I don't use Ubuntu on the daily bases and I know systemd replaced consolekit for example. – Arkadiusz Drabczyk Sep 23 '18 at 18:27