Xfce Forum

Sub domains
 

You are not logged in.

#1 2017-05-08 11:53:39

ctac
Member
Registered: 2017-05-08
Posts: 57

Action Button Shutdown & Restart

Hi,
Hi,
After install of xfce4.12 on OpenBSD, I have no access to Action Buttons for shutdown and restart.
So, I install consolekit and it's OK.
I find consolekit use action and rule with polkit.
In action defined to polkit, there is one from xfce named org.xfce.session.policy.
The description is Shutdown, restart, suspend, or hibernate the system.
The exec.path is /usr/local/lib/xfce4/session/xfsm-shutdown-helper
There is no rule associated.
I try to use this action, so i uninstall consolekit.
Access to Action Buttons for shutdown and restart go away.
I save a file in rules.d named 30-stop_restart.session.rules

polkit.addRule (function (action, subject) {
  if (action.id == "org.xfce.session.xfsm-shutdown-helper"
      && subject.isInGroup ("users")) {
    return polkit.Result.YES;
  }
});

It's OK, access to Actions Buttons for shutdown and restart come back.
The restart is OK, but the shutdown only logout.
I trace the call to xfsm-shutdown-helper.
When I click on restart, xfsm-shutdown-helper is call with arg '--restart'.
When I click on shutdown, xfsm-shutdown-helper is never call.
xfsm-shutdown-helper also receive '--suspend' and '--hibernate'.
So, what can i do ?
Have i miss something ?
I think Action Button for shutdown don't call xfsm-shutdown-helper but what is call?
Thanks.

Offline

#2 2017-05-08 18:57:34

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,950

Re: Action Button Shutdown & Restart

I just installed openbsd 6.1 in a vm to test it out. I installed consolekit2 xfce and xfce-extras and the buttons worked. I've also enabled xenodm and am using the following .xsession script:

exec ck-launch-session startxfce4

I did not require any additional rules files.

IIRC, ck-launch-session is required for the buttons to work properly.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2017-05-08 20:05:20

ctac
Member
Registered: 2017-05-08
Posts: 57

Re: Action Button Shutdown & Restart

Hi,
With consolekit, all work fine and the use of ck-launch-session isn't needed.
consolekit is a third party and I try to use what came with xfce.
I find that xfce have a action defined in polkit and i try to use it with partial result.
So try to uninstall consolekit and had my polkit rule to see what happen.
my trace of xfsm-shutdown-helper is only a shell script.
I rename xfsm-shutdown-helper with mv xfsm-shutdown_helper xxfsm-shutdown-helper
and i create a shellscript named xfsm-shutdown-helper like that :

#!/bin/sh
echo "$*" > /home/alain/Desktop/paramshutdown
/usr/local/lib/xfce4/session/xxfsm-shutdown-helper $1

This way, I saw that it is never call when i click the shutdown button.
I trace the same way shutdown, halt and xfce4-session-logout with no aval.
Thanks.

PS: xfsm-shutdown-helper and xfce4-session-logout are (near) the same things.
So why 2 'programmes' ?

Offline

#4 2017-05-10 21:56:22

ctac
Member
Registered: 2017-05-08
Posts: 57

Re: Action Button Shutdown & Restart

Hi,
No more thinks about that ?
Nobody ?
Someone have try my suggest without problem with shutdown button?

Offline

#5 2017-05-11 00:34:18

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,950

Re: Action Button Shutdown & Restart

As per my post #2, everything works fine here for me with the shutdown buttons given that I have consolekit2 installed and am using ck-launch-session to start Xfce.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#6 2017-05-11 14:41:02

ctac
Member
Registered: 2017-05-08
Posts: 57

Re: Action Button Shutdown & Restart

Hi,
Thanks for reply, but, sorry, it's not really the expected answer.
smile
It's like I say Terminal Emulator always crash, I cant access the command line.
And the answer is : I install Gnome Terminal and no problem to access the command line.

So, with consolekit, It's OK.
How this work ?
man console-kit-daemon

   ConsoleKit System Restart and Stop
       console-kit-daemon provides D-Bus interfaces that will restart or stop
       the system.  When console-kit-daemon receives a D-Bus request to
       restart the system, it will run the /usr/lib/ConsoleKit/scripts/ck-
       system-restart script if the user has privilege to do this operation.
       When console-kit-daemon receives a D-Bus request to stop the system, it
       will run the /usr/lib/ConsoleKit/scripts/ck-system-stop script if the
       user has privilege to do this operation.

The buttons restart and shutdown send a signal on the messagebus.
consolekit trap this signal and execute the appropriate action.

I find nothing on org.xfce.session but i think it's the same.

Whem it receives a D-Bus request to restart the system, it will run the
/usr/local/lib/xfce4/session/xfsm-shutdown-helper with param --restart
Whem it receives a D-Bus request to suspend the system, it will run the
/usr/local/lib/xfce4/session/xfsm-shutdown-helper with param --suspend
Whem it receives a D-Bus request to hibernate the system, it will run the
/usr/local/lib/xfce4/session/xfsm-shutdown-helper with param --hibernate

It's exactly what I trap with my shell script.

I never catch --shutdown.

I think it's a misconfiguration of org.xfce.session but i am not sure.

Now, I try to catch the signal on the messagebus with dbus-monitor but it's a lot of read and learn.

So before create a bug-report, I want to know if someone try out with org.xfce.session.

Thanks.

Offline

#7 2017-05-14 16:12:19

ctac
Member
Registered: 2017-05-08
Posts: 57

Re: Action Button Shutdown & Restart

Offline

Board footer

Powered by FluxBB