Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I found the following command line to shut down a Debian/GNU Linux system

dbus-send \
  --system \
  --dest=org.freedesktop.ConsoleKit \
  --type=method_call \
  --print-reply \
  --reply-timeout=2000 \
  /org/freedesktop/ConsoleKit/Manager \
  org.freedesktop.ConsoleKit.Manager.Stop

It works if I execute the command as superuser, but as a non-privileged user it says:

Error org.freedesktop.ConsoleKit.Manager.NotPrivileged: Not Authorized

I would like to know if it is possible to modify such a command in such a way that, interacting with PolicyKit, it can grant the privilege to shut down the system to a normal user.

share|improve this question
    
What is your consolekit version? This Debian bug report suggests that an upstream change between versions 0.4.1 and 0.4.2 caused this, but no official solution exists yet. You can read the bug report and see if any of the suggestions work for you. –  jw013 Jan 21 '12 at 16:34
    
@jw013: solved installing lightdm. Turn your comment into an answer and I will accept it. –  enzotib Jan 21 '12 at 17:45
add comment

2 Answers 2

up vote 2 down vote accepted

According to this Debian bug report, this is due to an upstream change in ConsoleKit between versions 0.4.1 and 0.4.2. The thread contains a few suggestions and workarounds, one of which is to install a display manager (like GDM or lightdm) that talks with ConsoleKit directly.

share|improve this answer
add comment

If you use consolekit > 0.4.1 (wheezy and newer) this doesn't work any more out of the box. To get it working again add

session optional        pam_loginuid.so

to /etc/pam.d/common-session.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.