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_ID=Ubuntu DISTRIB_RELEASE=16.04 DISTRIB_CODENAME=xenial DISTRIB_DESCRIPTION="Ubuntu 16.04.4 LTS" NAME="Ubuntu" VERSION="16.04.4 LTS (Xenial Xerus)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 16.04.4 LTS" VERSION_ID="16.04" HOME_URL="http://www.ubuntu.com/" SUPPORT_URL="http://help.ubuntu.com/" BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/" VERSION_CODENAME=xenial UBUNTU_CODENAME=xenial and the CPU is Intel Core i3-7300T, with hyperthreading disabled, and core speed locked to 800MHz