lxqt / lxqt-session

The LXQt session manager
https://lxqt.github.io
GNU Lesser General Public License v2.1
57 stars 52 forks source link

#374 breaks tmux #376

Open yan12125 opened 3 years ago

yan12125 commented 3 years ago
Expected Behavior

tmux server created inside LXQt persists after logging out and can be attached later

Current Behavior

Since #374, the tmux server is gone upon logging out

Possible Solution
Steps to Reproduce (for bugs)
  1. Run qterminal from within LXQt (click the quicklaunch button in my case)
  2. Run tmux
  3. Detach the tmux session. Now the tmux server is a sub-process of lxqt-session. Here are partial outputs of pstree:
        │                        └─lxqt-session─┬─
        │                                       ├─tmux: server───zsh
  4. Log out of the LXQt session
Context

I wanted to observe how proccese are killed #374 by running journalctl --follow in tmux.

System Information
tsujan commented 3 years ago

Check how other desktop environments work?

I think other DEs may do nothing, other than stopping some of their own processes. I've seen Gnome/KDE processes that persisted after logging out of them (and took lots of CPU time until I killed them in LXQt). That's not what we want.

IMHO, https://github.com/lxqt/lxqt-session/pull/374 is an elegant and clean solution. A list that can be edited/provided by the user and also a few hard-coded exceptions might solve this problem.

stefonarch commented 3 years ago

I think starting processes that are thought to survive the session is a dev-only thing - an average user doesn't do it.

palinek commented 3 years ago

We have few options here I can imagine now:

  1. create a specific whitelist/regexp configuration of app names in session configuration
  2. in lxqt-session examine some flag of the process (easiest way for linux would be to examine env. vars of the process and in case some well defined variable exists...let the process alone; the drawback here is, that in BSD I don't know about the possibility to examine env. vars of other/child process)
  3. in lxqt-session check the "well-defined" env. var for whitelist/regexp app names (most easy portable implementation - configuration of env. vars for session is done; but a bit hidden for the end user)

For now the easiest way is to let the "parent" process of "need to live" process to be alive and that should ignore the TERM signal -> then our "need to live" process will survive, e.g.:

#/bin/bash
trap 'DUMMY=1' TERM

# start the requested process
"$@"