LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-15-2008, 10:39 AM   #1
disbeliever
LQ Newbie
 
Registered: Dec 2005
Location: Holland
Distribution: Slackware 11.0 fluxbox-1.0rc2 (2.6.18-custom), ubuntu 8.04-server
Posts: 11

Rep: Reputation: 0
using screen command as a service


Hey,

You may have heard about the awesome game called ttd and its open source clone OpenTTD. I myself like it a great deal and in doing so, I also have a server running, so me and my friends can enjoy our transport enterprises online. So when I want to start a server I:

connect to the server via putty or ssh

screen
openttd -D
load savegame.sav (in the openttd shell)
C-a d (detach)

and I have my server running, and whenever I want to load a different map, I simply reattach the screen:

screen -r

and load what ever I want.

The benefit of this method is clear; when I close putty (or ssh connection), the openttd server keeps running. The downside however is that each time my server machine boots I have to manually start the server, wich just isnt very nice (not that it boots much, but still). What I want is actually a script wich starts at boot up (which I know how to make) and starts screen with the openttd command in it, which is what I have been unable to find out how to do up to this point. Google searches turned up little (screen is a rather ambiguous word at that) and in pure acts time management, I decided to dig up my old account here and hope, that a person with (far) greater experience than me, could help me out with this problem.

Thanks for any of your help in advance,

db

Last edited by disbeliever; 06-15-2008 at 10:40 AM.
 
Old 06-16-2008, 04:56 AM   #2
born4linux
Senior Member
 
Registered: Sep 2002
Location: Philippines
Distribution: Slackware, RHEL&variants, AIX, SuSE
Posts: 1,127

Rep: Reputation: 49
this should be ok:

screen -d -m -S TTDsession yourscript.sh

-d -m = will start the session in "detached" mode

-S = is your session name

to attach to it (in case there are other screen session running
for the same user):

screen -R TTDsession
or
screen -x TTDsession

(i do this all the time for bittorrent cli sessions. ).

hth.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
service command in Suse chucker8 Linux - Newbie 1 09-05-2006 01:38 PM
issue with 'service' command vortmax Fedora 5 08-08-2006 02:26 PM
service: command not found anjanesh Linux - Newbie 3 05-23-2006 11:37 AM
service: command not found aap Linux - Newbie 8 01-06-2006 09:15 PM
How to use Service command for a program safun75 Linux - Software 4 04-16-2004 06:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration