Closed fabiscafe closed 6 years ago
Related with https://github.com/manjaro/packages-core/issues/97
@Tids @Ste74 I have tried to implement the proposed changes from Stefanos gist.
I have placed a test package at https://www.uex.dk/public/pacman-mirrors
Will you test if this works for you on Wayland?
When I try to run pacman-mirrors with the proposed changes I get
/bin/bash: warning: shell level (1000) too high, resetting to 1
Have you a proposal to how I can work around that?
Yep, same output:
LANG=C pacman-mirrors --geoip -i :(
localuser:root being added to access control list
/bin/bash: warning: shell level (1000) too high, resetting to 1
/bin/bash: warning: shell level (1000) too high, resetting to 1
/bin/bash: warning: shell level (1000) too high, resetting to 1
/bin/bash: warning: shell level (1000) too high, resetting to 1
/bin/bash: warning: shell level (1000) too high, resetting to 1
/bin/bash: warning: shell level (1000) too high, resetting to 1
/bin/bash: warning: shell level (1000) too high, resetting to 1
/bin/bash: warning: shell level (1000) too high, resetting to 1
/bin/bash: warning: shell level (1000) too high, resetting to 1
/bin/bash: warning: shell level (1000) too high, resetting to 1
/usr/sbin/pacman-mirrors: fork: retry: Resource temporarily unavailable
/usr/sbin/pacman-mirrors: fork: retry: Resource temporarily unavailable
/usr/sbin/pacman-mirrors: fork: retry: Resource temporarily unavailable
/usr/sbin/pacman-mirrors: fork: retry: Resource temporarily unavailable
/usr/sbin/pacman-mirrors: fork: retry: Resource temporarily unavailable
/usr/sbin/pacman-mirrors: fork: retry: Resource temporarily unavailable
/usr/sbin/pacman-mirrors: fork: retry: Resource temporarily unavailable
/usr/sbin/pacman-mirrors: fork: retry: Resource temporarily unavailable
/usr/sbin/pacman-mirrors: fork: retry: Resource temporarily unavailable
/usr/sbin/pacman-mirrors: fork: retry: Resource temporarily unavailable
/usr/sbin/pacman-mirrors: fork: retry: Resource temporarily unavailable
/usr/sbin/pacman-mirrors: fork: retry: Resource temporarily unavailable
/usr/sbin/pacman-mirrors: fork: Resource temporarily unavailable
localuser:root being removed from access control list
access control enabled, only authorized clients can connect
SI:localuser:fabi
Now its completely broken. In /usr/bin/pacman-mirrors, line 3, you have to change the line to:
app="pm-launch $*"
I have corrected to pm-launch
- new pkg build
And it works as expected on a normal xfce install
pacman-mirrors --geoip -i
^ works on wayland and will load the GTK interface
sudo pacman-mirrors --geoip -i
^ crashes with
No protocol specified
Unable to init server: Could not connect: Connection refused
No protocol specified
Unable to init server: Could not connect: Connection refused
/usr/bin/pacman-mirrors: line 30: 30973 Segmentation fault (core dumped) ${app}
pkexec pacman-mirrors --geoip -i
^works and will start the CLI interface.
from what I understand, it is using the root-xorg as workaround to bypass wayland norootwindow-security-layer. For the long run it would maybe better to adopt a new structure for pacman-mirrors. where it runs completely as normal user, opens the dialog as normal user, creates the mirror list as normal user (in $XDG_CACHE_HOME) and only asks for root(via polkit) to move that mirrors list to /etc/*
pacman-mirrors does a lot more than that
/etc
/etc/pacman.d
/var/lib
/var/lib
/usr/share
It seems that the problem only occurs when launching the GUI window.
pacman-mirrors checks the $DISPLAY variable to decide if showing GUI or CLI
So for me now work fine no ? Only we have to inform user to use simply pacman-mirrors without sudo or pkexec ..
OT: Now is good idea create a little gui to call via MSM .. do you think
Only we have to inform user to use simply pacman-mirrors without sudo or pkexec ..
I am trying to get @Tids idea of using the XDG_CACHE_DIR which ultimately will result in pacman-mirrors when the final stage - file copy to their respective folders - is reached - which I agree is a better long term approach.
It would possibly also eliminate the need for the policy file as everything is refactored to run as the ordinary user.
@fhdk you can also check for $XDG_SESSION_TYPE
, wich would result in wayland
on Gnome, KDE running as wayland compositors, x11
on X or is empty on TTY (and sudo -i). Because the $DISPLAY var is a bit strange to work with nowadays.
This would completely kill the X11 dependency without loss of functionality - you could even make the -i GUI option X11 only and fall back to shell for wayland and terminal until the "rootless" mode is implemented.
@Ste74 TBH I dont like the "hack" with pkexec, since it creates this unflexible behavior in pacman-mirrors
sudo pacman-mirrors --geoip -i
.: INFO Wayland sessions are not supported by the -i GTK Interface, fallback to CLI-mode in 2 secounds
or something like this
cc7c52c33d671fbb0da91f5ff85abaa8f9b50046
pacman-mirrors "-i" option does not work on wayland, i think because root-owned windows are not allowed
If we run
sudo pacman-mirrors --geoip -i
we get
[1] 9719 segmentation fault sudo pacman-mirrors --geoip -i
if we use
pkexec pacman-mirrors --geoip -i
It will start the CLI-interface