1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Linux Gurus ...

Discussion in 'Off Topic' started by DexterII, May 10, 2006.

  1. DexterII

    DexterII Overworked

    Joined:
    Mar 22, 2001
    Messages:
    1,115
    Likes Received:
    0
    I have a question and I'm sure you Linux gurus can help me out.

    I am running a UT2k4 server on RedHat Linux, however every once in awhile the server may crash. (Mostly cause I am running AdminPlus) Now is there a way to create a cron entry or cron file to check to see if the process ucc-bin is running? And if it is to do nothing but if it isn't to launch a .SH script file to relaunch the server.

    This cron file should check every 5 minutes or whatever the minimal is for cron.

    If it's possible how do I do it?

    Also a way to reboot the server at 3AM every morning?

    While I'm on the subject of UT servers does anyone know any good fast free or cheap file servers I can use for redirect? Yearly fee perferred...

    Thanks alot.
     
  2. Thrash123

    Thrash123 Obey Leash Laws

    Joined:
    Jul 19, 1999
    Messages:
    4,777
    Likes Received:
    0
    A quick and dirty hack would be to have a cron job run ps, grep the output for the process name (with spaces to ensure that you get ONLY the process name), and if grep finds it, run the script. Sorry, I haven't had access to a working Linux machine in a couple of weeks now, I'm a bit rusty on my shell commands.

    Cron can also just run the reboot command @ 3 AM if you like. Simple. I dunno what redhat has set up for reboot; I've never had to execute a reboot by command line (I usually just use ctrl-alt-delete at the prompt).

    of course, this is assuming you know cron :) If not, here are a few things a quick google turned up.

    http://www.tech-geeks.org/contrib/mdrone/cron&crontab-howto.htm
    http://www.deluxnetwork.com/linux/guides/crons.php
    http://www.onlamp.com/pub/a/bsd/2000/09/27/FreeBSD_Basics.html
     
  3. DexterII

    DexterII Overworked

    Joined:
    Mar 22, 2001
    Messages:
    1,115
    Likes Received:
    0
    I'm pretty much an idiot when it comes to linux, I'm still trying to learn step by step. What I'm really looking for is an example of what I would put in the text file to find proccess ucc-bin, like an if statement to see if it's running and ignore if it is. So I'm guessing this is gonna have to be like a perl script that cron runs because it needs variables and if statements...

    If anyone has the time, my start server script /usr/local/games/ut2004/System/AStartServer.sh

    Check every 5 minutes
    Shutdown and restart server at 3AM

    So I guess it would have to find the PID of ucc-bin and use the kill command to stop the server...

    However I notice whenever I run the server there are two instances of ucc-bin running, if I kill either of them they both die...
     
    Last edited: May 10, 2006
  4. Thrash123

    Thrash123 Obey Leash Laws

    Joined:
    Jul 19, 1999
    Messages:
    4,777
    Likes Received:
    0
    Bash shell scripting can do it, too. I'd use it, unless you know perl better.
     
  5. K

    K i bite

    Joined:
    Jul 29, 2004
    Messages:
    2,112
    Likes Received:
    0
    Redirect:
    gameservers.net
    look into it. I used it for years on my UT servers. They have UT4k support too.
    It's also free and reliable.
     
  6. hyrulian

    hyrulian Rainbow Brite

    Joined:
    May 20, 2001
    Messages:
    9,548
    Likes Received:
    0
    Your shell account on mine should still be working :p
     
  7. Thrash123

    Thrash123 Obey Leash Laws

    Joined:
    Jul 19, 1999
    Messages:
    4,777
    Likes Received:
    0
    Yeah, but I really hate using other peoples' servers unless necessary. Most of my work in Linux is programming (I've been developing my own WM on and off for the past 6 months).
     
  8. hyrulian

    hyrulian Rainbow Brite

    Joined:
    May 20, 2001
    Messages:
    9,548
    Likes Received:
    0
    Whoa, your own Window Manager? Good luck, would be interesting to see how that turns out :)
     
  9. namu

    namu Bleh.

    Joined:
    Dec 21, 2000
    Messages:
    4,411
    Likes Received:
    1
    Have cron launch this every 3 minutes:

    Code:
    perl -e "if (system('ps -axwwwwww | grep ucc | grep -v grep') !~ /ucc-bin/) { system('/bin/sh /usr/local/games/ut2004/System/AStartServer.sh'); }"
    
    and have it run "killall ucc-bin ; /bin/sh /usr/local/games/ut2004/System/AStartServer.sh" at 3AM.

    As always, no guarantees that it'll work as expected. Or at all.
     
    Last edited: May 11, 2006
  10. Thrash123

    Thrash123 Obey Leash Laws

    Joined:
    Jul 19, 1999
    Messages:
    4,777
    Likes Received:
    0
    It isn't anything fancy. Just multiple desktops, a subtle border around windows, and some keyboard shotcuts.

    I wanted an extremely minimalistic and fast WM; BadWM is really close to what I want, but development has become stagnant on it, and I don't like it's codebase (buggy buggy buggy), so I figured "I'll make my own".
     
  11. Traxis

    Traxis Waiting for the deathblow

    Joined:
    May 29, 2001
    Messages:
    338
    Likes Received:
    0
    Post here when you finish, because I'm definitely interested in something like this. I have a few low end machines that run like crap with most WMs.
     
  12. Thrash123

    Thrash123 Obey Leash Laws

    Joined:
    Jul 19, 1999
    Messages:
    4,777
    Likes Received:
    0

    You may be waiting a while; I haven't had any time for personal coding projects since I started my new job. Working at a newspaper and being a part of the daily printing sucks - While I get time and a half for overtime, I really don't like the weeks where I have ~5-10 hours overtime. I come home too tired to want to do anything interesting.

    If they ever switch me over to the new media dept, then we'll see :)
     
  13. DexterII

    DexterII Overworked

    Joined:
    Mar 22, 2001
    Messages:
    1,115
    Likes Received:
    0
    All I need is the redirect feature.. plus I dont see where it says they are free.
     

Share This Page