Page 1 of 1

Screen session not created at startup

PostPosted: Nov 16th, '12, 20:53
by mark9117
I am trying to get a screen session started at boot on one of my machines.

I have a cron job setup under my user ID:

Code: Select all
@reboot /usr/bin/screen -d -m -S pvr


I've also tried setting up a script in /etc/rc.d/init.d/screen_start.sh

Code: Select all
#!/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.

Any wisdom?

Thanks.

Mark

Re: Screen session not created at startup

PostPosted: Nov 17th, '12, 00:04
by djennings
Mark

Are you still trying to set up MythTV?
If so then you can just use MCC to autologin from boot and make the default desktop MythTV

Re: Screen session not created at startup

PostPosted: Nov 17th, '12, 02:13
by mark9117
No, though my M$ remote still barely works, generally I'm pretty happy with the Mythbox as it is now.

No, this is me trying to streamline the stuff I do on my network. I like to have screen sessions running on all my server boxes, including the Mythbox, so that I can remote in from work and do stuff more conveniently. Everything I've seen on screen says my solutions above should work.

They don't.

This is annoying.

Re: Screen session not created at startup

PostPosted: Nov 17th, '12, 03:17
by djennings
Have you tried x2go yet?
It works pretty well for me for performing remote access.

Re: Screen session not created at startup

PostPosted: Nov 17th, '12, 04:20
by mark9117
X2go looks cool, but access is not really the issue. I use SSH to get into these machines and can do (pretty much) anything I need via a console, but I like screen because I like to keep several pots on simmer at a time. If I could get that screen session started at boot, it would save me a step every time I reboot a box.

Now of course, it's gone beyond that. It's no longer a simple matter of "I want a minor convenience where my remote access is concerned." Oh no. Now it's a challenge. The machines have defied my effort to get them to work as they should.

It is on.

Mark

Re: Screen session not created at startup

PostPosted: Nov 17th, '12, 16:28
by oj
It's on? Have they been served? http://www.cucirca.com/2012/04/20/south ... -in-the-a/

Seriously though, I see you don't mention rc.local. That doesn't work either?

Re: Screen session not created at startup

PostPosted: Nov 18th, '12, 01:15
by KenJackson
Try: screen -d -m

From man screen:
-d -m
Start screen in "detached" mode. This creates a new session but
doesn't attach to it. This is useful for system startup scripts.

Re: Screen session not created at startup

PostPosted: Nov 18th, '12, 02:28
by mark9117
Ken, thanks for the reply, but can you please reread the first message in this thread and take a look at what the command I'm using to try and implement this?

O.J., I did not think of trying rc.local. Thank you for that tip. Regrettably, it didn't work. :(

Keep the ideas coming folks. I do appreciate it.

Mark