Unfortunately, 'screen -x' does not start a screen session if there isn't one available. This isn't a problem except when I reboot the box that hosts my screen sessions, and then because of two factor authentication, I have to bumble around (ssh in, start screen, and then connect with the correct PuTTY profile, etc).
A simple solution to this would be to add screen to your crontab with @reboot but the easy solution is not seemless. Specifically, on Ubuntu the default /bin/sh is 'dash'. When cron executes dash, no TTY is allocated which causes screen to fail. So try making your crontab something like:
SHELL=/bin/bash @reboot screen -d -m 1> /dev/null 2>&1
No comments:
Post a Comment