Artix Linux Forum

Artix Linux => System => Topic started by: arveex on 03 April 2020, 09:17:48

Title: [SOLVED] ssh logout -> tmux killed
Post by: arveex on 03 April 2020, 09:17:48
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?
Title: Re: ssh logout -> tmux killed
Post by: SGOrava on 03 April 2020, 14:27:06
if you are using elogind you might have luck by checking /etc/elogind/logind.conf file
Title: Re: ssh logout -> tmux killed
Post by: nous on 03 April 2020, 14:32:36
How the frak has that crept again into our standard package configuration?
Title: Re: ssh logout -> tmux killed
Post by: Dudemanguy on 03 April 2020, 14:56:36
Hah, It looks like someone accidentally commented out that part of the PKGBUILD (https://gitea.artixlinux.org/packagesE/elogind/src/branch/master/trunk/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".
Title: Re: ssh logout -> tmux killed
Post by: arveex on 03 April 2020, 15:50:46
Thank you all!

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


[Login]
KillUserProcesses=no