Page 1 of 1

Is lxpolkit not currently used?

Posted: Tue Oct 27, 2020 4:15 pm
by tpprynn
I use a mix of Debian 10 with Fluxbox, xdm and a few light applications like Leafpad and PCManFM. I assembled my setup with some naivety from the Debian netinstall iso, and I've now had various likely permissions-based issues. I was told elsewhere I need a polkit application in my startup file and saw that lxpolkit was installed (presumably brough tin with PCManFM), so '/usr/bin/lxpolkit &' is now there. If I try to run

pkexec leafpad /etc/default/grub

for example, the lxpolkit box comes up, I put the root password in that it asks for, but the terminal then just reads

leafpad: cannot open display.

Nano works fine and so does Geany. (Leafpad is discontinued I understand, but I prefer it, and I see that people who are quite experienced still find a way to use, for example, gksu though that is discontinued too.)

I've tried three different display managers with my setup also, and there are inconsistent behaviours from one to another, for example Slim leads to PCManFM griping that this is not allowed if I click on Devices in the left pane. I had had trouble with PCMAnFMnot getting access to any external drives also, prohibited in the same way. This issue doesn't exist with xdm - i wouldn't know what they're doing differently.

If lxpolkit is still in use now, do we manually deal with how it interacts with programs on a program-by-program basis as needed or is some pre-configuation needed?

I'm keen to stick with this setup for the speed and simplicity, and it mostly works, but I can see that finished isos with full DE's installed do things automatically that are now outside of my awareness - it feels as if I don't know what I'm supposed to be looking for so I can't solve things. I may have bitten off more than I can chew, but on the other hand a couple of shoves and pointers might show there are only a couple more things to understand before I could get on with using the machines without tinkering further.

Thanks for any pointers.

Re: Is lxpolkit not currently used?

Posted: Wed Oct 28, 2020 7:59 am
by drooly
I made some quick tests and it looks like your problem is not with lxpolkit, but with polkit in general (lxpolkit is just a gui frontend).
Kill lxpolkit, and repeat your tests from your terminal. Do you experience the same problems?

Try mousepad instead of leafpad.

Re: Is lxpolkit not currently used?

Posted: Wed Oct 28, 2020 11:48 am
by tpprynn
Do you mean that polkit is a bit of a buggy problem or that I need to master it?

I had changed my display manager to SDDM last night but also I tried using the Gnome front end for polkit. PKexec isn't working to launch things as I've been told we should, but sudo is working with leafpad and PCManFM (to change a line of a gtk theme). And yes, mousepad had already shown itself to not have the same problem as Leafpad - do they put some kind of black mark on deprecated apps?

No polkit process is running apparently, not even the one that I had put in Fluxbox's startup file...

I had been doing these things in the terminal and that's where my reports come from so far.

Do we manually set up polkit configurations for each program that seems to need it or should that happen in an automated way if pkexec was working as intended?

I want to briefly change SDDM back to xdm just to see if that Gnome front end was what changed things.

Re: Is lxpolkit not currently used?

Posted: Wed Oct 28, 2020 12:03 pm
by tpprynn
If it helps solve this at all, I can confirm that the 'cannot open display' gripe doesn't happen with SDDM, for whatever reason. All four display managers have interacted differently with these issues. I'm inclined to settle for the one that's the least bother but would still like to see what's up with pkexec/ polkit if I can.

Re: Is lxpolkit not currently used?

Posted: Fri Oct 30, 2020 7:49 am
by drooly
As I already said, do this in a terminal:

Code: Select all

killall lxpolkit
make sure it stays killed:

Code: Select all

pidof lxpolkit
should not return anything.
Then

Code: Select all

pkexec {leafpad,geany,whatever}
and show us the output.

Re: Is lxpolkit not currently used?

Posted: Fri Nov 06, 2020 5:11 pm
by tpprynn
If you or anyone who knows polkit are still there, this was the output:

"polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie
==== AUTHENTICATION FAILED ===
Error executing command as another user: Not authorized

This incident has been reported."

Was distracted a few days by a family situation and relied for a while on the comforts of Debian LXDE on one machine. In fact I'm wondering if there are files I can just copy/learn from on the LXDE install to apply to my Fluxbox/netinstall laptop. After making quite a few installs in the last couple of weeks I'm reluctant to take risks for the moment. If things look a bit hairy I'm almost inclined to just not do what the policykit prevents, but that does seem a nuisance.

lxpolkit is in /etc/xdg/autostart but killalll lxpolkit suggested no process was running - on this laptop. Other setups in my experimenting had for example the Gnome polkit in the Fluxbox startup file in /home/me/. This did lead to the box coming up instead of authenticating in the terminal but the result was the same, prevention of the task.

Thanks.

Re: Is lxpolkit not currently used?

Posted: Sat Nov 07, 2020 10:05 am
by drooly
Yes, I'm still here.
What comand is that the output of?
Please be precise.
Then search the web for the error message, e.g. "<command_used> error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie".
Tell us a bit about the results.

AFAIR, applications need to be registered with polkit. Maybe leafpad does not do that on installation.
Scroll back where I linked to the Arch Wiki article.

Re: Is lxpolkit not currently used?

Posted: Sat Nov 07, 2020 8:59 pm
by tpprynn
Thanks. That was the output from pkexec leafpad /etc/default/grub. (Same result with Mousepad and Geany but I would much prefer to keep this a gtk2-only system anyway (only Leafpad is gtk2), as there are a couple of easy on the eye and properly finished themes for gtk2, where to me gtk3 themes just have an awful splodgy 'felt tip pen' appearance or they are too white or too black. Maybe I have an as-yet undiscovered disorder comparable to whatever one necessitates high contrast icons themes etc...)

One thread suggested the Gnome equivalent of polkit worked differently. It didn't for me, but the threads are often four or more years old. I have installed an operating system on this laptop at least eight times in the last six days. This stuff is beyond both my level of understanding and is at odds with illness-related exhaustion. This time around i had intended to ignore the problem and just not do what the broken/unfinished system doesn't allow as it is, but I still have an amount of curiosity if a simple thing can be done to put this right. This has gone on a bit too long for what I use a computer for - mastery of them isn't an end in itself for me now, magnificent though the Linux technology is. I wrote two games as a teenager, I wrote a theme used in Mint six years ago, but I'm pretty burnt out with it all now, as much as I appreciate the labours of anyone who works on this stuff. We can't all master everything. I think it's healthy enough that I'm not a passive consumer jabbing at a tablet. For me now it's simply not healthy to go much further than I have. I think knowing that the theme I wrote would stop working within months and need redoing put me off embracing the technology past a certain level. I personally think that 'if it ain't broke don't fix' should guide Linux programmers more.

If I can remove polkit/pkexec and replace it with gksu somehow I'd prefer to. That worked and needed no tinkering.

Should I not be using xdm? Is that involved with the problem? I see that others can get a system autostarted with a DM but I've borked this system several times and don't want to follow out of date web pages' instructions and end up reinstalling. Slim stopped external drives opening. I must have had a good reason to not use LightDM but I don't remember what.

If you or anyone knows what I should be doing I'd really appreciate the learning curve being shaved.

Many thanks.

Re: Is lxpolkit not currently used?

Posted: Tue Nov 10, 2020 9:29 pm
by drooly
tpprynn wrote: Sat Nov 07, 2020 8:59 pmIf you or anyone knows what I should be doing I'd really appreciate the learning curve being shaved.
drooly wrote: Sat Nov 07, 2020 10:05 amAFAIR, applications need to be registered with polkit. Maybe leafpad does not do that on installation.
Scroll back where I linked to the Arch Wiki article.
Your distro's wiki might have a similar article.
tpprynn wrote: Sat Nov 07, 2020 8:59 pmMany thanks.
You're welcome.