.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Dominions 3: The Awakening (http://forum.shrapnelgames.com/forumdisplay.php?f=138)
-   -   Utility: Linux Admining (http://forum.shrapnelgames.com/showthread.php?t=30044)

Gandalf Parker September 1st, 2006 01:39 PM

Linux Admining
 
To answer the question in another thread that started this:

To admin remotely in text mode you have to login to a text-mode terminal. Two popular protocols are telnet and ssh. You can find terminal emulation programs that give you added features at your end which can be quite useful. I like NetTerm but its been a really REALLY long time since Ive looked at what was out there available.

Gandalf Parker September 1st, 2006 01:51 PM

Re: Linux Admining
 
Here is an example of a script I use to start a Dom3 game.
--------------------------
GAME=Armaggedon
PORT=7373

cd /home/dom3/dominions3
DIR=~/dominions3/savedgames/$GAME
mkdir $DIR

nice dom3 -T --makemap $GAME \
--mapaa --mapsize 1000 1000 --mapprov 250

nohup nice dom3 -g $GAME --port $PORT -STdddddddddd \
--preexec $DIR/pre_$GAME.sh \
--postexec $DIR/post_$GAME.sh \
--mapfile $GAME.map \
--era 3 --hofsize 15 --indepstr 6 \
--totalvp 18 --requiredvp 15 --summervp \
--magicsites 35 --renaming \
--hours 24 -q \
>>$DIR/$GAME.log 2>>$DIR/$GAME.err &

touch $DIR/pre_$GAME.sh
touch $DIR/post_$GAME.sh
chmod +x $DIR/*.sh

Gandalf Parker September 1st, 2006 02:02 PM

Re: Linux Admining
 
It looks like alot but its simple to use. You just change the first two lines to start a new game. The GAME and PORT variables.

Then it makes a gamesave directory. I know that the game makes one once the game starts but I need it before that.

This script generates a random map for the game to use that is named the same as the game. In this case, Armageddon. Thats a new Dom3 feature. When people join the game they will get the map sent to them. There are many map switches if you want to mess with them. Just add them there.
Just insert a # and remark it out if you dont want a random map. Change the --mapfile setting from $GAME to whatever map you want to use.

The game call itself adds many things you might not want. the ddddd heavy level of debug creates HUGE logs but they are fun to look at. You can change that to one d or take it off completely. I direct all of the games text responses to a log and the errors to an err file named for the game. In this case Armaggedon.log and Armageddon.err

the last 3 lines make sure that you have a pre and post shell that are in the right place and executable. They start out empty but you can easily edit them anytime even if the game has already started. They are great for various cleanup or management needs that popup.

Digest that abit and then I will put up a more complicated one. >:)

tibbs September 1st, 2006 03:15 PM

Re: Linux Admining
 
Thanks for all the useful info. I want to avoid using Telnet because it doesn't encrypt but I will look into NetTerm and SSH.

And this will take me a long time to digest. I just learned about the touch command and I think I need to re-read it because I have forgotten.

And it looks like I need to learn how to create scripts. This should keep me busy over the weekend.

Thanks,
Chris

Gandalf Parker September 1st, 2006 04:52 PM

Re: Linux Admining
 
Any commands you can type in to run can be put into a text file. If you make it executable (chmod +x file) then it becomes a script. You only have to iron out all of the steps one time. Then you put them into a script and forget all that trial and error you did.

The touch was a trick. It usually updates the creation date. But if the file doesnt exist then it makes one. That way you safely create a file but if one is already there then you wont destroy it.

alexti September 2nd, 2006 03:04 AM

Re: Linux Admining
 
I'd recommend PuTTY, especially if your client desktop is Windows.

Arker September 2nd, 2006 05:08 PM

Re: Linux Admining
 
Quote:

Gandalf Parker said:
Any commands you can type in to run can be put into a text file. If you make it executable (chmod +x file) then it becomes a script.

It also helps to put the magic numbers in.

#!/bin/sh

should be the very first thing in the file.

And to make sure the permissions are right

chmod 755 file

Gandalf Parker September 2nd, 2006 06:33 PM

Re: Linux Admining
 
The script I did isnt shell specific. Some later ones I do have a shell line since they use special shell variables for things like randoms.

And yeah I guess for public info its probably best to chmod 755 but +x for executable seems easier for people to remember even if it is sloppy.

Of course for public info I probably shouldnt have mentioned telnet since trying to argue down ssh is something only security people would do.

So did everyone follow that script? No questions?

tibbs September 5th, 2006 02:39 PM

Re: Linux Admining
 
I didn't get a chance to try it yet. I was busy with painting a few rooms in the house. Hopefully early this week.

Bluebird September 10th, 2006 08:21 PM

Re: Linux Admining
 
Just as a hint: I am normally hosting games on unix using the 'screen' command. It is a like a 'window manager' for text consoles and has many features (too many to list them here). The nicest one is that you can 'detach' a terminal session which continues running even if you logout, and later 'reattach' to that terminal session on next login.


All times are GMT -4. The time now is 02:08 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2021, Shrapnel Games, Inc. - All Rights Reserved.