0

When logged in to a virtual shell as an unprivileged user and try to shutdown, reboot, init 0 or init 6 don't work. But if you're running a desktop environment, you can easily select its shutdown functionality. Why is that?

bot47
  • 1,268

1 Answers1

0

Correct Answer

This is taken from Thomas Nyman answer in the comments and updated for anyone seeking correct answer:

In freedesktop.org-compliant systems there's a login manager daemon, such as the ConsoleKit daemon or systemd-logind responsible for performing the shutdown. The policy regarding which processes are allowed to communicate with the login manager on the system message bus is handled by Polkit. This applies also for desktop managers, such as GDM or LightDM.

The GNOME Power Manager does not provide the functionality for shutting down the system. It communicates over DBus with the UPower daemon. While the principle is the same as with the login manager, with Polkit mediating access, UPower is only responsible for suspend and hibernate, not shutdown or restart.

Incorrect Answer

This was originally posted and accepted, but is sadly incorrect. It depends on the environment. Some desktop environments usually have Desktop Manager (GDM, LightDM etc.) which lets you login, lock screen sometimes even switch sessions. Power management features usually coupled together with a DM as it is started with system privileges.

There also might be some other ways of accomplishing . For example Gnome uses Gnome Power Manager (https://projects.gnome.org/gnome-power-manager/) which is started during session.

All in all, not all parts of your Window Manager are running as an unprivileged user.

ek9
  • 2,905