On Arch Linux, with systemd, the following commands are all symlinks to systemctl:
/usr/bin/telinit
/usr/bin/poweroff
/usr/bin/runlevel
/usr/bin/reboot
/usr/bin/halt
/usr/bin/shutdown
I find their behaviour with respect to authorization confusing:
$ shutdown
Must be root.
$ halt
Must be root.
$ telinit 3
# Asks for Polkit authorization
Neither poweroff nor reboot asks for authorization. poweroff doesn't actually turn off my system, the laptop remains on with text on the screen stating it is powering off - indefinitely.
I haven't tinkered with Polkit rules, so I wonder why their behaviour is so.
- All commands were tried with my non-root admin user, who's a member of
wheel. /etc/polkit-1/rules.donly seems to contain a default ruleset:# tail /etc/polkit-1/rules.d/* // DO NOT EDIT THIS FILE, it will be overwritten on update // // Default rules for polkit // // See the polkit(8) man page for more information // about configuring polkit. polkit.addAdminRule(function(action, subject) { return ["unix-group:wheel"]; });
On closer inspection, /usr/share/polkit-1/actions/org.freedesktop.login1.policy has sections for poweroff, reboot, suspend and hibernate, with allow_active set to yes. But there are no sections for shutdown. If this is the cause, why is it so?