|
|
Subscribe / Log in / New account

Edmundson: Plasma and the systemd startup

On his blog, David Edmundson writes about a new optional mechanism for starting up the KDE Plasma desktop using systemd. "Another big motivating factor was the ability for customisation. The root of Plasma's startup is very hardcoded. What if you want to run krunner with a different environment variable set? or have a script run every time plasmashell restarts, or show a UI after kwin is loaded but before plasma shell to perform some user setup? You can edit the code, but that's not easy and you're very much on your own. Systemd provides that level of customisation; both at a distro or a user level out of the box. From our POV for free."

to post comments

It's about time

Posted Oct 1, 2020 18:18 UTC (Thu) by HelloWorld (guest, #56129) [Link] (3 responses)

I don't even know how often I've seen Shutdown hang because it waits for a user session to terminate. I'm confident that this will work a lot more reliably with systemd. Great work, guys!

It's about time

Posted Oct 2, 2020 1:52 UTC (Fri) by pabs (subscriber, #43278) [Link] (1 responses)

GNOME's systemd-based session setup seems to work just fine.

It's about time

Posted Oct 2, 2020 11:34 UTC (Fri) by rahulsundaram (subscriber, #21946) [Link]

KDE's work here is based on the work that Red Hat did with generating systemd service files out of desktop files for GNOME as noted in the blog. The underlying setup is the same and the benefits should be identical.

It's about time

Posted Oct 3, 2020 2:30 UTC (Sat) by jtgeibel (subscriber, #65153) [Link]

> I don't even know how often I've seen Shutdown hang because it waits for a user session to terminate.

I had never run into this before, until this week I decided to try out plasma on wayland. The experience was pretty good overall, with a few bugs, and this (or something similar) seemed to be one of them. When rebooting it took about 30 seconds for the session to exit and for things to proceed as normal. (Current sample size of 1 reboot after 2 or 3 days of usage.)

In any case, I'm excited about systemd startup as well. It sounds like it will consolidate and simplify some things, and may address bugs like this.

Edmundson: Plasma and the systemd startup

Posted Oct 1, 2020 20:21 UTC (Thu) by mathstuf (subscriber, #69389) [Link] (1 responses)

Oh, good to see the big DEs finally start using systemd units for user session things. I was probably one of the first people who got their session fully unit-based as I was hitting bugs no one else was seeing at the time (started in 2013 and deployed to all my machines in 2015 after enough testing on one of my machines). The thing is that the `.target` setup needs some unification between DEs to truly be able to pull various bits together reliably. I personally have custom unit files for my session and ignore non-dbus unit files provided by upstream because I have a different target layout than they tend to expect.

Points of interop I have:

environment.target: target for any units which interact with environment variables; is generally a requirement from whatever session is in use
shell.target: shell session (TTY)
wayland.target: Wayland session (for whenever I get around to migrating)
x11-environment.target: environment variable settings for X11-requiring tools
x11-minimal.target: X11 session ("safe mode")
x11-standard.target: X11 session: adds nice-to-have things like the background timer, dunst, etc.
x11-wm.target: anything the WM for X11 needs itself
xorg.target: starts the X server itself

Other targets I use (for reference):

backup.target: Backup timer units attach here
mail.target: Mail-related unit files
xlock.target: Sets up xlock and the autolocker
xmobar.target: Starts all of the xmobar instances I need (one per physical monitor)

Edmundson: Plasma and the systemd startup

Posted Oct 8, 2020 11:51 UTC (Thu) by emorrp1 (guest, #99512) [Link]

You're not far off the cross-desktop design that's coalescing at https://systemd.io/DESKTOP_ENVIRONMENTS/ perhaps you can provide feedback on that before it's stabilised.

Edmundson: Plasma and the systemd startup

Posted Oct 1, 2020 21:09 UTC (Thu) by mikemol (guest, #83507) [Link] (4 responses)

I wonder if this will enable placing resource prioritizations and constraints on memory, CPU and disk IOPs.

Edmundson: Plasma and the systemd startup

Posted Oct 1, 2020 21:39 UTC (Thu) by HelloWorld (guest, #56129) [Link] (3 responses)

Yes, you can customize the units using the familiar systemd mechanisms, e. g. drop-in snippets.

Edmundson: Plasma and the systemd startup

Posted Oct 2, 2020 5:45 UTC (Fri) by zdzichu (subscriber, #17118) [Link] (2 responses)

Except user systemd instance cannot raise priorities, only lower them. To prioritise you still need something external, like uresourced.

Edmundson: Plasma and the systemd startup

Posted Oct 2, 2020 14:24 UTC (Fri) by d_ed (guest, #142332) [Link] (1 responses)

It can!

One of the cool parts of cgroups and slices is that you can raise relative to your siblings.
So I can't raise kwin above sshd or cups or whatever, but I can raise it relative to firefox or whatever else you have running in your session slice.

It's one of the things we're really hoping to make use of here.

Edmundson: Plasma and the systemd startup

Posted Oct 2, 2020 14:27 UTC (Fri) by mikemol (guest, #83507) [Link]

Cool. I knew of cgroups' capabilities, but wasn't sure whether special permissions were required to set them up.

Looking forward to trying this out on my Gentoo system!

Great Stuff

Posted Oct 2, 2020 0:29 UTC (Fri) by warrax (subscriber, #103205) [Link]

Fantastic to see the full potential of systemd start to be used by my preferred desktop!

Edmundson: Plasma and the systemd startup

Posted Oct 5, 2020 17:14 UTC (Mon) by gdamjan (subscriber, #33634) [Link] (1 responses)

Do login managers (sddm, gdm) have the capability to start a "systemd --user" target directly and wait on it? Or we need to start some kind of a script that does `systemctl --wait --user start my-de.service` ?

Edmundson: Plasma and the systemd startup

Posted Oct 6, 2020 1:16 UTC (Tue) by mathstuf (subscriber, #69389) [Link]

I asked for it years ago from sddm, but haven't seen traction. It could be buried under other reports at this point though.

What I do is have bash set up to do tlock for interactive sessions so that when I login via the TTY, stopping X isn't an instant shell. I then have a default.target symlink to x11-standard.target (see my other comment on this article) and systemd-logind takes it from there (assuming, but it's probably involved) and everything starts up nicely. Sure, there's no nice login manager, but for laptops, sleep is via the lid, the power button works as you'd expect and nobody else uses my machines. Desktops are pretty much the same except I tend not to put them to sleep.


Copyright © 2020, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds