[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Pkg-xfce-devel] Bug#648604: There is a bug on my previous patch



It seems my aproach was wrong as when somebody logs on a console or remotely
it will get well logged in and thus pinky will show him and not return an
empty string like I was thinking it would output, here is what this machine
was showing when used on X and accessed as well from ssh:

manty at bat:~$ ck-history --last-compat|grep still
manty    tty7         :0               Mon Nov 28 23:53   still logged in
manty at bat:~$ w
 21:11:06 up 1 day, 14:53,  1 user,  load average: 0,05, 0,06, 0,05
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
manty    pts/4    dis.alpha.red    20:28    3:56   0.02s  0.02s -bash
manty at bat:~$

This is the normal output one would expect from pinky on a normal machine
(running gdm instead of lightdm):

manty at can:~$ pinky -fw
root     *tty2            2011-11-29 21:04
anahi    *tty7     6d     2011-11-23 03:46 :0
manty    *tty8     6d     2011-11-29 21:04 :20
manty     pts/0           2011-11-29 21:02 dis.alpha.red

as you can see there were two X users, root was on console (tty2) and I was
accessing it from ssh as well.

Here is a reworked patch, it is against the original power-funcs, this time
I'll trust ck-history if we have it available and if not I'll go with pinky.

--- power-funcs	2011-03-23 20:28:30.000000000 +0100
+++ /usr/share/acpi-support/power-funcs	2011-11-29 21:33:37.698289267 +0100
@@ -16,7 +16,11 @@
 getXuser() {
 	local plist user l lastpp ds startx pid userhome
 
-	plist=$(pinky -fw) || pwf_error "pinky lost"
+	if [ -x /usr/bin/ck-history ] then 
+		plist=$(ck-history --last-compat|sed -n "s/\([^:]*:[^ ]*\).*still logged in[ ]*/\1/p")
+	else
+		plist=$(pinky -fw) || pwf_error "pinky lost"
+	fi
 	user=
 	while read l; do
 		set -- $l


Regards...
-- 
Manty/BestiaTester -> http://manty.net






Reply to: