[beaglebone] GNU Screen terminates at SSH logoff

529 views
Skip to first unread message

Dan

unread,
Feb 4, 2012, 3:18:11 PM2/4/12
to Beagle Board
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

Chip Collier

unread,
Feb 6, 2012, 3:13:51 PM2/6/12
to beagl...@googlegroups.com
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

signature.asc

Koen Kooi

unread,
Feb 6, 2012, 3:20:38 PM2/6/12
to beagl...@googlegroups.com

Op 4 feb. 2012, om 21:18 heeft Dan het volgende geschreven:

> 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?

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

regards,

Koen

Dan

unread,
Feb 7, 2012, 10:46:38 PM2/7/12
to Beagle Board
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.

Jan

unread,
Mar 15, 2012, 5:24:24 AM3/15/12
to beagl...@googlegroups.com
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

gigame...@gmail.com

unread,
Mar 15, 2012, 12:31:39 PM3/15/12
to beagl...@googlegroups.com
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

George Lu

unread,
Mar 15, 2012, 1:25:00 PM3/15/12
to beagl...@googlegroups.com
On Thu, Mar 15, 2012 at 9:31 AM, <gigame...@gmail.com> wrote:
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


On Thursday, March 15, 2012 5:24:24 AM UTC-4, Jan wrote:
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



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

Jon Kloske

unread,
Jan 26, 2017, 10:05:28 PM1/26/17
to BeagleBoard
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

Reply all
Reply to author
Forward
0 new messages