Re: [Sugar-devel] [PATCH] use ConsoleKit instead of HAL for shutdown/reboot

2010-04-25 Thread James Cameron
On Sun, Apr 25, 2010 at 11:46:41AM -0400, Bernie Innocenti wrote:
> As we're there, how do we get rid of the useless UL screen with its ugly
> inverted color scheme?

For OLPC builds we'd need a product safety review to remove it.  ;-)

For deployment builds, you could hide /usr/sbin/ul-warning ... I've
tested this and the result is that X goes away, the text console
displays a few messages from init, and then the power goes off.  Is that
the behaviour you need?

-- 
James Cameron
http://quozl.linux.org.au/
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] use ConsoleKit instead of HAL for shutdown/reboot

2010-04-25 Thread Paul Fox
bernie wrote:
 > On Wed, 2010-04-21 at 10:32 +1000, James Cameron wrote:
 > 
 > > However, I've just applied the patch on os119 on XO-1.5, restarted Sugar
 > > and tested Restart and Shutdown options, and they function correctly.
 > > Restart causes a UL screen and reboot.  Shutdown causes a UL screen and
 > > power off.
 > 
 > As we're there, how do we get rid of the useless UL screen with its ugly
 > inverted color scheme?

i believe the UL screen is mandated, but i don't know the details.  i.e.,
we may not have a choice.

paul
=-
 paul fox, p...@laptop.org
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] use ConsoleKit instead of HAL for shutdown/reboot

2010-04-25 Thread Bernie Innocenti
On Wed, 2010-04-21 at 10:32 +1000, James Cameron wrote:

> However, I've just applied the patch on os119 on XO-1.5, restarted Sugar
> and tested Restart and Shutdown options, and they function correctly.
> Restart causes a UL screen and reboot.  Shutdown causes a UL screen and
> power off.

As we're there, how do we get rid of the useless UL screen with its ugly
inverted color scheme?

Moreover, the UL screen fights with powerd's pretty shutdown screens.

-- 
   // Bernie Innocenti - http://codewiz.org/
 \X/  Sugar Labs   - http://sugarlabs.org/

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] use ConsoleKit instead of HAL for shutdown/reboot

2010-04-21 Thread Daniel Drake
On 21 April 2010 19:07, James Cameron  wrote:
> On Wed, Apr 21, 2010 at 10:17:14AM +0200, Sascha Silbe wrote:
>> Since I've run into the same issue before (i.e. with HAL), I suppose
>> the default is the same but the OLPC builds explicitly configure HAL
>> to allow shutdowns even for multiple sessions?
>
> I've looked and not found where this might occur.

See PolicyKit-olpc

Daniel
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [PATCH] use ConsoleKit instead of HAL for shutdown/reboot

2010-04-21 Thread Michael Stone
Sascha wrote:

> HAL is dead, ConsoleKit now handles shutdown / reboot.

I still prefer the "/sbin/shutdown" approach taken in sl#615 to the D-Bus based
mechanisms that Tomeu prefers but I am concerned that this may be an area of
irreconcilable difference between Tomeu and myself. Therefore, in the interests
of momentum, let's merge your patch and move on. It's easy to change in the
future if the communual opinion on ConsoleKit shifts.

Regards,

Michael
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] use ConsoleKit instead of HAL for shutdown/reboot

2010-04-21 Thread James Cameron
On Wed, Apr 21, 2010 at 10:17:14AM +0200, Sascha Silbe wrote:
> Since I've run into the same issue before (i.e. with HAL), I suppose
> the default is the same but the OLPC builds explicitly configure HAL
> to allow shutdowns even for multiple sessions?

I've looked and not found where this might occur.

-- 
James Cameron
http://quozl.linux.org.au/
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] use ConsoleKit instead of HAL for shutdown/reboot

2010-04-21 Thread James Cameron
On Wed, Apr 21, 2010 at 10:12:43AM +0100, Peter Robinson wrote:
> I thought the point of these patches was to move from HAL to
> ConsoleKit so surely it should work whether HAL is there or not
> especially with everyone moving away from HAL to
> ConsoleKit/upower/udisk/udev etc/

The failure was unrelated to HAL being missing.  It was ConsoleKit
permissions.

