Autostart files with X-GNOME-Autostart-Phase entry in GNOME 49

In GNOME 49, I notice that autostart files with an X-GNOME-Autostart-Phase entry produce messages such as the following in journalctl:

App gnome-keyring-pkcs11.desktop sets X-GNOME-Autostart-Phase, but gnome-session no longer manages session services

While I don’t understand the details, I suppose this relates to the closer systemd integration, and perhaps X-GNOME-Autostart-Phase just doesn’t make sense anymore. But is there any other way to run an autostart earlier now? Or an alternative entirely (systemd services perhaps)?

Yes, anything that was relying on desktop file autostart for services will need to provide proper systemd service files instead now.

Thanks @alatiera , good to know!

One update that might be useful to others. I saw this post and came to an incorrect conclusion based on this (that autostarting in Fedora 43 with GNOME 49 by placing desktop files in /etc/xdg/autostart no longer works, and must be converted to a systemd user unit).

In Fedora, you can continue to auto-start applications by placing a *.desktop file in /etc/xdg/autostart if you remove the line:

X-GNOME-Autostart-Phase=WindowManager

Then auto-starting via desktop file works fine and is just handled (as it always has been on Fedora) via systemd-xdg-autostart-generator. One thing that apparently gave systemd-xdg-autostart-generator difficulties were boolean values being capitalized in the *.desktop file (needed to change them from “True” to “true” and from “False” to “false”).

2 Likes

It still works to autostart for applications, gnome-session is no longer starting services (which you distinguish cause they have X-GNOME-Autostart-Phase set).

Please beware that this is not a workaround. It might be working fine for you today but if that’s the case its by accident so far and not something supported.

It’s supported by systemd, and it’s part of how systemd works for user sessions. It’s a perfectly valid way to do things. Unless there’s a plan to make GNOME sessions incompatible with the xdg-autostart generator, I don’t see a reason why people wouldn’t use it.

It’s supported by systemd

No, it’s not. When X-GNOME-Autostart-Phase is set, systemd explicitly avoids starting the .desktop file on GNOME. Because gnome-session was responsible for handling these .desktop files

Unless there’s a plan to make GNOME sessions incompatible with the xdg-autostart generator

Also, GNOME doesn’t use the xdg-autostart generator

1 Like

Sure, but if the line is omitted, it can be handled by systemd. If it was never needed in the first place, then dropping it makes sense and then systemd can handle it.

Again, we don’t use xdg-autostart-generator in GNOME

But anyway, the rule is simple: we do XDG autostart for apps (which is what the spec is for), and we rely on systemd to manage services. The fact that we historically abused .desktop files to launch session services just makes no sense anymore because nowadays we have user session service managers

We don’t have a magic way to tell what’s a service and what’s not. So our heuristic is to see if it does “service-like” things. Setting a specific moment when it’s safe to start the service is a service-like thing to do. That’s why we block it.

You can’t assume that deleting X-GNOME-Autostart-Phase is a fine thing to do from any given .desktop file. So it’s not a general-purpose workaround. If you’ve got an app with no special requirements but has X-GNOME-Autostart-Phase set, then sure removing it is fine and it being there at all is a mistake in the first place.

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.