Bug 476647 - xdg-portal-desktop-kde start after xdg-portal-desktop, if it even starts
Summary: xdg-portal-desktop-kde start after xdg-portal-desktop, if it even starts
Status: REPORTED
Alias: None
Product: xdg-desktop-portal-kde
Classification: Plasma
Component: general (show other bugs)
Version: 5.27.9
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-06 22:03 UTC by Dennis
Modified: 2024-01-07 06:44 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis 2023-11-06 22:03:40 UTC
SUMMARY

I have this problem on all of my Arch Linux systems, and they are installed at different time, one is only a few weeks old.
The problem is that the user service "xdg-portal-desktop-kde.service" starts before the service "xdg-portal-desktop.service".

I have tried to search on the web, but without any real luck.

STEPS TO REPRODUCE
1. Reboot the computer and login into a user
2. Run system "systemctl --user status plasma-xdg-desktop-portal-kde.service xdg-desktop-portal.service"

OBSERVED RESULT
```text
○ plasma-xdg-desktop-portal-kde.service - Xdg Desktop Portal For KDE
     Loaded: loaded (/usr/lib/systemd/user/plasma-xdg-desktop-portal-kde.service; static)
     Active: inactive (dead)

● xdg-desktop-portal.service - Portal service
     Loaded: loaded (/usr/lib/systemd/user/xdg-desktop-portal.service; static)
     Active: active (running) since Mon 2023-11-06 21:55:47 CET; 9s ago
   Main PID: 756 (xdg-desktop-por)
      Tasks: 6 (limit: 18586)
     Memory: 6.9M
        CPU: 36ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/xdg-desktop-portal.service
             └─756 /usr/lib/xdg-desktop-portal

Nov 06 21:55:47 my-pc systemd[698]: Starting Portal service...
Nov 06 21:55:47 my-pc xdg-desktop-por[756]: No skeleton to export
Nov 06 21:55:47 my-pc systemd[698]: Started Portal service.
```

EXPECTED RESULT
```text
● plasma-xdg-desktop-portal-kde.service - Xdg Desktop Portal For KDE
     Loaded: loaded (/usr/lib/systemd/user/plasma-xdg-desktop-portal-kde.service; static)
     Active: active (running) since Mon 2023-11-06 22:34:06 CET; 5s ago
   Main PID: 4875 (xdg-desktop-por)
      Tasks: 5 (limit: 18586)
     Memory: 18.9M
        CPU: 65ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/plasma-xdg-desktop-portal-kde.service
             └─4875 /usr/lib/xdg-desktop-portal-kde

Nov 06 22:34:06 my-pc systemd[698]: Starting Xdg Desktop Portal For KDE...
Nov 06 22:34:06 my-pc systemd[698]: Started Xdg Desktop Portal For KDE.

● xdg-desktop-portal.service - Portal service
     Loaded: loaded (/usr/lib/systemd/user/xdg-desktop-portal.service; static)
     Active: active (running) since Mon 2023-11-06 22:34:06 CET; 5s ago
   Main PID: 4878 (xdg-desktop-por)
      Tasks: 8 (limit: 18586)
     Memory: 4.4M
        CPU: 18ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/xdg-desktop-portal.service
             └─4878 /usr/lib/xdg-desktop-portal

Nov 06 22:34:06 my-pc systemd[698]: Starting Portal service...
Nov 06 22:34:06 my-pc systemd[698]: Started Portal service.
```

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: ArchLinux/5.27.9
(available in About System)
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.111.0
Qt Version: 5.15.11

ADDITIONAL INFORMATION

My current workaround is to create the following 2 files:

/usr/lib/systemd/user/plasma-xdg-desktop-portal-kde.service.d/override.conf

```ini
[Unit]
Before=xdg-desktop-portal.service
Upholds=xdg-desktop-portal.service

[Service]
# Environment=QT_LOGGING_RULES=*.debug=true QT_DEBUG_PLUGINS=1

[Install]
WantedBy=plasma-workspace.target
```

/usr/lib/systemd/user/xdg-desktop-portal.service.d/override.conf

```ini
[Unit]
BindsTo=plasma-xdg-desktop-portal-kde.service
PartOf=plasma-xdg-desktop-portal-kde.service

[Service]
# Environment="G_MESSAGES_DEBUG=all"

Restart=on-failure
```

and enable the service `plasma-xdg-desktop-portal-kde.service` by running

```bash
systemctl --user enable plasma-xdg-desktop-portal-kde.service
```