Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xdg-autostart-service: handle gnome autostart phase better on other d… #26379

Merged

Conversation

davidedmundson
Copy link
Contributor

@davidedmundson davidedmundson commented Feb 9, 2023

Autostart files which contain the line gnome-autostart-phase are currently completely skipped by systemd. This is because these are handled internally by gnome startup through other means.

The problem is a number of desktop files that need to run on kde too have this flag set. Ideally they should just create systemd user units, but we're not at this point universally yet.

This patch changes the logic so if the flag is set, we set NotShowIn-gnome, which in turn would just not load decided at runtime.

As an optimisation if we would get conflicting OnlyShowIn lines we still skip the file completely.

@github-actions github-actions bot added the please-review PR is ready for (re-)review by a maintainer label Feb 9, 2023
@davidedmundson
Copy link
Contributor Author

@benzea

CC: #18791

@github-actions
Copy link

github-actions bot commented Feb 9, 2023

We had successfully released a new major release. We are no longer in a development freeze phase.
We will try our best to get back to your PR as soon as possible. Thank you for your patience.

Copy link
Contributor

@benzea benzea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me.

src/xdg-autostart-generator/xdg-autostart-service.c Outdated Show resolved Hide resolved
@poettering poettering added reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks and removed please-review PR is ready for (re-)review by a maintainer labels Feb 22, 2023
@YHNdnzj
Copy link
Member

YHNdnzj commented Mar 31, 2023

ping?

@keszybz
Copy link
Member

keszybz commented Apr 27, 2023

I'll rebase the patch.

…esktops

Autostart files which contain the line gnome-autostart-phase are currently
completely skipped by systemd. This is because these are handled internally by
gnome startup through other means.

The problem is a number of desktop files that need to run on KDE too have this
flag set. Ideally they should just create systemd user units, but we're not at
this point universally yet.

This patch changes the logic so if the flag is set, we set NotShowIn-gnome,
which in turn would just not load decided at runtime.

As an optimisation if we would get conflicting OnlyShowIn lines we still
skip the file completely.

Example:
  $ rg 'Exec|Autostart-Phase' /etc/xdg/autostart/gnome-keyring-pkcs11.desktop
  Exec=/usr/bin/gnome-keyring-daemon --start --components=pkcs11
  X-GNOME-Autostart-Phase=PreDisplayServer

  $ cat '/tmp/xxx/app-gnome\x2dkeyring\x2dpkcs11@autostart.service'
  # Automatically generated by systemd-xdg-autostart-generator
  [Unit]
  SourcePath=/etc/xdg/autostart/gnome-keyring-pkcs11.desktop
  ...
  [Service]
  ...
  ExecCondition=/usr/lib/systemd/systemd-xdg-autostart-condition "Unity:MATE" "GNOME"

Co-authored-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
@keszybz keszybz force-pushed the work/xdg-generator-gnome-phases branch from 3f66da5 to 03e19a7 Compare April 27, 2023 13:44
@keszybz
Copy link
Member

keszybz commented Apr 27, 2023

Updated with the requested changes and some trivial cleanups.

@github-actions github-actions bot added please-review PR is ready for (re-)review by a maintainer and removed reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks labels Apr 27, 2023
@YHNdnzj YHNdnzj added good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed and removed please-review PR is ready for (re-)review by a maintainer labels Apr 27, 2023
@YHNdnzj YHNdnzj merged commit c63dde8 into systemd:main Apr 28, 2023
45 of 47 checks passed
@github-actions github-actions bot removed the good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed label Apr 28, 2023
@benzea
Copy link
Contributor

benzea commented Apr 28, 2023

Thanks everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

xdg-autostart-generator: unconditionally ignores items with X-GNOME-Autostart-Phase
6 participants