1 karma · joined Nov 21, 2022 (4y ago) · 2 submissions
comment 10y ago · link · parent
Since I use screen fairly often, it had never occurred to me (until fairly recently) that you can rely on it to start with a machine reboot -- and yet have the very familiar interface available to you when you want to intervene. Something to be said about muscle memory.
comment 10y ago · link · parent
screen -dmS myservice /blah/start.sh
Fit that line somewhere in a properly constructed init.d file and you're good to go. And if you need to execute a safe stop from that program through some interactivity: screen -S myservice -X stuff "stop\n"
And voila. It sends a line of text over followed by an enter key. Elegant, useful. You can reattach session to see what's happening at any time. Love me some screen.When the process exits in that screen session, screen session is closed so that you can rely on screen -list.