Bug 19129 - drakconf fails to run from main menu in enlightenment DE and IceWM
Summary: drakconf fails to run from main menu in enlightenment DE and IceWM
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: x86_64 Linux
Priority: High major
Target Milestone: ---
Assignee: All Packagers
QA Contact:
URL:
Whiteboard:
Keywords:
: 20194 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-08-04 15:11 CEST by Barry Jackson
Modified: 2017-06-04 15:54 CEST (History)
11 users (show)

See Also:
Source RPM: e, drakconf, polkit
CVE:
Status comment:


Attachments
Debug script (587 bytes, text/plain)
2016-10-18 00:16 CEST, aguador
Details
Log file from debug script (429 bytes, text/plain)
2016-10-18 00:18 CEST, aguador
Details

Description Barry Jackson 2016-08-04 15:11:00 CEST
Description of problem:
As summary. Running from a terminal with mcc works OK.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
Comment 1 Thierry Vignaud 2016-08-04 20:41:41 CEST
@Colin: would that be another doble exec bug?

CC: (none) => mageia, thierry.vignaud
Source RPM: drakconf => e, drakconf

Comment 2 Marja Van Waes 2016-08-05 21:28:20 CEST
Guessing this should be fixed in e.

Assigning to all packagers collectively, since there is no registered maintainer for e.

CC: (none) => marja11
Assignee: bugsquad => pkg-bugs

Comment 3 aguador 2016-09-13 23:11:01 CEST
Confirm this bug. As indicated it is possible to run mcc with sudo rights in terminal. However, it fails to open from E20 menu even after copying "polkit-mate-authentication-agent-1.desktop" into the E startup applications. (See Bug 16881.)

CC: (none) => waterbearer54

Comment 4 aguador 2016-09-13 23:52:09 CEST
While presumably not a solution to this bug, I would note that E does have an efl-based polkit available: https://phab.enlightenment.org/project/profile/47/
Thierry Vignaud 2016-09-14 14:58:32 CEST

Source RPM: e, drakconf => e, drakconf, polkit

Comment 5 aguador 2016-09-24 17:02:09 CEST
Entering "mcc" as regular user correctly prompts for password, but authentication fails as in Bug 16961:

bash-4.3$ mcc
==== AUTHENTICATING FOR org.mageia.drakconf.pkexec.run ===
Authentication is required to run Mageia Control Center GUI
Authenticating as: aguador
Password:
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

Attempted reinstalling polkit files, a version of comment 14 in Bug 16961:

urpmi --replacepkgs --clean lib64mate-polkit1_0 lib64polkit-gir1.0 lib64polkit1_0 mate-polkit polkit

with no effect after restart. (Note lib64polkit-gir1.0 had to be installed first as it was not present.)

Note: There is an open bug in Ubuntu related to polkit in the latest systemd:

https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1615230

I would expect this is not the issue here as the error would occur in other DEs.
Barry Jackson 2016-10-08 16:47:08 CEST

Priority: Normal => High
Summary: drakconf fails to run from main menu in enlightenment DE => drakconf fails to run from main menu in enlightenment DE and IceWM

Comment 6 aguador 2016-10-12 19:38:55 CEST
I should have added a cross-reference earlier, but since udisks2 depends on polkit and polkit rules, this may be an underlying cause of the failure of E20 to automount optical and external USB drives: Bug 19355.
Comment 7 Thierry Vignaud 2016-10-13 13:26:21 CEST
I just added a requires on polkit-agent in mcc
Comment 8 aguador 2016-10-18 00:14:32 CEST
ps -Al | grep polkit shows only polkitd running, not the authentication agent even though the agent is in E's startup list.

1) polkit-mate-authentication-agent-1.desktop includes: "OnlyShowIn=Mate;XFCE;OPENBOX;Old;"  However, the agent is not shown as running either after adding "Enlightenment" to the list or simply commenting out the line.

2) I have successfully used lxpolkit in other installations of E. However, after installing lxsession and substituting lxpolkit.desktop for polkit-mate-authentication-agent-1.desktop in E's autostart list, lxpolkit does not show as a running service either.

After these failed, I tried a debug script (attached in the txt file -- along with the resulting log file). As shown, there was a critical warning that showed in the terminal. However, before stopping the process I attempted to open mcc from the E20 menu . . . and the authentication window came up immediately.

I am not sure where to go next, but if someone can guide me I will be happy to explore this issue more.
Comment 9 aguador 2016-10-18 00:16:05 CEST
Created attachment 8559 [details]
Debug script

Note the critical warning message
Comment 10 aguador 2016-10-18 00:18:02 CEST
Created attachment 8560 [details]
Log file from debug script

