Systemd Startup
AbandonedPublic

Authored by nicolasfella on Mar 26 2020, 11:38 AM.

Details

Summary

This brings numerous advantages such as:

  • easier admin configuration with drop-ins, overrides and multiple hooks throughout (and only having to learn one tool)
  • session cleanup on exit, avoiding that occasional part where shutdown hangs
  • startup that actually knows when things are up
  • race free autostart and DBus activation at once
  • logs that rotate are split by service and usable
  • resource management through slices and cgroups (the part I want)

Over the past 2 years I've been trying to tidy up and encapsulate the
relevant parts of startup into the binary plasma-session so that we can
just runtime swap out that one part and supporting both paths will be
easy.

Support is toggleable via cmake flag, as it seems like it should be a
distro decision, especially as we will require a specific systemd with
the xdg-generator.

KDED/kwin/other services are attached to the relevant repo.

It is WIP as:

  • it requires unmerged generator for regular autostart files
  • There are outstanding tasks, see below

Task T11914

Uploaded to get more people on board and also because merging master
into a feature branch is becoming really annoying.

Given it's cmake guarded, I'm also up for merging before completion if
others are happy?

Diff Detail

Repository
R120 Plasma Workspace
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 24485
Build 24503: arc lint + arc unit
Restricted Application added a project: Plasma. · View Herald TranscriptMar 26 2020, 11:38 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
davidedmundson requested review of this revision.Mar 26 2020, 11:38 AM
davidedmundson edited the summary of this revision. (Show Details)Mar 26 2020, 11:39 AM
davidedmundson edited the summary of this revision. (Show Details)Mar 26 2020, 11:43 AM

add comments explaining some code

In terms of testing, you will need:

  • this patch
  • to rerun ./login-sessions/install-sessions.sh
  • cherry-picked the relevant repos in kded, kwin, kactivitymanagerd

This will give you a basic session, for everything , you'll also want

optionally for full autostart for 3rd party things like next cloud and stuff:

ahiemstra added inline comments.
krunner/CMakeLists.txt
44

This pattern is repeated multiple times, maybe we should make a macro out of it? Like install_systemd_service_file(source_file)

apol added a subscriber: apol.Mar 26 2020, 12:18 PM

Change looks good to me overall +1

ksmserver/ksmserver.service.cmake
8 ↗(On Diff #78541)

Why is there a - here after the =?

login-sessions/plasmawayland-dev.desktop.cmake
2

Is this change related?

shell/org.kde.plasmashell.desktop.cmake
55

We probably want it always hidden?

krunner/CMakeLists.txt
44

that's a good idea

ksmserver/ksmserver.service.cmake
8 ↗(On Diff #78541)

there's a comment above that line

login-sessions/plasmawayland-dev.desktop.cmake
2

Related, yes.
Is this the right commit for it, probably not.

If we nest another dbus-session inside the system one everything gets confused.

Start dbus-manually shouldn't be our repsonsibility but apparently it's needed on some setups that don't have the combined systemd+dbus setups. See 404335

shell/org.kde.plasmashell.desktop.cmake
55

Right, this line currently does nothing.

It's meant to tell the systemd generator to skip this as we have a unit already, but we're going to use a common prefix at some point.

hchain added a subscriber: hchain.Mar 26 2020, 12:59 PM
hchain added inline comments.
login-sessions/plasmawayland-dev.desktop.cmake
2

does that still work in legacy (non-systemd) mode ?

shell/org.kde.plasmashell.desktop.cmake
55

maybe add a comment that this file is superseded in systemd-mode by a custom service and we don't want the systemd generator to make another one for us

hchain added inline comments.Mar 26 2020, 1:06 PM
login-sessions/plasmawayland-dev.desktop.cmake
2
hchain added inline comments.Mar 26 2020, 1:29 PM
startkde/startplasma.cpp
404

unrelated change ?

davidedmundson marked 2 inline comments as done.Mar 30 2020, 4:35 PM

Add xembedsniproxy and gdbusmenuproxy

support x11 and wayland ...ish

we now call target plasma-workspace@x11 or plasma-workspace@wayland it then can call the right services
but kwin_wayland is still currently spawned before the systemd stuff

hchain added inline comments.Apr 17 2020, 5:23 PM
startkde/plasma-core@.target
3 ↗(On Diff #80412)

can we make this plasma-kwin@%i.service ?

davidedmundson added inline comments.Apr 17 2020, 5:34 PM
startkde/plasma-core@.target
3 ↗(On Diff #80412)

can do, the _ is just to match the binary name

nicolasfella commandeered this revision.Oct 7 2020, 1:18 PM
nicolasfella abandoned this revision.
nicolasfella added a reviewer: davidedmundson.