[cod] Linux Startup scripts?

Nathan Peters natedog550 at hotmail.com
Mon Dec 22 12:11:09 EST 2003


Yeah and thank you again haha.  Neways, yeah it took me so long to figure those out cause' i'm not to great at linux but nonetheless I got em' to work LOL.  But I saw how well they worked and I don't like seeing people struggle with stuff like this either.  So......yeah hope to see you on the battlefield someday too.  Too busy right now, I'm starting a new side business - game hosting haha.  Medal of Honor and Call of Duty.  $100/month for a 32 public slot Medal of Honor server if anyone is interested =) (servers are on a OC192 backbone).  Yeah soon hopefully [BASHYOU] will move to CoD.  But until everyone in our clan buys it then I'll just stay with Medal of Honor and just play CoD by myself =(  So thanks again MrGroove and I'll ttyl.

Nathan - A.K.A. [BASHYOU] SNiPeS
  ----- Original Message ----- 
  From: www clan - Starkness 
  To: cod at icculus.org 
  Sent: Monday, December 22, 2003 10:55 AM
  Subject: RE: [cod] Linux Startup scripts?


  Thanks Nathan,


  I got those scripts from someone from Ravensoft forums a year or so ago.  I was just passing them on.  Thank YOU Nathan for contributing to the community.   I am MrGroove on the battlefiled.    See you on it!     = ) 

  Peace,

  ./Starkness

    -----Original Message-----
    From: Nathan Peters [mailto:natedog550 at hotmail.com]
    Sent: Monday, December 22, 2003 11:42 AM
    To: cod at icculus.org
    Subject: Re: [cod] Linux Startup scripts?


    Ok.  My scripts are updated again.  Here it is:

    http://www.bashyou.com/snipesserverscripts/MOHAAserverscripts.zip

    Screen shots using it in webmin in scheduled cron commands:
    http://www.bashyou.com/snipesserverscripts/cronjob1.jpg
    http://www.bashyou.com/snipesserverscripts/cronjob2.jpg
    http://www.bashyou.com/snipesserverscripts/cronjob3.jpg - runs every 5 min. on the screenshot but I've changed it to run every min. now

    These scripts work great now.  Thanks to Starkness, for the code that checks to see if the server process is running.  Thanks again Starkness.  These scripts work fine on Red Hat 9 - that's the only system I've tested on.  Neways, hope you peeps can use em'.  TTYL.

    Nathan - A.K.A. [BASHYOU] SNiPeS
      ----- Original Message ----- 
      From: www clan - Starkness 
      To: NateDog 
      Sent: Monday, December 15, 2003 1:55 PM
      Subject: RE: [cod] Linux Startup scripts?


      Got it.  Thanks bro.
        -----Original Message-----
        From: NateDog [mailto:natedog550 at hotmail.com]
        Sent: Monday, December 15, 2003 2:44 PM
        To: starkness at wwwclan.com
        Subject: Re: [cod] Linux Startup scripts?


        Ok I'll keep you posted.

        Ok.  Here's my script: http://www.bashyou.com/snipesserverscripts/MOHAAserverscripts.zip

        Screen shots using it in webmin in scheduled cron commands:
        http://www.bashyou.com/snipesserverscripts/cronjob1.jpg
        http://www.bashyou.com/snipesserverscripts/cronjob2.jpg

        Please edit the script to suit your needs.  Note: This is for MOHAA.  Make changes accordingly.  Should't be a problem for CoD, just change directories and anything that is specific to CoD.  Also, where the script says "Sleep".  That is a holder for now.  And it doesn't mess anything up it just won't tell you if it didn't start - check running processes for now.  Tonight I'll use Starkness' idea about searching for the running server and update my script (I'll give you credit in my script Starkness).  Just play with it and see if this script works for you.  Works great for me, haven't had a problem.  Also, put the log file in the same directory as the script.

        Nathan - A.K.A. [BASHYOU] SNiPeS
          ----- Original Message ----- 
          From: www clan - Starkness 
          To: natedog550 at hotmail.com 
          Sent: Monday, December 15, 2003 1:35 PM
          Subject: RE: [cod] Linux Startup scripts?


          np bro  =)  let me know if it works for you.  It works on one server I have, but not the other.  one a rh 7.2  one a rh 8 (working)

          Peace!
            -----Original Message-----
            From: Nathan Peters [mailto:natedog550 at hotmail.com]
            Sent: Monday, December 15, 2003 1:37 PM
            To: cod at icculus.org
            Subject: Re: [cod] Linux Startup scripts?


            Sweet dude!  That's what I was gonna try and figure out.  How to search and see if the server is running!  Thanx man!  You rock!  Your start script has some similarity with mine.  I'll post mine like I said when I go to lunch.  That's what happens with stuff like this.  Theres always tons of different ways of getting to the same objective.  Mine actually looks very similar to a regular init script.  Has start, stop, and restart all in the same file.  It looks very similar to another init script that someone posted using the screen command but like I said my host doesn't have that working.  Again, thanks Starkness!

            Nathan - A.K.A. [BASHYOU] SNiPeS
              ----- Original Message ----- 
              From: www clan - Starkness 
              To: cod at icculus.org 
              Sent: Monday, December 15, 2003 12:21 PM
              Subject: RE: [cod] Linux Startup scripts?


              Here is a cronjob I use for sof2.  I was working on making it work for cod, but got too busy and can't get the time to work on it.  I hope this can help.  If it works for you, please post back here if you makde any changes.

              Thanks!

              //Starkness

              //Cronjob

              */5 * * * * /home/games/sof2/check_sof2_server.sh

              //End cronjob


              This runs a check script which will run a start script if it doesn't find the server running.

              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              ///Begin Check script///

              #!/bin/sh

              SERVER=`ps -ef | grep -v grep | grep -c sof2ded`

              if [ "$SERVER" != "0" ] ; then
                    echo "Already Running, exiting"
                    exit
              else
                    echo "Starting up the server..."
                    cd /home/getawebhost/sof2
                    /home/getawebhost/sof2/start.sh > /dev/null 2>&1
              fi

              ///End Check script///

              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              ///Begin Start script///

              #!/bin/sh
              cd /home/games/sof2
              ./sof2ded +set dedicated 2 +set sv_pure 1 +set sv_punkbuster 1 +set fs_homepath /home/games/sof2 +set net_ip xx.xx.xx.xx +set net_port 20100 +exec sof2.cfg +exec +set fs_game osp > /dev/null &

              ///End Start script///
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


                -----Original Message-----
                From: Nathan Peters [mailto:natedog550 at hotmail.com]
                Sent: Monday, December 15, 2003 1:07 PM
                To: cod at icculus.org
                Subject: Re: [cod] Linux Startup scripts?


                Cool.  Yeah what I'm planning to do as far as the server not responding is probably a cron job that runs every 5 minutes or so.  If it finds that the server process is not running it will run my start script.  If it finds it is running it will not do anything.  Something to that nature.  Man the possiblities of a perfect set of scripts we could all create if we all put our ideas together!

                Nathan - A.K.A. [BASHYOU] SNiPeS
                  ----- Original Message ----- 
                  From: MikeyDee 
                  To: cod at icculus.org 
                  Sent: Monday, December 15, 2003 11:46 AM
                  Subject: Re: [cod] Linux Startup scripts?


                  here is my startup config that works  just fine.  If i find the server not responding I just login and kill -9 the pid
                  #!/bin/bash
                  while true
                  do
                  /home/user/callofduty/cod_lnxded +exec ded.cfg +sets gamestartup \"`date +"%m-%d-%Y %T"`\"
                  echo "server crashed on `date`" > last_crash.txt
                  done
                    ----- Original Message ----- 
                    From: Nathan Peters 
                    To: cod at icculus.org 
                    Sent: Monday, December 15, 2003 9:11 AM
                    Subject: Re: [cod] Linux Startup scripts?


                    Not sure if I can help you there man.  I don't know a ton about linux.  Yet there is a bunch of peeps here that do.  I will tell you in advance what they will need.  Do a top command or something that shows all the processes running.  Too many variables can contribute to stuff like that - hanging, crashing, etc.  More details you can give them the better.  What my script does is run the program in the background and gives it the nohup command and also writes to a logfile.  This keeps the process from quittin'.  It works very well.  I'm very proud of myself haha.  Many hours of research and search engines finding the pieces I needed to make it work.  As far as the screen command goes I don't know enough about that to help you.  But from what I have learned it keeps it running when you close the shell or logoff the system.  Anyone can correct me if I'm wrong.  Anyways, that's my input.

                    Nathan - A.K.A - [BASHYOU] SNiPeS
                      ----- Original Message ----- 
                      From: MikeyDee 
                      To: cod at icculus.org 
                      Sent: Monday, December 15, 2003 10:57 AM
                      Subject: Re: [cod] Linux Startup scripts?


                      That sounds wonderful.  I have been running the server and never had crash yet it just hangs with either 100% cpu and none can connect.  That  is what I am trying to sort out getting restarted?

                      Red Hat 8.0 install on the OS.  I have not tried the latest screen commands does that change the way the dedicated server runs?
                        ----- Original Message ----- 
                        From: Nathan Peters 
                        To: cod at icculus.org 
                        Sent: Monday, December 15, 2003 6:58 AM
                        Subject: Re: [cod] Linux Startup scripts?


                        Hey everyone.  It took me 5 hours this weekend to write custom startup, restart, and shutdown scripts for the medal of honor linux server - because the server I'm hosted on doesn't have the screen command and I didn't want to have to install a ton of stuff to make it work.  I'm also in the process of writing scripts to turn mods on and off very easily and also a script that emails me when the server goes down or a script that restarts the server, not sure yet.  But, I'm pretty sure these scripts will work for CoD also.  I copywrited or licensed them whatever you want to call it with the GNU license so they're free but I still get credit for writing them, so if you want to take a look at them let me know and I'll put them somewhere where you can download them, that way you get a copy of the license.  Reason: It took me a long time to do this and I doubt anyone has scripts like these.  They can be run from a cron also.

                        Peace out,
                          Nathan - A.K.A. [BASHYOU] SNiPeS
                          ----- Original Message ----- 
                          From: David A. Fuess 
                          To: cod at icculus.org 
                          Sent: Monday, December 15, 2003 7:32 AM
                          Subject: RE: [cod] Linux Startup scripts?


                          I have mine in a forever loop with a 5 second delay. If it crashes, which is rare, it the quit command is issued then it pauses for 5 seconds and restarts the server. The script also manages the log files and other cleanup tasks.

                          At 10:13 AM 12/13/2003 -0800, you wrote:


                            Okay thanks for all the feedback.

                             

                            Next question is I used to have to set a cron job or something to restart the server when it hangs or crashes.

                             

                            Anyone using any daemon tools or supervisor tools on CoD that work.       

                             

----------------------------------------------------

                            From: Rene de Vries [mailto:rene.devries at home.nl] 
                            Sent: Thursday, December 11, 2003 11:21 PM
                            To: cod at icculus.org
                            Subject: RE: [cod] Linux Startup scripts?

                             

                            Hi,

                             

                            create a file

                            ex: vi start

                            paste this "screen -A -m -d -S cod /cod_lnxded +map_rotate"

                            write and quit vi

                            chmod +777 start

                            execute: /start

                            ctrl a+d to leave the screen

                             



                              -----Oorspronkelijk bericht-----

                              Van: MikeyDee [mailto:mikeydee at usd.wli.net]

                              Verzonden: vrijdag 12 december 2003 0:43

                              Aan: cod at icculus.org

                              Onderwerp: [cod] Linux Startup scripts?


                              anyone have linux startup script ?




                                
                              beside doing /cod_lnxded




                                
                              I was trying to add +set commands to get it automated but seem to fail on me?



                               
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/cod/attachments/20031222/f1a223c1/attachment.htm>


More information about the Cod mailing list