[Pkg-utopia-maintainers] Bug#1027136: xdg-desktop-portal: User service is not stopped when uninstalling xdg-desktop-portal

Darshaka Pathirana dpat at syn-net.org
Wed Jan 4 15:14:51 GMT 2023


On 2022-12-28 19:11, Simon McVittie wrote:
> On Wed, 28 Dec 2022 at 12:23:46 +0100, Darshaka Pathirana wrote:
>>   ❯ systemctl status --user stop xdg-desktop-portal
>>   Unit stop.service could not be found.
>
> This is the wrong command, hence the error message. Use:
>
>     systemctl --user stop xdg-desktop-portal.service
>
> You can omit the .service extension as a shorthand, but you can't combine
> status and stop in one command.

Oh, thx for the pointer, "status" was added by mistake.

I was in the "belief" (*sigh*, sorry!), that the service can not be
stopped, once the service file / package has been removed. I took the
error message as is.

FTR, this it how it looks like after the packages is removed (and after
the user service was started before):

  ❯ sudo apt remove xdg-desktop-portal

  ❯ ps -ax | grep xdg-desktop-portal
   223206 ?        Ssl    0:00 /usr/libexec/xdg-desktop-portal
   224646 pts/50   S+     0:00 grep --color=auto xdg-desktop-portal

  ❯ systemctl --user status xdg-desktop-portal
  Warning: The unit file, source configuration file or drop-ins of xdg-desktop-portal.service changed on disk. Run 'systemctl --user daemon-reload' to reload units.
  ● xdg-desktop-portal.service - Portal service
       Loaded: loaded (/usr/lib/systemd/user/xdg-desktop-portal.service; bad; vendor preset: enabled)
       Active: active (running) since Wed 2023-01-04 15:26:29 CET; 15min ago
     Main PID: 223206 (xdg-desktop-por)
        Tasks: 5 (limit: 18880)
       Memory: 1.7M
          CPU: 374ms
       CGroup: /user.slice/user-1000.slice/user at 1000.service/app.slice/xdg-desktop-portal.service
               └─223206 /usr/libexec/xdg-desktop-portal

  Jan 04 15:26:29 executor systemd[4802]: Starting Portal service...
  Jan 04 15:26:29 executor systemd[4802]: Started Portal service.

  ❯ systemctl --user stop xdg-desktop-portal
  Warning: The unit file, source configuration file or drop-ins of xdg-desktop-portal.service changed on disk. Run 'systemctl --user daemon-reload' to reload units.

  ❯ systemctl --user status xdg-desktop-portal
  Unit xdg-desktop-portal.service could not be found.

  at 2023-01-04 15:39:42 +01:00 ❯ ps -ax | grep xdg-desktop-portal
   238026 pts/50   S+     0:00 grep --color=auto xdg-desktop-portal

>> I think (the) xdg-desktop-portal user service(s) should be stopped before
>> removing the package. Is that possible?
>
> Not really: maintainer scripts happen in the context of the overall system
> (as root) and there is not really a good way to inject service-management
> commands into user sessions. Other per-user services like PulseAudio,
> Pipewire, gpg-agent and so on are not stopped when you remove them either.

Ok. After all, the user one *can* manually stop the service after the
package has been removed.

And: "Failed connect to PipeWire: Couldn't connect to PipeWire" was
also not shown anymore, after I started "xdg-desktop-portal".

All is good. Please close the bug (and mark it as obsolete/invalid, if possible.
I could not find how to do it).

Thx for your support!

Best,
 - Darsha
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-utopia-maintainers/attachments/20230104/41d83096/attachment.sig>


More information about the Pkg-utopia-maintainers mailing list