trisquel mini missing polkit package

Project:Trisquel mini
Version:7.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

this is likely related to https://trisquel.info/en/issues/13803 but i post a separate issue because it is not specific to synaptic but system-wide - the solution offered there is to install the gnome policy kit but there is a better option imho as i describe below

certain GUI initiated actions requiring admin privileges are launched unprivileged - notably:
* nm-applet - GUI launches but changes to network profiles do not stick - workaround for GUI is to launch manually with `sudo nm-applet`
* pcmanfm - partitions on internal devices are listed in "Places" but can not be mounted - workaround is to mount manually with `sudo mkdir /mnt/sda2 && sudo mount /dev/sda2 /mnt/sda2`
* /usr/share/applications/synaptic.desktop - the default command `synaptic-pkexec` has no effect - workaround is to create a new .desktop file that launches `gksudo synaptic`

after some digging i isolated the cause of this to be a missing polkit package

policykit-1-gnome is the default on many systems and is referenced twice under /home but this program is not installed by default - the simplest workaround is to install the policykit-1-gnome package manually
$ sudo apt-get install policykit-1-gnome
but lxde actually has its own polkit which also works and is probably more proper for a lxde-only environment
$ sudo apt-get remove lxpolkit
but this requires the obvious change to ~/.config/lxsession/Trisquel-mini/autostart and probably ~/.config/autostart/polkit-gnome-authentication-agent-1.desktop is not needed - also the manual step reccomended in issue #13803 of activating "PolicyKit Authentication Agent" in "Desktop Session Settings" GUI is actually not necessary and (as i have read) may actually conflict with lxpolkit if both are present

one thing i noticed with either polkit installed - actions such as mounting in pcmanfm ask for sudo password but on every other system ive used they do not ask (including trisquel 7 initially installed full gnome and later added lxde - likely some group for this) - personally, i find this caveat preferable but i mention it for completeness

i suggest the proper fix for this:
* make the lxpolkit package a dependency of the trisquel-mini metapackage
* modify ~/.config/lxsession/Trisquel-mini/autostart to launch lxpolkit instead of polkit-gnome-authentication-agent-1
* delete ~/.config/autostart/polkit-gnome-authentication-agent-1.desktop from the user skeleton

---------------------------------------------------------------------------

$ cat ~/.config/autostart/polkit-gnome-authentication-agent-1.desktop
[Desktop Entry]
Name=PolicyKit Authentication Agent
Comment=PolicyKit Authentication Agent
Exec=/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1
Terminal=false
Type=Application
Categories=
NoDisplay=true
OnlyShowIn=GNOME;XFCE;Unity;
X-GNOME-AutoRestart=true
AutostartCondition=GNOME3 unless-session gnome
X-Ubuntu-Gettext-Domain=polkit-gnome-1

$ cat ~/.config/lxsession/Trisquel-mini/autostart
@lxpanel --profile Trisquel-mini
@xscreensaver -no-splash
@gnome-power-manager
@pcmanfm --desktop --profile Trisquel-mini
@/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1

Tue, 09/01/2015 - 22:39

hm? is it not possible to edit posts on this forum ?

this is a correction to a now obvious error in the OP
where i have as a workaround
$ sudo apt-get remove lxpolkit
i obviously meant
$ sudo apt-get install lxpolkit

but im sure this will be fixed soon - so - whatever

Tue, 09/01/2015 - 22:42

ok question answered - we can edit replies but not the OP - is this correct ?

also i did not choose the penguin as my avatar - i chose the guitar

Wed, 09/02/2015 - 03:03
Wed, 09/02/2015 - 22:34

@aklis - your patch #3 is the same solution as your patch #2 which adds no new information to this discussion - if you had actually read this post before commenting you would know that it acknowledges the fact that you have offered a patch including the polkit package from gnome - it then goes on to offer the more proper solution for an lxde environment which is to use the polkit package from lxde instead of the one from gnome - noticing that your patch #2 had been rejected and not being aware of your patch #3, the intention was to spark a discussion before another fix was offered

it seems as if you have been assigned to this issue or otherwise have taken up the task - i would be happy to assist you with the implementation if you would like to arrange a meeting time

Thu, 09/03/2015 - 11:13

A meeting would be a good idea. I'm usually hanging on irc in freenode, in #trisquel and #trisquel-dev channels, so ping me there anytime.

Tue, 10/27/2015 - 12:47
Status:active» fixed

Fixed in trisquel-mini_7.0-39 , changes avaliable at https://devel.trisquel.info/trisquel/trisquel-packages/commit/d23b00c42cc837f12f18008b38398e941e835838

Thu, 11/05/2015 - 10:48

I am using Trisquel mini and had installed that gnome-package already but PCManFM has a problem with
authentication, so that it won't do file searches for me. That's why i want to try lxpolkit out. But that doesn't work.
In ....config/lxsession/Trisquel-mini/autostart i changed the last line.
But neither /usr/lib//policykit-1/polkitd nor /usr/lib//policykit-1/polkit-agent-helper-1 work. Synaptic won't
start graphically. There doesn't seem to be any other polkit-related file in /usr/lib .
I also deleted the desktop file as suggested, although it was in a
different place. Mine was /etc/xdg/autostart/polkit-gnome-authentication-agent-1.desktop
I have deleted the gnome-polkit-package already.
Do you think there's a solution or should i just stick to the gnome-package?
Btw, i think it's since i've exchanged gnome-polkit with lxpolkit that the package trisquel-mini is not being upgraded when doing upgrades. Is there a relation?

Thu, 11/05/2015 - 13:16

regarding the gnome polkit if that was installed but not working sometimes the issue it that is not autostarting - you can look in "desktop session settings" on the "autostarted applications" tab and be sure that "policy kit" it checked

regarding lxpolkit it needs to be installed like :
$ sudo apt-get install lxpolkit

you can test it manually from command line like:
$ lxpolkit

this will block the terminal - keep this terminal open then try sudo actions in `pcmanfm` or `pkexec synaptic` - if this works you can add lxpolkit to your autostart file - for example my autostart file looks like this:
$ cat /home/me/.config/lxsession/Trisquel-mini/autostart
@lxpanel --profile Trisquel-mini
@xscreensaver -no-splash
@gnome-power-manager
@pcmanfm --desktop --profile Trisquel-mini
@lxpolkit

this will take permanent effect the next time you restart the PC

Tue, 11/17/2015 - 00:50
Status:fixed» active

There's still one little problem.
In the original posting bill says: "lxde actually has its own polkit which also works and is probably more proper for a lxde-only environment".
I opted for lxpolkit, but in the meantime policykit-1-gnome was made part of the metapackage trisquel mini.
Question 1: Why isn't lxpolkit part of that metapackage instead?
Question 2: At every upgrade policykit-1-gnome wants to be installed. Could there be a problem if i download it without ever using it?

Fri, 11/20/2015 - 12:35

What about the package policykit-1? Why doesn't it do the job? It comes with Trisquel mini. And in a live session i could start Synaptic graphically, without having installed lxpolkit nor policykit-1-gnome. Why does that work?