seems like there may be a timing issue with the -X stuff command,
i had a script doing
screen -S foo -dm
screen -S foo -X stuff "/path/to/script.sh^M"
and when the system is very busy, sometimes, the 2nd command seems to
be completely ignored, there's no indication that anything was
written/executed in the screen session,
but adding a "sleep 1" in between seems to resolve the issue, which
isn't a great solution, but a hacky workaround.. observed on:
> screen --version
Screen version 4.03.01 (GNU) 28-Jun-15
> uname -a
Linux miner1 4.4.0-127-generic #153-Ubuntu SMP Sat May 19 10:58:46 UTC
2018 x86_64 x86_64 x86_64 GNU/Linux
> cat /etc/*release*
DISTRIB_DESCRIPTION="Ubuntu 16.04.4 LTS"
VERSION="16.04.4 LTS (Xenial Xerus)"
PRETTY_NAME="Ubuntu 16.04.4 LTS"
and the CPU is Intel Core i3-7300T, with hyperthreading disabled, and
core speed locked to 800MHz