I did try without HAL started, but keyboard and touchpad failed to work,
so I couldn't shutdown using the Sugar menu.

-- 
James Cameron
http://quozl.linux.org.au/
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] use ConsoleKit instead of HAL for shutdown/reboot

2010-04-21 Thread Jonas Smedegaard

On Wed, Apr 21, 2010 at 10:12:43AM +0100, Peter Robinson wrote:

On Wed, Apr 21, 2010 at 1:32 AM, James Cameron  wrote:

On Tue, Apr 20, 2010 at 07:55:45PM -0400, Chris Ball wrote:


Now, if one also stops HAL, the shutdown or restart options don't 
work, and shell.log says:


I thought the point of these patches was to move from HAL to
ConsoleKit so surely it should work whether HAL is there or not
especially with everyone moving away from HAL to
ConsoleKit/upower/udisk/udev etc/


I do not know those mechanisms intimately, but can easily imagine that 
on some (versions of some) systems the transition has not completed yet 
so that *other* parts of the chain fail if HAL is unavailable.



Regards,

  - Jonas

--
* Jonas Smedegaard - idealist & Internet-arkitekt
* Tlf.: +45 40843136  Website: http://dr.jones.dk/

  [x] quote me freely  [ ] ask before reusing  [ ] keep private


signature.asc
Description: Digital signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] use ConsoleKit instead of HAL for shutdown/reboot

2010-04-21 Thread Peter Robinson
On Wed, Apr 21, 2010 at 1:32 AM, James Cameron  wrote:
> On Tue, Apr 20, 2010 at 07:55:45PM -0400, Chris Ball wrote:
>> Hi James/Sascha,
>>    > Reviewed-by: James Cameron 
>> Did you test on XO-1 or XO-1.5?  I'm curious how much of a backwards-
>> compatibility break this is.
>
> No, I only did a code review and cross-check against ConsoleKit API
> documentation.
>
> However, I've just applied the patch on os119 on XO-1.5, restarted Sugar
> and tested Restart and Shutdown options, and they function correctly.
> Restart causes a UL screen and reboot.  Shutdown causes a UL screen and
> power off.
>
> Tested-by: James Cameron 
>
> Now, if one also stops HAL, the shutdown or restart options don't work,
> and shell.log says:

I thought the point of these patches was to move from HAL to
ConsoleKit so surely it should work whether HAL is there or not
especially with everyone moving away from HAL to
ConsoleKit/upower/udisk/udev etc/

Peter
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] use ConsoleKit instead of HAL for shutdown/reboot

2010-04-21 Thread Sascha Silbe

On Tue, Apr 20, 2010 at 07:55:45PM -0400, Chris Ball wrote:


Hi James/Sascha,

Did you test on XO-1 or XO-1.5?  I'm curious how much of a backwards-
compatibility break this is.
While the actual patch was only tested on XO-1, I tried out the 
ConsoleKit API on XO-1.5 first.
Both times Debian squeeze but since you only mentioned the name of the 
hardware I suppose this is exactly what you wanted to know. ;)


CU Sascha

--
http://sascha.silbe.org/
http://www.infra-silbe.de/

signature.asc
Description: Digital signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] use ConsoleKit instead of HAL for shutdown/reboot

2010-04-21 Thread Sascha Silbe

On Wed, Apr 21, 2010 at 01:18:53PM +1000, James Cameron wrote:

dbus.exceptions.DBusException: 
org.freedesktop.ConsoleKit.Manager.NotPrivileged: Not privileged for 
action: org.freedesktop.consolekit.system.restart-multiple-users 
auth_admin_keep_always
After the patch is applied, Sugar's shutdown and restart options fail 
if

there are multiple logged in users; via SSH or text console.
Just digged around a bit; while both ConsoleKit and HAL go through 
PolicyKit for "authentication", the names of the configuration variables 
differ.
Since I've run into the same issue before (i.e. with HAL), I suppose the 
default is the same but the OLPC builds explicitly configure HAL to 
allow shutdowns even for multiple sessions?


CU Sascha

--
http://sascha.silbe.org/
http://www.infra-silbe.de/

signature.asc
Description: Digital signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] use ConsoleKit instead of HAL for shutdown/reboot

