Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 662330 - net-im/telegram-desktop-bin wrapper to stop auto-updates defeated by kde session manager
Summary: net-im/telegram-desktop-bin wrapper to stop auto-updates defeated by kde sess...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Henning Schild
URL: https://github.com/telegramdesktop/td...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-28 09:37 UTC by Henning Schild
Modified: 2018-08-17 06:27 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Henning Schild 2018-07-28 09:37:48 UTC
In 1.3.10 telegram-desktop-bin gained a command line argument to disable its built-in updater. https://bugs.gentoo.org/618662 introduced an ebuild that should make sure the real application is always called with that commmand line argument.

Plasma/KDE5 has a session management feature where it restarts previously running applications after a re-login. That mechanism will remember the real binary and execute it without the command line argument.

Steps to reproduce:
- install telegram-desktop-bin and plasma
- start a plasma session and start telegram-desktop-bin
- confirm with ps that the argument was passed
- log out or plasma and log in again
- now telegram-desktop-bin will be running without the argument ...

I already tried giving the wrapper and the real application the same name, did not work ... plasma must remember the absolute path and restart that.
I also tried not using exec in the shell wrapper, hoping plasma would see the parent child relationship and restart the parent ... no success.
Comment 1 Henning Schild 2018-07-28 09:54:06 UTC
After logging in again the application with have a "-session XXXX" command line argument. Native plasma application seem to remember their settings and will know how to handle the session parameter.
But it seems wrong to expect any application to know how to deal with that, instead the session manager should make an effort to remember the command line arguments together with the binary it restarts.

So this could be a plasma bug. Maybe there is a trick to store the arguments somewhere and make that depend on the "kde" USE-flag.

I would appreciate a comment from kde/plasma devs/maintainers and maybe comments from users other gnome, xfce, ... are you affected as well?
Comment 2 Henning Schild 2018-07-28 14:42:42 UTC
I did some research and now think that telegram-desktop-bin does not implement the X11 session management correctly. It seems to register itself but fails to save its state or arguments.

So i opened an issue upstream
https://github.com/telegramdesktop/tdesktop/issues/5022

And proposed a patch to exclude it from session management until the problem is fixed. See previous comment.
Comment 3 Larry the Git Cow gentoo-dev 2018-08-17 06:27:40 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ffba6cf7974723a4a75bc61384556a1d093662ca

commit ffba6cf7974723a4a75bc61384556a1d093662ca
Author:     Henning Schild <henning@hennsch.de>
AuthorDate: 2018-07-28 14:05:42 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2018-08-17 06:26:17 +0000

    net-im/telegram-desktop-bin: exclude from session management
    
    The application seems to register with the X11 session manager but fails
    to follow the protocol for remembering its state. The result is that a
    session manager will restart it, and during that process the command
    line argument for disabling the internal updater gets lost.
    So on a restarted session the updater will be enabled again.
    
    Do not let the application register at the session manager in the first
    place, by unsetting the env variable used to find it.
    
    Closes: https://bugs.gentoo.org/662330
    Closes: https://github.com/gentoo/gentoo/pull/9366
    Signed-off-by: Henning Schild <henning@hennsch.de>

 .../files/telegram-desktop-bin-r1                  |  9 ++++
 .../telegram-desktop-bin-1.3.10-r1.ebuild          | 59 ++++++++++++++++++++++
 2 files changed, 68 insertions(+)