PDA

View Full Version : Linux Gurus ...


DexterII
10th May 2006, 06:45 PM
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.

Thrash123
10th May 2006, 07:14 PM
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

DexterII
10th May 2006, 07:47 PM
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...

Thrash123
10th May 2006, 11:20 PM
Bash shell scripting can do it, too. I'd use it, unless you know perl better.

K
11th May 2006, 01:12 AM
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.

hyrulian
11th May 2006, 01:37 AM
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.
Your shell account on mine should still be working :p

Thrash123
11th May 2006, 02:11 AM
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).

hyrulian
11th May 2006, 02:28 PM
Whoa, your own Window Manager? Good luck, would be interesting to see how that turns out :)

namu
11th May 2006, 04:57 PM
Have cron launch this every 3 minutes:


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.

Thrash123
11th May 2006, 07:10 PM
Whoa, your own Window Manager? Good luck, would be interesting to see how that turns out :)

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".

Traxis
12th May 2006, 11:11 PM
It isn't anything fancy. Just multiple desktops, a subtle border around windows, and some keyboard shotcuts.

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.

Thrash123
13th May 2006, 12:34 AM
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.


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 :)

DexterII
13th May 2006, 10:18 PM
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.

All I need is the redirect feature.. plus I dont see where it says they are free.