[beaglebone] GNU Screen terminates at SSH logoff

Hi,

On my Beaglebone, running the 2012.01.27 Angstrom image, the "screen"
utility always terminates when I logoff.

That is, if I:

1. ssh to the beaglebone
2. Enter "screen" to launch the screen utility (then press Enter to
get to the screen session's command line)
3. Enter Ctrl-A D to detach and return to my ssh session
4. Enter exit

.. the "screen" process terminates after step 4.

Ordinarily (on an Angstrom image running on my Beagleboard XM, and
Ubuntu running on my Beagleboard Rev C), the screen utility doesn't
terminate when I logoff - it's a handy way to launch programs that I
want to keep running after I logoff.

Does anyone know what I need to do to have "screen" continue running
after I logoff from SSH? Or can someone running Angstrom on their
Beaglebone check to see if "screen" keeps running after they logoff
from an SSH session?

Thanks,

Dan

Same behavior for me but using tmux. I just figure it's Dropbear. I'm
going to attempt to replace dropbear with openssh and see if that works.

Chip

Edit /etc/systemd/systemd-logind.conf and uncomment the 'killuserprocesses=no' line. That will get fixed by default next week or so.

regards,

Koen

Koen,

Unfortunately, that change to systemd-logind.conf didn't fix the
problem for me. I just noticed that I have the same problem with
"screen" and ssh on my Beagleboard XM running the Angstrom-TI-GNOME-
image-eglibc-ipk-v2012.01-core-beagleboard-2012.01.11.img.gz. Do you
have any other suggestions?

Thanks,

Dan.

All,

I have the same (very annoying) issue.
Editing systemd-logind.conf didn’t help here, either.

Dan, have you ever got it working?

Best Regards,
Jan

Jan,

No, not reliably.

I haven’t been using Screen much, since I was able to launch my background process using systemd, but I noticed a week or so ago that a Screen process was still running when I reconnected.

I just ran a test, and it appears that it works when root runs Screen, but terminates at disconnect when a non-root user runs it.

i.e. If I do the following…

  • ssh login as dan

  • su

  • launch Screen

  • Ctrl-a d to switch back to my original session

  • exit, exit to disconnect

… then the screen session is still active when I login later. If I launch Screen as the non-root user “dan”, then Screen terminates when I disconnect.

However, since I haven’t used it much, I can’t say that this method always works.

I’m running Angstrom with the 3.2.9+ kernel. The Screen package itself is still at 4.0.3-r2.

Dan

I found that the screen session would not terminal if I just kill the ssh window on my laptop without logging out of the ssh. Since autodetach is default to on, that session is saved. Next time I ssh into the beaglebone, use “screen -list” to see the sessions, or -x to reattach the default session.

root@bn2:~# screen -list

There is a screen on:
15425.pts-1.bn2 (Attached)
1 Socket in /tmp/screens/S-root.

root@bn2:~# screen -x

Sorry for necromancing this thread, but I’ve just spent a little while trying to solve this issue and the suggestions of logind.conf didn’t help. I’m using Angstrom from a few years ago, and I did find the solution finally to this problem and thought I’d share : I actually had to edit the dropbear config to get this to work. The basic idea is to edit /lib/systemd/system/dropbear@.service and add a line right at the end that reads “KillMode=process” (yes this seems like it would kill processes on logout, but in fact it ~doesn’t~ do this when you add this line, cool huh). Then reboot to apply.

root@beaglebone:/lib/systemd/system# cat dropbear@.service
[Unit]
Description=SSH Per-Connection Server
Requires=dropbearkey.service
After=syslog.target dropbearkey.service

[Service]
ExecStart=-/usr/sbin/dropbear -i -r /etc/dropbear/dropbear_rsa_host_key -p 22
ExecReload=/bin/kill -HUP $MAINPID
StandardInput=socket
KillMode=process