The man page recommends "-d -m" instead; oddly, the order makes a difference. Perhaps -d looks at the next parameter, and treats -m as a special case. Anyway, "-m -d" may or may not run the script, but generally creates a detached screen session with an open shell.
Even more oddly, "screen -d -m myscript.sh" doesn't seem to do anything for me, but "sudo env - screen -d -m myscript.sh | cat" works properly. Huh? - Eric On Fri, Jan 10, 2014 at 9:59 AM, S. Dale Morrey <[email protected]> wrote: > Sorry meant "screen -m -d myscript.sh" > It should launch my script in a screen session and immediately return. > > > On Fri, Jan 10, 2014 at 9:52 AM, Eric Wald <[email protected]> wrote: > >> S. Dale Morrey wrote: >> > I've got a box running Centos 6. I have a script I need to run at boot, >> it >> > just does a screen -d myscript.sh >> > So I placed the line in /etc/rc.local >> > >> > I've checked the permissions, and everything looks correct. >> > I've manually run rc.local and it works fine. >> > >> > However when I reboot the script is not being run. >> >> I'm confused about the "screen -d" part. Is there really a screen >> session named myscript.sh, or is that the name of a script that you're >> trying to run within a screen session? In the latter case, the -d >> option seems to be confusing screen: >> >> ~/Programs/test> sudo env - screen -d myscript.sh | cat >> There is no screen to be detached matching myscript.sh. >> >> And yes, I recommend the above invocation as an approximation to running >> the line at boot time through rc.local; it uses the root user, clears >> the environment, and bypasses the tty, all of which have a major impact >> on screen. >> >> - Eric >> >> /* >> PLUG: http://plug.org, #utah on irc.freenode.net >> Unsubscribe: http://plug.org/mailman/options/plug >> Don't fear the penguin. >> */ >> > > /* > PLUG: http://plug.org, #utah on irc.freenode.net > Unsubscribe: http://plug.org/mailman/options/plug > Don't fear the penguin. > */ /* PLUG: http://plug.org, #utah on irc.freenode.net Unsubscribe: http://plug.org/mailman/options/plug Don't fear the penguin. */
