Mark,
I don't have a solution for you, but a question that might lead toward the solution:
In order to launch successfully (even in a detached mode), does screen need a controlling tty, a valid setting for $TERM, and valid termios information (screen dimensions)? I think it might.
When you launch from Konsole, I'm certain it has all that. But when you launch from cron, I'd be surprised if it has any of that.
—Joe
--
We sell Spatulas, and that's all!
http://spatula-city.org/~im14u2c/http://sdk-1600.spatula-city.org/http://spacepatrol.info/
From: Mark Adams <address@hidden>
To: address@hidden
Sent: Thu, November 22, 2012 10:37:51 PM
Subject: Detached sessions not being created
I have several machines on my network that provide services of one type or another. I'm trying to configure them to create detached screen sessions at boot time. Let's take a representative example.
I have a cron job setup under my user ID:
@reboot /usr/bin/screen -d -m -S pvr
I have also used the syntax "@reboot /usr/bin/screen -dmS pvr".
Neither of these has worked.
I tried creating a bash script:
#!/bin/bash
# This script starts a detached screen session on boot.
su - <my_user> -c "/usr/bin/screen -dmS pvr"
Neither of these work despite the fact that when I run the command
"/usr/bin/screen -d -m -S pvr" as my user in a konsole window it creates
the screen session as expected (note that I can stack those options to
-dmS and it makes no difference).
I should say that I'm also
unable to start that screen session from crontab in Webmin (I assume it
uses the run-parts command to do that). I get no error - it just doesn't
create the screen session.
I set uid root: "chmod a+s /usr/bin/screen" and I have seen references to changed the permissions of /var/run/screen. I have no /var/run/screen.
Any wisdom?
Thanks.
--
Mark Adams