Log file seems to indicate normal execution (authentication was cancelled).
Comment 11 aguador 2016-10-18 00:24:23 CEST
A second run of the debug script confirmed that authentication worked properly and mcc started. However, my speculation in Comment 6 regarding automounting seems not to have been borne out as even with the script running E failed to automount a pen drive.
Comment 12 Thierry Vignaud 2016-10-18 00:54:28 CEST
Have you tried to debug lxpolkit?

For the fact it's hidden, you can locally revert those changes:
http://svnweb.mageia.org/packages/cauldron/lxsession/current/SOURCES/lxpolkit-0.5.2-mga-disable-lxpolkit-autostart-for-other-environments.patch?revision=977362&view=markup
aka in /etc/xdg/autostart/lxpolkit.desktop

CC: (none) => nicolas.salguero

Comment 13 aguador 2016-10-19 18:03:17 CEST
Yes, I have commented out the OnlyShowIn=LXDE and Hidden lines.

Modifying the script I used above for lxpolkit produced an empty log file, and I have not been able to get a backtrace with gdb as it indicates that no debuginfo is available despite enabling debug repositories and attempting to install the info.

As with the MATE agent, if I launch lxpolkit in the terminal, lxpolkit functions until the terminal is closed.
Comment 14 aguador 2016-11-17 07:22:09 CET
I am not sure why the problem occurs IceWM, but the problem is that *none* of the startup applications (~/.e./e/applications/startup/.order) are loading in Enlightenment. This turns out to be bug that appeared in E20.7 when using LXDM. See E bug report https://phab.enlightenment.org/T3584.

