Non-Exiting Screen Startup

I was trying to run screen in the background with a python script inside of it, however, when the python was exiting due to coding errors, the screen was quitting too. I could have turned on logging but I didn’t want to deal with screen log files all the time. I wanted the screen session to remain open, even if the python quit so I could reattach to it and see what was going on (like a normal command prompt). Here was the solution I came up with:

/usr/bin/screen -dm /bin/bash -c 'echo "your program here" ; /bin/bash'

Run this to reattach it later:

/usr/bin/screen -dr
Non-Exiting Screen Startup

One thought on “Non-Exiting Screen Startup

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s