Make SDDM pause before starting

Hi,

I’m running Rocky Linux 8.7 with KDE and SDDM from EPEL. Works fine on all my machines. Now I installed it on an old iMac with a legacy NVidia card. Starting X manually (systemctl isolate graphical.target) works fine, but SDDM fails to start on boot. As far as I understand, the nouveau module isn’t loaded fast enough.

I tried to copy over /usr/lib/systemd/system/sddm.service to /etc/systemd/system and then edited the service section like this to make SDDM pause:

[Service]
ExecStartPre /usr/bin/sleep 10
ExecStart=/usr/bin/sddm
Restart=always
EnvironmentFile=-/etc/sysconfig/sddm

No joy with this unfortunately.

GDM and LightDM work fine, but GDM installs the whole GNOME kitchen sink and LightDM is butt ugly.

Any idea how I can make SDDM behave here ?

Intuitively, I’d ask what makes kernel module load? If you wait a fixed time, it does not ensure that the load completes, or even starts before the deadline.

Rather than waiting for a time, a systemd unit can be set to wait until another (required) unit is complete. If there is no unit that loads kernel module, then option B could be to modprobe in ExecStartPre.

Rather than copy&edit one should be able to run
systemctl edit sddm.service
and edit buffer to contain (for example):

[Service]
ExecStartPre /usr/bin/sleep 10

The result gets saved as “drop-in file”:
/etc/systemd/system/sddm.service.d/override.conf
and overrides(1) parts of /usr/lib/systemd/system/sddm.service

(The systemctl --full edit sddm.service would do the copy&edit.)

(1) ExecStartPre probably appends, as it can be many times. See systemd.service

1 Like

Here’s a solution that works perfectly, and which I found on the Red Hat Bugzilla:

Create /etc/systemd/system/sddm.timer and edit it:

[Unit]
Description=Start sddm service fixed time after boot

[Timer]
OnStartupSec=7
Unit=sddm.service

[Install]
WantedBy=multi-user.target

And then :slightly_smiling_face:

# systemctl disable sddm.service
# systemctl enable sddm.timer

I had to fiddle a bit to get the value right, but now it works like a charm.

Thanks !

1 Like