# XDM and ConsoleKit actions



## bsduck (Jan 27, 2022)

Hello,

When logging in from XDM, I can't get LXQt power buttons (suspend, shutdown, reboot) to work, they're greyed out.

When logging in from LightDM, they work out of the box without any configuration needed.

When starting the desktop with `startx`, they work as expected, given that I run ConsoleKit with `ck-launch-session` (otherwise they're greyed out too):

~/.xinitrc

```
[...]
ck-launch-session startlxqt
```

The same line in ~/.xsession for XDM doesn't have the expected effect, buttons are still greyed out.

What am I doing wrong?


----------



## drr (Jan 28, 2022)

I have previously noticed that the ~/.xsession lines start with an 'exec'. I don't know whether this is relevant.


----------



## mer (Jan 28, 2022)

exec means "replace the currently running process with the following" so if you have
exec ck-launch-session startlxqt
exec twm

the second exec probably never gets execute.

OP have you looked at creating an "autostart" for your window manager/DE doing that command?  There could be an issue with the way XDM calls your .xsession and the way LightDM calls .xession.


----------



## bsduck (Mar 10, 2022)

mer said:


> OP have you looked at creating an "autostart" for your window manager/DE doing that command? There could be an issue with the way XDM calls your .xsession and the way LightDM calls .xession.


I'm not sure to understand your suggestion: do you mean adding `ck-launch-session` as a command automatically run by LXQt when it starts? I tried this and it doesn't work.

With or without `exec` doesn't make a difference.

Any other idea? Otherwise I'll file a PR.


----------



## Alexander88207 (Mar 10, 2022)

Doesn't sound smart now but my solution was (when i had such an issue its gone now since years), replacing every no with an yes in /usr/local/share/polkit-1/action/org.freedesktop.consolekit.policy.

It would be recommended to test each lever individually to find out the exact needed lever.


----------



## bsduck (Mar 13, 2022)

I noticed another issue, which may be related:

When logging in from XDM, */usr/local/sbin* isn't included in my PATH. Commands residing there aren't found unless the full path is typed.
No problem with /bin, /sbin, /usr/bin, /usr/sbin and /usr/local/bin.
Is this the case for other XDM users here? Any idea why?

I can circumvent this by setting PATH in my ~/.profile, as suggested in that file itself:


> # These are normally set through /etc/login.conf.  You may override them here
> # if wanted.
> # PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$HOME/bin; export PATH


This of course fixes the path for myself but doesn't solve the ConsoleKit problem.

However, XDM itself not having proper access to commands in /usr/local/sbin could be relevant to the issue.
Especially with such commands located there:
`ck-log-system-restart
ck-log-system-start
ck-log-system-stop
console-kit-daemon`

Alexander88207 thanks for the tip, I tried turning that file into a Jasager but couldn't notice a change. Do you still use XDM?


----------

