Background: I have a laptop running Debian testing/unstable and booting with systemd. It's got a normal laptop magnetic hard drive (not an SSD). The machine is set to auto-login when turned on, so it goes straight from system bootup, to desktop loading—which is KDE 5, not exactly lightweight.
There are a few daemons I'd like to set to only start after the desktop is fully loaded (e.g., PostgreSQL, exim, apache, …) to get a usable desktop quicker. "Desktop fully loaded" can be detected fairly easily: the disk goes idle.
Question: Is there some systemd feature for launching system daemons only once the desktop is fully up? I've looked through the docs, and there doesn't seem to be anything after
graphical.target. I feel I must be missing something, with all the features systemd has.
A few things I've thought of:
- PostgreSQL at least does not support socket activation, so that's not an option.
- There are
Type=idleservices, but it sounds like that'd maybe wait until
sddmis started, but not until the desktop is loaded.
- Write a service that is wanted by
graphical.targetthat checks every 10s for the amount of disk activity, and if there is none, uses systemctl to start a
local-idle.targetor similar (then exists). Trying to avoid this one.