Bug 425272 - install-sessions.sh should set up dbus/polkit/kauth stuff for your built-from-source Plasma desktop
Summary: install-sessions.sh should set up dbus/polkit/kauth stuff for your built-from...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (show other bugs)
Version: master
Platform: Other Linux
: NOR wishlist
Target Milestone: 1.0
Assignee: David Edmundson
URL:
Keywords:
: 436776 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-08-12 20:05 UTC by Nate Graham
Modified: 2021-05-26 01:59 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2020-08-12 20:05:23 UTC
Right now install-sessions.sh just makes your built-from-source plasma desktop session show up in SDDM, which is already amazing. However it could do more. Right now we have some ugly documentation about how to set up DBus/PolKit/Kauth stuff properly: https://community.kde.org/Get_Involved/development#Plasma

This documentation doesn't actually seem to be correct and anecdotally, many KDE developers (myself included) appear to to have trouble getting it to work.

install-sessions should also do whatever is needed to get DBus, PolKit, and Kauth stuff working too. Then that stuff is transformed from a pain point into an effortless non-issue, just like it did for making your built-from-source Plasma desktop to appear in SDDM.
Comment 1 Nate Graham 2020-08-12 20:07:29 UTC
CCing a few people:
- David who apparently knows how to make this stuff work
- Tomaz who recently wrestled with this and maybe came up with a solution that worked?
- Aleix who wrote install-sessions.sh
Comment 2 David Edmundson 2020-08-13 12:42:54 UTC
>install-sessions should also do whatever is needed to get DBus, PolKit, and Kauth stuff working too. Then that stuff is transformed from a pain point into an effortless non-issue, just like it did for making your built-from-source Plasma desktop to appear in SDDM.

DBus has two parts; user and system. IMHO the user setup isn't too hard - except for this new potential issue with /home. Personally I would solve that by installing into /opt/kde5 rather than /home especially as it's useful to test multiple users with your self-build setup.

One challenge to note is that if you set up DBus and Polkit correctly to use your dev ones you have to apply something systemwide, which means any distro session also will use any dev polkit things.
You can't make that change at runtime and you can't skip some root involvement.

-----

For the sake of brainstorming, here's some other ideas:

 - We have a script/cron job to symlink some parts from your install into /etc/. Effectively what I do for my polkit and system bus . It'll break setups for people who install alongside distro KDE. 

 - We could use a pam hook to set up the session instead of the .desktop file. At the time we run pam auth modules we know what session we will be loading. This would allow us to manipulate XDG_DATA_DIRS before the user dbus-daemon is started, which saves the session bus problem.

 - Some unionfs to mount a directory read-only on top of /usr at boot? Then all system stuff would just work. Would require it to be done very early in the boot before polkit. Probably a horrific idea.

 - We use something like checkinstall in kdesrc-build and then we can install into /usr as packages. Would work for the neon case and I'm sure there's some equivalent.
Comment 3 David Edmundson 2020-08-13 13:39:48 UTC
For polkit system actions the important folders are:

polkit-1/actions
dbus-1/system.d   (sometimes clients also use /etc/dbus-1/system.d )
dbus-1/system-services
Comment 4 Nate Graham 2020-10-09 13:07:53 UTC
I use a bash function that does the following now:

function install-dbus-stuff {
    echo "Let's install stuff!"
    sudo ls > /dev/null
    echo "Installing actions from ~/kde/usr/share/polkit-1/actions/ to /usr/share/polkit-1/actions/"
    sudo cp -r ~/kde/usr/share/polkit-1/actions/* /usr/share/polkit-1/actions/
    echo "Installing everything from ~/kde/usr/share/dbus-1/ to /usr/share/dbus-1/"
    sudo cp -r ~/kde/usr/share/dbus-1/ /usr/share/
}

Seems to work fine in the absence of an automated solution to this problem.
Comment 5 Claudius Ellsel 2020-10-11 14:40:34 UTC
Do you plan to include it in the install script?
Comment 6 Nate Graham 2020-10-11 17:58:00 UTC
No, because it's kind of a hack. It could overwrite system files and mess up your dist-provided session.
Comment 7 Claudius Ellsel 2020-10-12 16:54:12 UTC
Alright, then.
Comment 8 Andrey 2020-12-06 14:24:33 UTC
I wasn't aware about PolKit as it doesn't mentioned in the Wiki, only DBus does:
https://community.kde.org/Get_Involved/development#Plasma

Maybe that's the reason I don't have Spectacle working in Wayland session.

As a least measure, shall we update the Wiki to mention all the required parts?
Comment 9 David Edmundson 2021-02-21 21:34:17 UTC
This is relevant https://github.com/sddm/sddm/pull/1370  effectively the option 2 in my list above.


It would solve session bus issues.
It would not solve polkit, but it's still in the right direction
Comment 10 Nate Graham 2021-05-11 03:30:08 UTC
*** Bug 436776 has been marked as a duplicate of this bug. ***
Comment 11 Bug Janitor Service 2021-05-24 18:23:39 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/884
Comment 12 Nate Graham 2021-05-26 01:59:22 UTC
Git commit 02459d3e1c20fc0b9c503e84d182f1504bd26a74 by Nate Graham.
Committed on 26/05/2021 at 01:58.
Pushed by ngraham into branch 'master'.

Set up DBus stuff properly in install-sessions.sh script

This is an extremely fiddly procedure well-suited for being automated
rather than documented.

The approach taken here should work for all distros, even those that
freak out if system DBus files are modified or symlinked into a home
directory.

M  +20   -0    login-sessions/install-sessions.sh.cmake

https://invent.kde.org/plasma/plasma-workspace/commit/02459d3e1c20fc0b9c503e84d182f1504bd26a74