You are not logged in.
Recently, when I go to shutdown my system, I've been presented with a dialog box asking for my root password, "System policy prevents stopping the system when other users are logged in." When I do a $ who I seem to be logged in twice...
$ who
squeeze vc/7 2009-04-23 19:32 (:0)
squeeze pts/0 2009-04-23 19:44 (:0.0)
1) Why is my user logged in twice? (I have no ttys open nor have I su'ed to myself in an open shell).
2) How can I change the system policy to allow a shutdown in this scenario?
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
I have the same problem here.
"who" and "finger" show that I am logged in on vc/7 (X) and pts/0 (gnome-terminal) which seams quite sensible to me. Trying to reboot or shutdown the system using the gnome-menu brings up the authenticate dialog. Trying to shutdown the system from vc/1-6 if no X is running fails too (in this case "who" has only one entry). Trying to shutdown/reboot the system from gnome-terminal succeeds. The command to shutdown/reboot from console is:
#shutdown
dbus-send --system --print-reply --dest="org.freedesktop.Hal" /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Shutdown
#reboot
dbus-send --system --print-reply --dest="org.freedesktop.Hal" /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Reboot
I may possibly solve this by allowing to shutdown/restart when multiple users are logged in. The configuration is located in /usr/share/PolicyKit/policy/org.freedesktop.consolekit.policy. By adapting the following lines, shutdown/reboot works for me, but this seems to be not the very best solution to this problem.
...
<action id="org.freedesktop.consolekit.system.stop-multiple-users">
<description>Stop the system when multiple users are logged in</description>
<message>System policy prevents stopping the system when other users are logged in</message>
<defaults>
<allow_inactive>no</allow_inactive>
<!-- <allow_active>auth_admin_keep_always</allow_active> -->
<allow_active>yes</allow_active>
</defaults>
</action>
...
<action id="org.freedesktop.consolekit.system.restart-multiple-users">
<description>Restart the system when multiple users are logged in</description>
<message>System policy prevents restarting the system when other users are logged in</message>
<defaults>
<allow_inactive>no</allow_inactive>
<! -- <allow_active>auth_admin_keep_always</allow_active> -->
<allow_active>yes</allow_active>
</defaults>
</action>
...
Hopefully there is anyone who knows a better solution to this problem. A first step to a better solution might be to get a grasp of how consolekit checks for multiple users. Anyone an idea?
Offline
The same problem here. gaucho, ur fix works, but I'd rather locate the source of the problem (i.e. why am i automatically logged in a tty) than allow restarting while multiple users are logged in.
Offline
I find that mine only does this SINCE the upgrade to 2.26 broke Gnome-Do's shutdown command. When I try to use Gnome-Do to shutdown, it doesn't work. After doing that, using the regular Gnome Shutdown on the Gnome Menu causes the prompt to be shown.
Matt
"It is very difficult to educate the educated."
Offline
I have the same problem here.
"who" and "finger" show that I am logged in on vc/7 (X) and pts/0 (gnome-terminal) which seams quite sensible to me. Trying to reboot or shutdown the system using the gnome-menu brings up the authenticate dialog. Trying to shutdown the system from vc/1-6 if no X is running fails too (in this case "who" has only one entry). Trying to shutdown/reboot the system from gnome-terminal succeeds. The command to shutdown/reboot from console is:
#shutdown dbus-send --system --print-reply --dest="org.freedesktop.Hal" /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Shutdown #reboot dbus-send --system --print-reply --dest="org.freedesktop.Hal" /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Reboot
I may possibly solve this by allowing to shutdown/restart when multiple users are logged in. The configuration is located in /usr/share/PolicyKit/policy/org.freedesktop.consolekit.policy. By adapting the following lines, shutdown/reboot works for me, but this seems to be not the very best solution to this problem.
... <action id="org.freedesktop.consolekit.system.stop-multiple-users"> <description>Stop the system when multiple users are logged in</description> <message>System policy prevents stopping the system when other users are logged in</message> <defaults> <allow_inactive>no</allow_inactive> <!-- <allow_active>auth_admin_keep_always</allow_active> --> <allow_active>yes</allow_active> </defaults> </action> ... <action id="org.freedesktop.consolekit.system.restart-multiple-users"> <description>Restart the system when multiple users are logged in</description> <message>System policy prevents restarting the system when other users are logged in</message> <defaults> <allow_inactive>no</allow_inactive> <! -- <allow_active>auth_admin_keep_always</allow_active> --> <allow_active>yes</allow_active> </defaults> </action> ...
Hopefully there is anyone who knows a better solution to this problem. A first step to a better solution might be to get a grasp of how consolekit checks for multiple users. Anyone an idea?
Is there a GUI that interfaces w/ this file or just a simple text editor?
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
...I'd rather locate the source of the problem (i.e. why am i automatically logged in a tty) than allow restarting while multiple users are logged in.
Right click on a GNOME Terminal window, go to Profiles->Profile Preferences. On the "Title and Command" tab, middle of the page, you'll see an option for "Update login records when command is launched." I believe it is enabled by default, which is why opening a gnome-terminal causes a 'who' command to show multiple users logged in. Disable it and you should only see one login entry, hence shutdown without warnings.
Offline
Disabling this option in gnome-terminal makes "who" show up only the user logged in on X (vc/7) but does not solve the shutdown/reboot problem. As I've written before, I am able to shutdown/reboot from gnome-terminal using "dbus-send" command (see my first post). Shutting down from GNOME menu still does not work. Using "dbus-send" on vc/1-6 having only one user logged in and no X running doesn't work either.
Edit:
I just saw this thread: http://bbs.archlinux.org/viewtopic.php?id=70886. There are also problems on reboot. This time the policy "org.freedesktop.hal.power-management.reboot" makes the trouble. Looking at org.freedesktop.hal.power-management.* shows that there are entries for shutdown, shutdown-multiple-users, reboot and reboot-multiple-users just like there at org.freedesktop.consolekit.* . One of this two seems to be unnecessary and may probably be causing the problem.
Maybe someone who DOES NOT have the described problem may look at his policies and tell if both entries are there or not.
Edit2:
$ polkit-policy-file-validate /usr/share/PolicyKit/policy/*
WARNING: The action org.blueman.dhcp.client does not
belong in a policy file named org.blueman.policy.
A future version of PolicyKit will ignore this action.
WARNING: The action org.blueman.hal.manager does not
belong in a policy file named org.blueman.policy.
A future version of PolicyKit will ignore this action.
WARNING: The action org.blueman.network.setup does not
belong in a policy file named org.blueman.policy.
A future version of PolicyKit will ignore this action.
ERROR: org.blueman.policy did not validate
WARNING: The action org.freedesktop.consolekit.system.restart-multiple-users does not
belong in a policy file named org.freedesktop.consolekit.policy.
A future version of PolicyKit will ignore this action.
WARNING: The action org.freedesktop.consolekit.system.restart does not
belong in a policy file named org.freedesktop.consolekit.policy.
A future version of PolicyKit will ignore this action.
WARNING: The action org.freedesktop.consolekit.system.stop-multiple-users does not
belong in a policy file named org.freedesktop.consolekit.policy.
A future version of PolicyKit will ignore this action.
WARNING: The action org.freedesktop.consolekit.system.stop does not
belong in a policy file named org.freedesktop.consolekit.policy.
A future version of PolicyKit will ignore this action.
ERROR: org.freedesktop.consolekit.policy did not validate
Last edited by gaucho (2009-04-25 08:25:15)
Offline
I discovered this particular issue is a bug in the gnome-session code.
Reported upstream along with a patch, see http://bugzilla.gnome.org/show_bug.cgi?id=580259
Offline
I discovered this particular issue is a bug in the gnome-session code.
Reported upstream along with a patch, see http://bugzilla.gnome.org/show_bug.cgi?id=580259
Is this something that I can apply to my own system or someone maintaining the correct package in the arch repo can do?
Last edited by graysky (2009-04-26 10:57:28)
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
Wouldn't it be easier to punch some holes for org.freedesktop.ConsoleKit.Manager into ConsoleKit.conf?
Offline
Wouldn't it be easier to punch some holes for org.freedesktop.ConsoleKit.Manager into ConsoleKit.conf?
It is a two-line change either way. The primary author of ConsoleKit also wrote gnome-session's console kit handler, so I'll defer to him and the gnome-session maintainer on which should change.
Offline
Patching ConsoleKit.conf seems to be the recommended way. Quote from gnome-sessions NEWS file:
Depending on how D-Bus and ConsoleKit are configured on your system, you might
need the patch from https://bugs.freedesktop.org/show_bug.cgi?id=20471 for your
ConsoleKit configuration. This is required so it's possible for applications to
be able to know if there are more than one user logged in on the machine.
Patch from 20471:
diff --git a/data/ConsoleKit.conf b/data/ConsoleKit.conf
index ccbc500..8512efd 100644
--- a/data/ConsoleKit.conf
+++ b/data/ConsoleKit.conf
@@ -41,6 +41,9 @@
send_member="GetSeats"/>
<allow send_destination="org.freedesktop.ConsoleKit"
send_interface="org.freedesktop.ConsoleKit.Manager"
+ send_member="GetSessions"/>
+ <allow send_destination="org.freedesktop.ConsoleKit"
+ send_interface="org.freedesktop.ConsoleKit.Manager"
send_member="GetSessionForCookie"/>
<allow send_destination="org.freedesktop.ConsoleKit"
send_interface="org.freedesktop.ConsoleKit.Manager"
Offline
Thanks a lot!
This did the trick. GNOME is now shutting down correctly. If graysky can reproduce this, the topic seems to be SOLVED
Offline
Thanks a lot!
This did the trick. GNOME is now shutting down correctly. If graysky can reproduce this, the topic seems to be SOLVED
Did you patch ConsoleKit.conf as justusjonas suggested? If you did, do you mind walking me though the process of doing it I haven't patched anything before.
Thanks!
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
Good that there is a patch, but isn't this bug somewhat important for gnome users to require fast official upstream fix?
Offline
is it just me or is dbus/policykit almost always the source of some problem?
Offline
"is it just me or is dbus/policykit almost always the source of some problem?"
I don't know about always, but often yes!
Actually, I have a couple of simple quesions:
1. justusjonas, do you have more detailed instructions on how I apply the patch? Thank you in advance;
1. When the next update arrives, wouldn't we have to change ConsoleKit.conf back to the default value?
Thanks again!
Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd
Offline
Actually, I have a couple of simple quesions:
1. justusjonas, do you have more detailed instructions on how I apply the patch? Thank you in advance;
+1 for me. I haven't patched anything before and would really appreciate someone taking the time to outline the process.
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
+1 for me. Shutdown is a basic function that should work without patch!
Offline
Actually, now I don't think that any patch is necessary, because I booted into xfce 4.6 and it works without any problems...
The ConsoleKit is, certainly, a mystery, but it seems that the source of all problems is gnome-session. This last update came with two bugs: this and the other, related to gnome-power-manager turning off the screen every minute. It's just weird...
Edit:
"+1 for me. Shutdown is a basic function that should work without patch!"
Nothing in Linux works without patch
Last edited by Leonid.I (2009-04-29 14:50:43)
Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd
Offline
I googled around a bit for information on using diff and patch. I'm no programmer Anyway, here is what I did:
First, I pasted justusjonas' patch into an empty text file: ~/test/patch -- contents are here:
--- a/data/ConsoleKit.conf
+++ b/data/ConsoleKit.conf
@@ -41,6 +41,9 @@
send_member="GetSeats"/>
<allow send_destination="org.freedesktop.ConsoleKit"
send_interface="org.freedesktop.ConsoleKit.Manager"
+ send_member="GetSessions"/>
+ <allow send_destination="org.freedesktop.ConsoleKit"
+ send_interface="org.freedesktop.ConsoleKit.Manager"
send_member="GetSessionForCookie"/>
<allow send_destination="org.freedesktop.ConsoleKit"
send_interface="org.freedesktop.ConsoleKit.Manager"
Then I did the following:
$ cp /etc/dbus-1/system.d/ConsoleKit.conf ~/test
$ cd test
$ patch ConsoleKit.conf < patch
patching file ConsoleKit.conf
Hunk #1 FAILED at 41.
1 out of 1 hunk FAILED -- saving rejects to file ConsoleKit.conf.rej
Here is ~/test/ConsoleKit.conf.ref
***************
*** 41,46 ****
send_member="GetSeats"/>
<allow send_destination="org.freedesktop.ConsoleKit"
send_interface="org.freedesktop.ConsoleKit.Manager"
send_member="GetSessionForCookie"/>
<allow send_destination="org.freedesktop.ConsoleKit"
send_interface="org.freedesktop.ConsoleKit.Manager"
--- 41,49 ----
send_member="GetSeats"/>
<allow send_destination="org.freedesktop.ConsoleKit"
send_interface="org.freedesktop.ConsoleKit.Manager"
+ send_member="GetSessions"/>
+ <allow send_destination="org.freedesktop.ConsoleKit"
+ send_interface="org.freedesktop.ConsoleKit.Manager"
send_member="GetSessionForCookie"/>
<allow send_destination="org.freedesktop.ConsoleKit"
send_interface="org.freedesktop.ConsoleKit.Manager"
Can someone explain to me what's going wrong and how to fix it? I'd love to resolve my gnome authentication problem on restart/shutdown.
Thanks!
Last edited by graysky (2009-04-29 19:57:26)
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
Sorry for the late answer.
I changed my ConsoleKit.conf (/etc/dbus-1/system.d/ConsoleKit.conf) to allow GetSessions like this:
...
<allow send_interface="org.freedesktop.ConsoleKit.Manager"
send_member="GetSeats"/>
<allow send_interface="org.freedesktop.ConsoleKit.Manager"
send_member="GetSessions"/>
<allow send_interface="org.freedesktop.ConsoleKit.Manager"
send_member="GetSessionForCookie"/>
...
Last edited by gaucho (2009-04-30 12:33:37)
Offline
@gaucho - mine already had that modification without me doing anything to it. Here is the file in its entirety, can you post yours?
<!DOCTYPE busconfig PUBLIC
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<!-- Only root can own the service -->
<policy user="root">
<allow own="org.freedesktop.ConsoleKit"/>
<!-- Allow all methods on interfaces -->
<allow send_interface="org.freedesktop.ConsoleKit.Manager"/>
<allow send_interface="org.freedesktop.ConsoleKit.Seat"/>
<allow send_interface="org.freedesktop.ConsoleKit.Session"/>
</policy>
<!-- Deny all and then allow some methods on interfaces -->
<policy context="default">
<deny send_interface="org.freedesktop.ConsoleKit.Manager"/>
<deny send_interface="org.freedesktop.ConsoleKit.Seat"/>
<deny send_interface="org.freedesktop.ConsoleKit.Session"/>
<deny send_destination="org.freedesktop.ConsoleKit"
send_interface="org.freedesktop.DBus.Properties" />
<allow send_interface="org.freedesktop.ConsoleKit.Manager"
send_member="Restart"/>
<allow send_interface="org.freedesktop.ConsoleKit.Manager"
send_member="Stop"/>
<allow send_interface="org.freedesktop.ConsoleKit.Manager"
send_member="OpenSession"/>
<allow send_interface="org.freedesktop.ConsoleKit.Manager"
send_member="CloseSession"/>
<allow send_interface="org.freedesktop.ConsoleKit.Manager"
send_member="GetSeats"/>
<allow send_interface="org.freedesktop.ConsoleKit.Manager"
send_member="GetSessions"/>
<allow send_interface="org.freedesktop.ConsoleKit.Manager"
send_member="GetSessionForCookie"/>
<allow send_interface="org.freedesktop.ConsoleKit.Manager"
send_member="GetSeats"/>
<allow send_interface="org.freedesktop.ConsoleKit.Manager"
send_member="GetSessionForCookie"/>
<allow send_interface="org.freedesktop.ConsoleKit.Manager"
send_member="GetSessionForUnixProcess"/>
<allow send_interface="org.freedesktop.ConsoleKit.Manager"
send_member="GetCurrentSession"/>
<allow send_interface="org.freedesktop.ConsoleKit.Manager"
send_member="GetSessionsForUnixUser"/>
<allow send_interface="org.freedesktop.ConsoleKit.Manager"
send_member="GetSessionsForUser"/>
<allow send_interface="org.freedesktop.ConsoleKit.Manager"
send_member="GetSystemIdleHint"/>
<allow send_interface="org.freedesktop.ConsoleKit.Manager"
send_member="GetSystemIdleSinceHint"/>
<allow send_interface="org.freedesktop.ConsoleKit.Seat"
send_member="GetId"/>
<allow send_interface="org.freedesktop.ConsoleKit.Seat"
send_member="GetSessions"/>
<allow send_interface="org.freedesktop.ConsoleKit.Seat"
send_member="GetDevices"/>
<allow send_interface="org.freedesktop.ConsoleKit.Seat"
send_member="GetActiveSession"/>
<allow send_interface="org.freedesktop.ConsoleKit.Seat"
send_member="CanActivateSessions"/>
<allow send_interface="org.freedesktop.ConsoleKit.Seat"
send_member="ActivateSession"/>
<allow send_interface="org.freedesktop.ConsoleKit.Session"
send_member="GetId"/>
<allow send_interface="org.freedesktop.ConsoleKit.Session"
send_member="GetSeatId"/>
<allow send_interface="org.freedesktop.ConsoleKit.Session"
send_member="GetLoginSessionId"/>
<allow send_interface="org.freedesktop.ConsoleKit.Session"
send_member="GetSessionType"/>
<allow send_interface="org.freedesktop.ConsoleKit.Session"
send_member="GetUser"/>
<allow send_interface="org.freedesktop.ConsoleKit.Session"
send_member="GetUnixUser"/>
<allow send_interface="org.freedesktop.ConsoleKit.Session"
send_member="GetX11Display"/>
<allow send_interface="org.freedesktop.ConsoleKit.Session"
send_member="GetX11DisplayDevice"/>
<allow send_interface="org.freedesktop.ConsoleKit.Session"
send_member="GetDisplayDevice"/>
<allow send_interface="org.freedesktop.ConsoleKit.Session"
send_member="GetRemoteHostName"/>
<allow send_interface="org.freedesktop.ConsoleKit.Session"
send_member="IsActive"/>
<allow send_interface="org.freedesktop.ConsoleKit.Session"
send_member="IsLocal"/>
<allow send_interface="org.freedesktop.ConsoleKit.Session"
send_member="GetCreationTime"/>
<allow send_interface="org.freedesktop.ConsoleKit.Session"
send_member="Activate"/>
<allow send_interface="org.freedesktop.ConsoleKit.Session"
send_member="GetIdleHint"/>
<allow send_interface="org.freedesktop.ConsoleKit.Session"
send_member="GetIdleSinceHint"/>
</policy>
</busconfig>
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
Thank you all, it seems to have solved my problem too. To apply the patch in the cleanest way, you should use abs. See the wiki for the details. Briefly, install abs, edit /etc/abs.conf to include extra. run abs as root. Create a directory in your $HOME
pacman -S abs
nano /etc/abs.conf
sudo abs
cd
mkdir -p ~/abs/extra
cp -r /var/abs/extra/consolekit ~/abs/extra
cd ~/abs/extra
then add the patch in this directory
filename: ~/abs/extra/gnome-logout-0.3.0.patch
diff -ur ConsoleKit-0.3.0/data/ConsoleKit.conf ConsoleKit-ted/data/ConsoleKit.conf
--- ConsoleKit-0.3.0/data/ConsoleKit.conf 2008-04-19 00:39:49.000000000 -0500
+++ ConsoleKit-ted/data/ConsoleKit.conf 2009-03-04 13:57:57.000000000 -0600
@@ -32,6 +32,8 @@
<allow send_interface="org.freedesktop.ConsoleKit.Manager"
send_member="GetSeats"/>
<allow send_interface="org.freedesktop.ConsoleKit.Manager"
+ send_member="GetSessions"/>
+ <allow send_interface="org.freedesktop.ConsoleKit.Manager"
send_member="GetSessionForCookie"/>
<allow send_interface="org.freedesktop.ConsoleKit.Manager"
send_member="GetSessionForUnixProcess"/>
(I just copy-pasted it from the bug, it is the first one, the second applies to the git version; not the current one in arch)
and edit the PKGBUILD file by adding the line
# Apply patch for bug https://bugs.freedesktop.org/show_bug.cgi?id=20471
patch -Np1 -i $startdir/gnome-logout-${pkgver}.patch || return 1
between the configure lines and the make lines, it should look like
# $Id: PKGBUILD 19095 2008-11-14 21:47:10Z jgc $
# Maintainer: Jan de Groot <jgc@archlinux.org>
# Contributor: onestep_ua <onestep@ukr.net>
pkgname=consolekit
pkgver=0.3.0
pkgrel=3_ml1
pkgdesc="A framework for defining and tracking users, login sessions, and seats"
arch=('i686' 'x86_64')
url="http://www.freedesktop.org/wiki/Software/ConsoleKit"
license=('GPL')
depends=('dbus-glib>=0.76' 'glib2>=2.18.2' 'policykit>=0.9' 'zlib')
makedepends=('pkgconfig')
options=(!libtool)
source=(http://people.freedesktop.org/~mccann/dist/ConsoleKit-${pkgver}.tar.bz2
pam-foreground-compat.ck)
md5sums=('43b02a52212330b54cfb34c4044d9ce0' 'a8a4de71d9b0549b8143e5f6c2a36fc7')
build() {
cd "${srcdir}/ConsoleKit-${pkgver}"
./configure --prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--libexecdir=/usr/lib/ConsoleKit \
--enable-pam-module || return 1
# Apply patch for bug https://bugs.freedesktop.org/show_bug.cgi?id=20471
patch -Np1 -i $startdir/gnome-logout-${pkgver}.patch || return 1
make || return 1
make DESTDIR="${pkgdir}" install || return 1
install -m755 "${srcdir}/pam-foreground-compat.ck" "${pkgdir}/usr/lib/ConsoleKit/run-session.d/" || return 1
}
Also change pkgrel to remember it has been patched when you upgrade. I set mine to 3_ml1 because ml are my initials and it is the first patch I apply to this package.
Then compile and install.
makepkg -s
sudo pacman -U consolekit-0.3.0-3_ml1-i686.pkg.tar.gz
no sudo with makepkg but sudo with pacman.
Of course, this is a bit overkill to patch a config file, but it is the cleanest way as you will see that from its name that consolekit has been patched when you upgrade, so if it is still broken, you will know what to do. Moreover, it is not that difficult, only a file to create from copy-pasting a patch and one line toedit.
Offline
Synss, it didn't help me...
Offline