[cod] startup script

Orr, Roland Cadet orr at cadetmail.uscga.edu
Wed May 19 21:37:19 EDT 2004


I remember seeing several posts on such topics as this at callofduty.org,
which has now been moved to fpscentral (callofduty.org will forward you to
the correct site [FINALLY]).

Corven wrote a nice how-to on setting up a linux dedicated server, located
here:
http://www.fpscentral.com/forums/showthread.php?t=8907&page=2&pp=15&highligh
t=startup+script.  In the first post (the how-to written by Corven), he
talks about a startup script that allows you to run the process as a
background process and some other neat stuff you probably want to check out,
like auto-restarting and such.  On the second page of the thread, there is a
post from Ard Choille, which displays all the code he used in his startup
script.  I think the key to the background process piece of the puzzle is
the & operator, which i THINK you add at the end of a command to make the
process a background process, like this:
./cod_lnxded +map_rotate &
(linux people, correct me if i'm wrong).

alternatively, using the screen command (look at the man page cuz i'm not
familiar with it) you can basically move the process off the screen (like
background) and then use some option with the screen command to bring it
back.  you might wanna check that out too.

as for the autorestarting, i think they just used a cron job (see the post
about that) to check for the server's PID (process ident. no.) at certain
intervals.   if the server process is not there, it starts the server.
pretty straightforward, you just hafta know how to do a cron job.  Myriad
tutorials are available online for cron jobs, just google "cron tutorial"
(that's how i learned everything I know about cron - that and the man page
for crontab).  I seem to have deleted my bookmarks so you hafta actually
search for some.

------Summary:
1.) check out the how-to thread i gave you the link for, specifically the
first post (only the part that talks about the start.sh script) and Ard
Choille's post (post #20, on the second page)
2.) to make it a background process, add a & to the end of the command
(double check on this!!).  However, I don't know how to bring it back so you
can look at the console output if you use the &.  perhaps someone can
elaborate? :(
3.) the screen command can move the process off the screen to a named
"virtual screen" (you specify the screen's name, call it whatever you want)
and can call the screen back by using whatever name you gave it and some
option (check the man page for whichever flag brings a screen to the
foreground)
4.) to automatically have the computer restart your CoD server, use a cron
job that looks for the server's PID and starts it if the PID is nonexistent.
this should also be in the how-to thread i gave you the link for.

------Disclaimer:
I've only read about this stuff for curiosity.  I run a LAN network on a
slackware laptop and just dedicated ttyl5 to running the server, so I could
be wrong about any of this.  But I figure that this will at least get you
started.

Hope this helps!
-Tim


-----Original Message-----
From: James Casey - DigitalNetwork Limited [mailto:james at nucleus.co.nz]
Sent: Wednesday, May 19, 2004 7:58 PM
To: cod at icculus.org
Subject: [cod] startup script


Hi All

Finally got my cod server running, running version 1.4.

I start the server manually through ssh and whenever i log off ssh it closes
the server so i want it to run as a service but my linux knowledge is pretty
limited does any one havea script for doing thisor can point me in the right
direction.

Many thanks

James





More information about the Cod mailing list