2010-04-20 Thread James Cameron
On Wed, Apr 21, 2010 at 10:32:28AM +1000, James Cameron wrote:
> dbus.exceptions.DBusException: 
> org.freedesktop.ConsoleKit.Manager.NotPrivileged: Not privileged for action: 
> org.freedesktop.consolekit.system.restart-multiple-users 
> auth_admin_keep_always

After the patch is applied, Sugar's shutdown and restart options fail if
there are multiple logged in users; via SSH or text console.  It didn't
have anything to do with HAL being stopped, my mistake earlier.

-- 
James Cameron
http://quozl.linux.org.au/
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] use ConsoleKit instead of HAL for shutdown/reboot

2010-04-20 Thread Paul Fox
james wrote:
 > On Tue, Apr 20, 2010 at 08:37:54PM -0400, Paul Fox wrote:
 > > so, can someone tell me (gently) why either of these techniques
 > > is better than simply invoking /bin/reboot or /bin/shutdown? 
 > > (other than the fact that those will work even if hal isn't
 > > running?)
 > 
 > Lets Sugar hop the privilege barrier in a controlled fashion.  We could
 > work around that entirely by blessing /bin/reboot or /bin/shutdown with
 > setuid.  ;-}

doh.  thank you.  that was very gentle.  :-)

paul
permissions?  what permissions?
=-
 paul fox, p...@laptop.org
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] use ConsoleKit instead of HAL for shutdown/reboot

2010-04-20 Thread James Cameron
On Tue, Apr 20, 2010 at 08:37:54PM -0400, Paul Fox wrote:
> so, can someone tell me (gently) why either of these techniques
> is better than simply invoking /bin/reboot or /bin/shutdown? 
> (other than the fact that those will work even if hal isn't
> running?)

Lets Sugar hop the privilege barrier in a controlled fashion.  We could
work around that entirely by blessing /bin/reboot or /bin/shutdown with
setuid.  ;-}

-- 
James Cameron
http://quozl.linux.org.au/
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] use ConsoleKit instead of HAL for shutdown/reboot

2010-04-20 Thread Paul Fox
james wrote:
 > On Tue, Apr 20, 2010 at 07:55:45PM -0400, Chris Ball wrote:
 > > Hi James/Sascha,
 > >> Reviewed-by: James Cameron 
 > > Did you test on XO-1 or XO-1.5?  I'm curious how much of a backwards-
 > > compatibility break this is.
 > 
 > No, I only did a code review and cross-check against ConsoleKit API
 > documentation.
 > 
 > However, I've just applied the patch on os119 on XO-1.5, restarted Sugar
 > and tested Restart and Shutdown options, and they function correctly.
 > Restart causes a UL screen and reboot.  Shutdown causes a UL screen and
 > power off.

so, can someone tell me (gently) why either of these techniques
is better than simply invoking /bin/reboot or /bin/shutdown? 
(other than the fact that those will work even if hal isn't
running?)

paul

 > 
 > Tested-by: James Cameron 
 > 
 > Now, if one also stops HAL, the shutdown or restart options don't work,
 > and shell.log says:
 > 
 > Traceback (most recent call last):
 >   File "/usr/lib/python2.6/site-packages/sugar/session.py", line 50, in 
 > __shutdown_completed_cb
 > self.shutdown_completed()
 >   File "/usr/lib/python2.6/site-packages/jarabe/model/session.py", line 64, 
 > in 
 > shutdown_completed
 > pm.Restart()
 >   File "/usr/lib/python2.6/site-packages/dbus/proxies.py", line 68, in 
 > __call__
 > return self._proxy_method(*args, **keywords)
 >   File "/usr/lib/python2.6/site-packages/dbus/proxies.py", line 140, in 
 > __call__
 > **keywords)
 >   File "/usr/lib/python2.6/site-packages/dbus/connection.py", line 630, in 
 > call_blocking
 > message, timeout)
 > dbus.exceptions.DBusException: 
 > org.freedesktop.ConsoleKit.Manager.NotPrivileged: Not privileged for action: 
 > org.freedesktop.consolekit.system.restart-multiple-users 
 > auth_admin_keep_always
 > 
 > -- 
 > James Cameron
 > http://quozl.linux.org.au/
 > ___
 > Sugar-devel mailing list
 > Sugar-devel@lists.sugarlabs.org
 > http://lists.sugarlabs.org/listinfo/sugar-devel

