Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLVED] ssh logout -> tmux killed (Read 1220 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

[SOLVED] ssh logout -> tmux killed

Hi,

I'm running Artix with openrc (on all machines). I do the following:

localh$ ssh <remote>     // connect to remote machine
remote$ tmux             // run tmux
(inside tmux)$ ctrl+b d  // detach tmux from session
remote$ ctrl d           // logout from remote
localh$ ssh <remote>     // connect again
remote$ tmux a           // try to attach to session
no sessions              // :-(

Quote
...defaulting KillUserProcesses to yes, which effectively kills all backgrounded user processes (tmux and screen included) on logout
(from here: https://systemd-free.artixlinux.org/)

Ironically, it was easy to find a solution for systemd (which I don't need), how do I do the equivalent of setting KillUserProcesses=no with openrc?

Re: ssh logout -> tmux killed

Reply #1
if you are using elogind you might have luck by checking /etc/elogind/logind.conf file


Re: ssh logout -> tmux killed

Reply #3
Hah, It looks like someone accidentally commented out that part of the PKGBUILD at some point.

Code: [Select]
build() {
    local meson_options=(
        -Drootlibdir=/usr/lib
        -Drootlibexecdir=/usr/lib/elogind
        -Ddbuspolicydir=/usr/share/dbus-1/system.d
        -Ddocdir=/usr/share/doc/elogind
        -Ddefault-hierarchy=hybrid
        -Dcgroup-controller=openrc
#         -Ddefault-kill-user-processes=false
    )

    arch-meson "$pkgbase-${pkgver}" build "${meson_options[@]}"

    ninja -C build
}

I'm not sure if only setting the value in /etc/elogind/logind.conf will fix this, but regardless I agree with the sane default of disabling this "feature".

Re: ssh logout -> tmux killed

Reply #4
Thank you all!

Indeed, setting this in /etc/elogind/logind.conf solves the problem:


[Login]
KillUserProcesses=no