! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
when shutting down (via HAL) fails an empty dialog box is shown
Status:
RESOLVED: FIXED
Product:
Xfce4-session
Component:
General

Comments

Description Oliver Lehmann 2008-11-20 18:15:28 CET
When the HAL shutdown/reboot fails

** (xfce4-session:1896): WARNING **: xfsm-shutdown-helper.c:234: Failed
to contact HAL: org.freedesktop.hal.power-management.shutdown no <--
(action, result)

an empty message box with just a STOP-sign is shown. The following error message appears on console while message box is displayed:

(xfce4-session:1896): Gtk-WARNING **: Failed to set text from markup due
to error parsing markup: Error on line 3 char 52: '-' is not a valid
character following a '<' character; it may not begin an element name


The code responsible for it is probably at the end of shutdown.c:

  result = xfsm_shutdown_helper_send_command (shutdown_helper, type, &error);
  xfsm_shutdown_helper_destroy (shutdown_helper);
  shutdown_helper = NULL;

  if (!result)
    {
      xfce_message_dialog (NULL, _("Shutdown Failed"),
                           GTK_STOCK_DIALOG_ERROR,
                           _("Unable to perform shutdown"),
                           error->message,
                           GTK_STOCK_QUIT, GTK_RESPONSE_ACCEPT,
                           NULL);
      g_error_free (error);
      return EXIT_FAILURE;
    }

result is false and I guess error->message contains the error message printed on HAL failure "<-- (action,result)"...
Comment 1 David Mohr 2008-11-20 18:21:21 CET
Brian,
should the error->message be escaped with g_markup_escape_text () ?
Comment 2 Brian J. Tarricone (not reading bugmail) 2008-11-20 19:22:00 CET
Well, it shouldn't be in the sense that I consider it a bug that a GError ends up with text in it that needs to be escaped.  Sigh.  But I guess that's the only solution.

Though that doesn't solve Oliver's actual problem with shutting down -- I have no idea what that error message means.

I'm also not sure why the error includes the string "org.freedesktop.hal.power-management.shutdown"...  the correct method name is "org.freedesktop.Hal.PowerManagement.Shutdown".
Comment 3 Oliver Lehmann 2008-11-20 19:30:40 CET
as already stated on the ml it might be a problem of PolicyKit

olivleh1@kartoffel olivleh1> dbus-send --system --dest=org.freedesktop.Hal --type=method_call --print-reply /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Reboot
Error org.freedesktop.Hal.Device.PermissionDeniedByPolicy: org.freedesktop.hal.power-management.reboot no <-- (action, result)
Exit 1


when adding

    <match user="myuser">     
        <return result="yes"/>
    </match>                

dbus-send makes my system reboot.

But I thought, that <define_admin_auth group="wheel"/> is enough in PolicyKit.conf to grant me the needed permissions to reboot my system.
It might be a hal/polkit/dbus problem but I fear the users writing me as the FreeBSD port maintainer tons of mails complaining they can't reboot/shutdown
their systems and I've to tell them to adjust their PolicyKit.conf....

isn't there an easier solution?
Comment 4 Brian J. Tarricone (not reading bugmail) 2008-11-20 19:45:03 CET
I don't know.  I've never used PK and I don't particularly care about it.
Comment 5 Oliver Lehmann 2008-11-20 19:51:57 CET
OK - on FreeBSD - hal gets installed together with policykit support unconditionally everytime. But I see - not your problem either.
Comment 6 Brian J. Tarricone (not reading bugmail) 2008-11-28 06:16:18 CET
Pretty sure nick fixed this in xfce_message_dialog() in libxfcegui4.

Bug #4636

Reported by:
Oliver Lehmann
Reported on: 2008-11-20
Last modified on: 2009-07-14

People

Assignee:
Brian J. Tarricone (not reading bugmail)
CC List:
1 user

Version

Version:
4.5.92 (4.6 beta 2)

Attachments

Additional information