diff --git a/gmenu-dbusmenu-proxy/plasma-gmenudbusmenuproxy.service.in b/gmenu-dbusmenu-proxy/plasma-gmenudbusmenuproxy.service.in index ba9193b52..8b4a424b8 100644 --- a/gmenu-dbusmenu-proxy/plasma-gmenudbusmenuproxy.service.in +++ b/gmenu-dbusmenu-proxy/plasma-gmenudbusmenuproxy.service.in @@ -1,6 +1,7 @@ [Unit] Description=Proxies GTK DBus menus to a Plasma readable format PartOf=graphical-session.target +After=plasma-core.target [Service] ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/gmenudbusmenuproxy diff --git a/ksmserver/plasma-restoresession.service.in b/ksmserver/plasma-restoresession.service.in index db5c01b1e..7a0420828 100644 --- a/ksmserver/plasma-restoresession.service.in +++ b/ksmserver/plasma-restoresession.service.in @@ -1,9 +1,9 @@ [Unit] Description=KDE Session Management Server -After=plasma-ksmserver.service plasma-xembedsniproxy.service plasma-gmenudbusmenuproxy.service +After=graphical-session.target +RefuseManualStart=yes [Service] Type=oneshot ExecStart=-@QtBinariesDir@/qdbus org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.restoreSession Slice=session.slice -RefuseManualStart=yes diff --git a/startkde/systemd/CMakeLists.txt b/startkde/systemd/CMakeLists.txt index f475372fe..e71e3d378 100644 --- a/startkde/systemd/CMakeLists.txt +++ b/startkde/systemd/CMakeLists.txt @@ -1,7 +1,7 @@ ecm_install_configured_files(INPUT plasma-ksplash-ready.service.in @ONLY DESTINATION ${SYSTEMD_USER_UNIT_INSTALL_DIR}) -install(FILES plasma-core@.target DESTINATION ${SYSTEMD_USER_UNIT_INSTALL_DIR}) +install(FILES plasma-core.target DESTINATION ${SYSTEMD_USER_UNIT_INSTALL_DIR}) install(FILES plasma-workspace@.target DESTINATION ${SYSTEMD_USER_UNIT_INSTALL_DIR}) add_executable(kde-systemd-start-condition kde-systemd-start-condition.cpp) diff --git a/startkde/systemd/README.md b/startkde/systemd/README.md new file mode 100644 index 000000000..41dce4b31 --- /dev/null +++ b/startkde/systemd/README.md @@ -0,0 +1,30 @@ +# Startup + +Startup can be summarised as being: + +plasma-core.target +plasma-workspace@.target +graphical-session.target + +plasma-workspace@ is the target explicitly activated. + +## X11 and wayland + +plasma-workspace@ is a template file that ends with x11 or wayland. That will then require the correct kwin_ +startup order can be different between the two. + +## Wants & Order +Note that in systemd dependencies (wants/wantedby) counter-intuitively do not determine order. + +plasma-workspace wants graphical-session, meaning it will make it something started by it, but it also explicitly comes before graphical-session. + +The order of events is: +plasma-core does anything that adjusts environment variables +plasma-workspace@ starts all runtime services +graphical-session is at a point where everything including runtime services are up + +## Adding a new service + +If it should only be used on plasma it should be wanted by plasma-core or plasma-workspace@. + +That service is responsible for setting "After=plasma-core.target" if we need envs set up. diff --git a/startkde/systemd/plasma-core.target b/startkde/systemd/plasma-core.target new file mode 100644 index 000000000..59eb19442 --- /dev/null +++ b/startkde/systemd/plasma-core.target @@ -0,0 +1,7 @@ +[Unit] +Description=KDE Plasma Workspace Core +Wants=plasma-plasmashell.service plasma-kcminit.service plasma-kded.service plasma-kcminit-phase1.service graphical-session-pre.target +Requires=plasma-ksmserver.service +BindsTo=plasma-ksmserver.service +After=graphical-session-pre.target +RefuseManualStart=yes diff --git a/startkde/systemd/plasma-core@.target b/startkde/systemd/plasma-core@.target deleted file mode 100644 index 182a962bb..000000000 --- a/startkde/systemd/plasma-core@.target +++ /dev/null @@ -1,6 +0,0 @@ -[Unit] -Description=KDE Plasma Workspace Core -Wants=plasma-plasmashell.service plasma-kwin_%i.service plasma-kcminit.service plasma-kded.service plasma-kcminit-phase1.service graphical-session-pre.target -Requires=plasma-ksmserver.service -BindsTo=plasma-ksmserver.service -After=graphical-session-pre.target diff --git a/startkde/systemd/plasma-workspace@.target b/startkde/systemd/plasma-workspace@.target index d6c2a7e6d..1fa6440d3 100644 --- a/startkde/systemd/plasma-workspace@.target +++ b/startkde/systemd/plasma-workspace@.target @@ -1,6 +1,6 @@ [Unit] Description=KDE Plasma Workspace -Requires=plasma-core@%i.target plasma-ksplash-ready.service +Requires=plasma-kwin_%i.service plasma-core.target xdg-desktop-autostart.target graphical-session.target +Wants=plasma-restoresession.service plasma-xembedsniproxy.service plasma-gmenudbusmenuproxy.service plasma-powerdevil.service plasma-ksplash-ready.service BindsTo=graphical-session.target -Wants=xdg-desktop-autostart.target plasma-xembedsniproxy.service plasma-gmenudbusmenuproxy.service plasma-restoresession.service -After=plasma-core.target +Before=graphical-session.target xdg-desktop-autostart.target plasma-ksplash-ready.service plasma-restoresession.service diff --git a/xembed-sni-proxy/plasma-xembedsniproxy.service.in b/xembed-sni-proxy/plasma-xembedsniproxy.service.in index fd916f401..61090fd00 100644 --- a/xembed-sni-proxy/plasma-xembedsniproxy.service.in +++ b/xembed-sni-proxy/plasma-xembedsniproxy.service.in @@ -1,6 +1,7 @@ [Unit] Description=Handle legacy xembed system tray icons PartOf=graphical-session.target +After=plasma-core.target [Service] ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/xembedsniproxy