E needs to be upgraded either to E20.10 (last in the series and one receiving LTS) or E21 (which offers Wayland support).
Comment 15 Marja Van Waes 2016-11-17 10:59:03 CET
(In reply to Roy Reese from comment #14)
> I am not sure why the problem occurs IceWM, but the problem is that *none*
> of the startup applications (~/.e./e/applications/startup/.order) are
> loading in Enlightenment. This turns out to be bug that appeared in E20.7
> when using LXDM. See E bug report https://phab.enlightenment.org/T3584.
> 
> E needs to be upgraded either to E20.10 (last in the series and one
> receiving LTS) or E21 (which offers Wayland support).

CC'ing the packaging team leaders, I don't know whether the an upgrade (to also land in Mageia 6) is or can be planned.

CC: (none) => ennael1, rverschelde

Comment 16 aguador 2016-11-17 20:41:13 CET
Obviously I cannot answer the question, and I am sorry to have come late to the pre-stable-release party. However, I can add that I upgraded in an Arch-based distro from 20.7 through all the intermediate releases to 20.10 by simply changing the links and checksums in the Arch PKGBUILD. In other words, the changes are not big and are mostly or solely bug fixes that do not seem to have other untoward effects.

E21 is the current release and the only one to support Wayland as well as X. From what has appeared on fora and the E users mailing list, I do not believe there were big changes in the move to E21. However, I have not made the move in my other installations out of laziness and a focus on checking things in Mageia at the moment.

I understand that it is late for updating a DE, but the price of *not* upgrading is a broken Mageia E.

(To clarify my prior post, E has been my main DE for two+ years and even 20.7 worked for me when using E's Entrance DM. There is something about the LXDM+E combo that is the problem, which implies that LXDE may not play nicely with IceWM either.)
Comment 17 Chris Denice 2016-11-24 16:45:15 CET
Them, let's upgrade !?

CC: (none) => eatdirt

Comment 18 Chris Denice 2016-11-24 18:01:37 CET
Just did an upgrade locally to E 21:

rpm -qi e
Name        : e
Version     : 0.21.3
Release     : 1.mga6
Architecture: x86_64
Install Date: Thu 24 Nov 2016 17:47:34 CET
Group       : Graphical desktop/Enlightenment
Size        : 31737538
License     : BSD
Signature   : (none)
Source RPM  : e-0.21.3-1.mga6.src.rpm
Build Date  : Thu 24 Nov 2016 17:46:49 CET
Build Host  : cp3wks01.fynu.ucl.ac.be


It does not help for "drakconf".

As a matter of fact, this bug also occurs on fvwm2 and small window managers. One cannot start drakconf from a menu!?

Even in a terminal this is nasty:
/usr/bin/mcc
==== AUTHENTICATING FOR org.mageia.drakconf.pkexec.run ===
Authentication is required to run Mageia Control Center GUI
Authenticating as: root
Password:

I am entering my root password and press ENTER

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.


BANG :-/

I can ask a freeze push of e-0.21.3 if needed though.

Cheers,
Comment 19 Chris Denice 2016-11-25 16:58:03 CET
Freeze push asked. Now that I have read properly the thread, I understand that you don't have a polkit agent running.

I have just checked that this guy is compiling and working fine:

https://git.enlightenment.org/misc/polkit-efl.git/commit/

and it would certainly make more sense to package it for enlightenment rather than using the mate's one?
Comment 20 aguador 2016-12-10 19:43:47 CET
Thanks, Chris. The move to E21 fixed the problem in Enlightenment -- and the efl polkit works smoothly. As always with E, autostart files must be added via "Menu > Settings > Applications > Applications at startup" or added manually (e.g., copying from xdg/autostart to ~/.e/e/applications/startup/.order). This is customarily noted in release notes.

IceWM Light can start the polkit by creating ~/.icewm/startup with polkit (and any other programs one wants at startup). For polkit only, ~/.icewm/startup would look like this:

#!/bin/bash
/etc/xdg/autostart/polkit-efl-authentication-agent-1.desktop &

which must be made executable:

# chmod a+x ~/.icewm/startup

In my tests with IceWM Light mcc will still not start from the menu, but it does start correctly from the terminal using sudo. If there is no other way to make mcc, rpmdrake, etc. executable from the menu, I would simply suggest a release note. After all, this is the backup for a failure of the main WM/DE.
Comment 21 aguador 2016-12-10 20:17:58 CET
To rectify what I have written about IceWM, the startup file does NOT solve the authentication problem as the agent still does not start in IceWM. Both 

/etc/xdg/autostart/polkit-efl-authentication-agent-1 &

and 

/etc/xdg/autostart/polkit-mate-authentication-agent-1 &

were tried and "sleep 2" added to allow time for loading. However, the agent was still missing.

I should also note that the mate agent is listed as a dependency for IceWM making it impossible to remove that agent even though it is not being used by Enlightenment.
Comment 22 Chris Denice 2016-12-10 20:39:43 CET
Hi Roy,
the requires to mate-polkit has been replaced by polkit-agent in icewm in the incoming package, allowing you to choose the one you prefer.

For the startup script, I guess you may simply add the link to the binary instead of the .desktop file:
/usr/bin/polkit-efl-authentication-agent-1

and report here!

Thanks,
cheers.
Comment 23 aguador 2016-12-10 21:21:51 CET
Yep, linking directly to the binary in the script, as in

/usr/bin/polkit-efl-authentication-agent-1 &

does it. I think this bug report can finally be closed.
Comment 24 David Walser 2016-12-10 21:25:01 CET
Sorry Chris, that wasn't the correct change to make.

I don't know anything about E, but for IceWM, I generally know how this is supposed to work, having fixed it multiple times in the past, but with the xinitrc and other changes we've made during this cycle, it's possible that we've broken it again (but please let's not make incorrect changes and break it even further).  It looks like I last fixed this in late August.
Comment 25 Chris Denice 2016-12-10 21:28:01 CET
Ok, I did not push anything into /etc/xdg however, so please have a look.

The only changed I have mde is to change the Requires: mate-polkit to Requires: polkit-agent to allow more freedom!

cheers.
Comment 26 David Walser 2016-12-10 21:36:02 CET
The way it should work in IceWM is the DM either calls /etc/X11/Xsession with IceWM as an argument, which becomes the value of $DESKTOP, or it defaults to that from ~/.desktop or /etc/sysconfig/desktop, then $SESSION also gets set to that value.  Then Xsession sources /etc/X11/xinit.d/xdg-autostart, which runs xdg-autostart -r Old, which runs /etc/xdg/autostart/polkit-mate-authentication-agent-1.desktop, which runs /usr/libexec/polkit-mate-authentication-agent-1.  It *should* still be working currently.
Comment 27 David Walser 2016-12-10 21:38:26 CET
Freedom is not relevant here, as other packages providing polkit-agent would not be executed when IceWM starts, so mate-polkit *must* be installed.  This isn't a case where multiple packages can provide equivalent functionality.  Installing mate-polkit doesn't prevent installing other packages which also provide polkit-agent for other environments.  mate-polkit is supposed to be the polkit agent for MATE, XFCE, OPENBOX, and IceWM only.
Comment 28 Chris Denice 2016-12-10 22:22:33 CET
I see, but that's just because someone forced mate-polkit to be used in "Old".
Feel free to revert my change!

Freedom is always relevant though :) In fact, I don't think we should start at all a polkit agent in small window managers, that should be let user side.
But then we are facing this monstrous issue that if you enter "mcc" in a terminal, then the root password, everything fails.
Comment 29 aguador 2016-12-11 11:59:41 CET
When I installed sta1 with E in September, IceWM was not automatically starting the authentication agent. In looking at /etc/X11/Xsession, I do not see that xdg autostart is being called. That file is version 1.48 from 2006/05/16 -- and, yes, this was from a fresh install.

The issue of whether or not IceWM is to require a specific polkit agent is beyond my role and expertise. However, a couple of observations.

First, IceWM is installed automatically as a fallback graphical interface making it a special case which should arguably default to requiring an authentication agent, where such a requirement for other WMs might be omitted.

Second, if IceWM is to require a polkit agent, mate-polkit is as good as any other. However, because of its automatic installation as a fallback, requiring mate-polkit means that two agents will be installed in the cases of KDE, E and LXQt (and others?). If no specific agent were required, this duplication would be eliminated, and I presume that in the case of an IceWM-only installation, the user would simply be presented with agents from which to select.
Comment 30 David Walser 2016-12-12 21:52:49 CET
Multiple polkit agents being installed causes no harm and is normal.  Different DEs use their own.  mate-polkit is the only one that is started in IceWM and a few other WMs.  There shouldn't be any cases where multiple ones are running.  There is no need for "choosing" which one to use.  It's a simple program that just pops up a GUI dialog to ask for a password, nothing else.

This is the part of Xsession that runs xdg-autostart:
for i in /etc/X11/xinit.d/* ; do
    [ -d $i ] && continue
    # Don't run ??foo.{rpmsave,rpmorig,rpmnew,~} scripts
    [ "${i%.rpmsave}" != "${i}" ] && continue
    [ "${i%.rpmorig}" != "${i}" ] && continue
    [ "${i%.rpmnew}" != "${i}" ] && continue
    [ "${i%\~}" != "${i}" ] && continue

    if [ -x $i ]; then
        if grep -q "# to be sourced" $i; then
            . $i "${SESSION}"
        else
            $i "${SESSION}" &
        fi
    fi
done
Comment 31 aguador 2017-01-08 19:38:39 CET
Fresh sta2 net install of E21 with IceWM-light:

a) IceWM still does not start the installed MATE authentication agent

b) polkit-efl authentication agent was not automatically installed with task enlightenment

c) Good news: authentication in E works well with either the MATE or EFL agent after they are added to E's applications at startup list
Marja Van Waes 2017-01-28 18:00:15 CET

See Also: (none) => https://bugs.mageia.org/show_bug.cgi?id=20194

Comment 32 Chris Denice 2017-01-28 20:05:40 CET
*** Bug 20194 has been marked as a duplicate of this bug. ***

CC: (none) => yves.brungard_mageia

Comment 33 Jani Välimaa 2017-03-06 18:32:00 CET
IceWM should be fixed with xdg-compliance >= 0.1-19.mga6.

CC: (none) => jani.valimaa

Comment 34 aguador 2017-03-07 00:43:33 CET
I just updated one system and rebooted, but even with xdg-compliance-0.1-20, the authentication agent does not start.
Comment 35 Jani Välimaa 2017-03-07 08:17:24 CET
(In reply to Roy Reese from comment #34)
> I just updated one system and rebooted, but even with xdg-compliance-0.1-20,
> the authentication agent does not start.

How are you starting your IceWM? Could you try again with xdg-compliance-0.1-21?

Tested with lightdm and startx and seems to be working for me.
Comment 36 aguador 2017-03-07 10:58:17 CET
xdg-compliance-0.1-21 did the trick, so I can confirm authorization agent now works with xdm as well.
Comment 37 Chris B 2017-06-03 14:40:47 CEST
I've made a fresh install with netinstall iso, minimal with X, no DE.
* IceWM & xdm: authentication/MCC work out of the box.
* Installed lightdm and switched to lightdm.
* I've added Enlightenment minimal, MCC doesn't work out of the box. But after using a settings menu to add a startup application (both mate-polkit and polkit- efl work), authentication and MCC work, after a reboot.

* I've installed OpenBox WM, authentication/MCC work out of the box.

CC: (none) => shybluenight

Comment 38 aguador 2017-06-03 16:15:29 CEST
Thanks for confirming this Chris. E always requires that you add the agent to the startup menu. I would close this bug as FIXED.
Comment 39 Chris B 2017-06-04 15:54:11 CEST
Closing this bug as fixed as suggested by Roy. Please reopen if needed.

Resolution: (none) => FIXED
Status: NEW => RESOLVED


Note You need to log in before you can comment on or make changes to this bug.