TL;DR: In Debian Stretch and later, make sure that
systemd-tmpfiles-setup.service has been started successfully:
$:> systemctl status systemd-tmpfiles-setup.service
● systemd-tmpfiles-setup.service - Create Volatile Files and Directories
Loaded: loaded (/lib/systemd/system/systemd-tmpfiles-setup.service; static; vendor preset: enabled)
Active: active (exited) since Thu 2018-06-21 19:54:06 CEST; 41min ago
If disabled (
Loaded: ... ;disabled; ...) then you might want to enable it with
systemctl enable systemd-tmpfiles-setup.service. If you want to use screen within a docker container then you either have to get systemd running in your container image or you have to run
systemctl start systemd-tmpfiles-setup.service or
/etc/init.d/screen-cleanup start (as suggested by Huey) each time after logging into your container.
Details: Since Debian Stretch, the startup script
/etc/init.d/screen-cleanup is not executed, because by default this service is masked (
/lib/systemd/system/screen-cleanup.service -> /dev/null), so systemd ignores it.
/run/screen on boot, as configured in
d /run/screen 0775 root utmp