=-
 paul fox, p...@laptop.org
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] use ConsoleKit instead of HAL for shutdown/reboot

2010-04-20 Thread James Cameron
On Tue, Apr 20, 2010 at 07:55:45PM -0400, Chris Ball wrote:
> Hi James/Sascha,
>> Reviewed-by: James Cameron 
> Did you test on XO-1 or XO-1.5?  I'm curious how much of a backwards-
> compatibility break this is.

No, I only did a code review and cross-check against ConsoleKit API
documentation.

However, I've just applied the patch on os119 on XO-1.5, restarted Sugar
and tested Restart and Shutdown options, and they function correctly.
Restart causes a UL screen and reboot.  Shutdown causes a UL screen and
power off.

Tested-by: James Cameron 

Now, if one also stops HAL, the shutdown or restart options don't work,
and shell.log says:

Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/sugar/session.py", line 50, in 
__shutdown_completed_cb
self.shutdown_completed()
  File "/usr/lib/python2.6/site-packages/jarabe/model/session.py", line 64, in 
shutdown_completed
pm.Restart()
  File "/usr/lib/python2.6/site-packages/dbus/proxies.py", line 68, in __call__
return self._proxy_method(*args, **keywords)
  File "/usr/lib/python2.6/site-packages/dbus/proxies.py", line 140, in __call__
**keywords)
  File "/usr/lib/python2.6/site-packages/dbus/connection.py", line 630, in 
call_blocking
message, timeout)
dbus.exceptions.DBusException: 
org.freedesktop.ConsoleKit.Manager.NotPrivileged: Not privileged for action: 
org.freedesktop.consolekit.system.restart-multiple-users auth_admin_keep_always

-- 
James Cameron
http://quozl.linux.org.au/
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] use ConsoleKit instead of HAL for shutdown/reboot

2010-04-20 Thread Chris Ball
Hi James/Sascha,

   > Reviewed-by: James Cameron 

Did you test on XO-1 or XO-1.5?  I'm curious how much of a backwards-
compatibility break this is.

- Chris.
-- 
Chris Ball   
One Laptop Per Child
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] use ConsoleKit instead of HAL for shutdown/reboot

2010-04-20 Thread James Cameron
Reviewed-by: James Cameron 

-- 
James Cameron
http://quozl.linux.org.au/
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [PATCH] use ConsoleKit instead of HAL for shutdown/reboot

2010-04-20 Thread Sascha Silbe
HAL is dead, ConsoleKit now handles shutdown / reboot.

Shutdown tested on Debian squeeze with consolekit 0.4.1-4.
Reboot mode cannot be triggered by UI in Sugar 0.88, so not tested.

Signed-off-by: Sascha Silbe 

---
 src/jarabe/model/session.py |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/jarabe/model/session.py b/src/jarabe/model/session.py
index 9e0f087..e7b70cd 100644
--- a/src/jarabe/model/session.py
+++ b/src/jarabe/model/session.py
@@ -53,15 +53,15 @@ class SessionManager(session.SessionManager):
 elif self._logout_mode != self.MODE_LOGOUT:
 try:
 bus = dbus.SystemBus()
-proxy = bus.get_object('org.freedesktop.Hal',
-   '/org/freedesktop/Hal/devices/computer')
+proxy = bus.get_object('org.freedesktop.ConsoleKit',
+   '/org/freedesktop/ConsoleKit/Manager')
 pm = dbus.Interface(proxy,
-
'org.freedesktop.Hal.Device.SystemPowerManagement')
+'org.freedesktop.ConsoleKit.Manager')
 
 if self._logout_mode == self.MODE_SHUTDOWN:
-pm.Shutdown()
+pm.Stop()
 elif self._logout_mode == self.MODE_REBOOT:
-pm.Reboot()
+pm.Restart()
 except:
 logging.exception('Can not stop sugar')
 self.session.cancel_shutdown()
-- 
tg: (ae04835..) t/ck-shutdown (depends on: upstream/master)
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel