The OpenNET Project
 
Поиск (ключи):    ПРОГРАММЫ СТАТЬИ СОВЕТЫ ФОРУМ
  WIKI НОВОСТИ (+) MAN'ы ДОКУМЕНТАЦИЯ

Поиск:  Каталог документации

2. Basics

Game servers can consume a lot of CPU and bandwidth (depending on the game and the number of connected players). If you don't own the machine and want to run a server from your account, ask the system administrator first.

2.1. Security and permissions

All dedicated servers are strongly recommended to be run from another user than root. I recommend that you create a new user that handles all the game servers. You may not have permission to create certain directories mentioned in this document as a normal user, for example /usr/local/games/quake3. If so, create it as root and then chown user:group /usr/local/games/quake, where user is your username and group your group, or simply create it in your home directory.

2.2. Keeping the server running

If your game server crashes, a shell script like the one below might come in handy so you won't have to restart it manually. It can easily be modified for whatever server(s) you're running.

#!/bin/sh

quake3dir="/usr/local/games/quake3"
binname="linuxq3ded"
cd $quake3dir
process=`ps auxwww | grep inet | grep -v grep | awk '{print $12}'`

if [ -z process ]; then

  echo "Couldn't find quake 3 running. Restarting it"
  nohup ./linuxq3ded +exec ffa.cfg &

  echo ""

fi

Put the script somewhere, name it sv_up or whatever you like, and make cron run it every 5-10 minutes:

*/10 * * * * /usr/local/games/quake3/sv_up.sh >/dev/null 2>&1

Put this in crontab (crontab -e). It will execute sv_up.sh (the shell script above) every 10 minutes and its output is sent to /dev/null (in other words, it disappears instead of being mailed to you).


АКЦИЯ! ПОДПИШИСЬ на журнал Linux Format до 31 января 2012 года и выиграй СУПЕРПРИЗ!

Журнал "Linux Format" (Линукс Формат)- Единственный в России и странах СНГ журнал на русском языке, посвящённый Linux и свободному ПО. Журнал для IT-директоров, IT-менеджеров, программистов, системных администраторов, учителей школ и преподавателей ВУЗов и всех пользователей ПК. В каждом выпуске: Новости индустрии OpenSource, обзоры новинок свободного ПО, обучающие и методические статьи.

Каждый, кто оформит подписку, получает бонус- объёмные наклейки на системный блок и подарки: с одним из первых выпусков журнала в 2012 году- диск с архивом номеров за 2005-2011 г.г. и ежемесячно электронную версию журнала в pdf-формате.

Подробнее о проведении акции вы можете прочитать на странице сайта.


  Закладки на сайте
  Проследить за страницей
Created 1996-2012 by Maxim Chirkov  
ДобавитьРекламаВебмастеруГИД  
RUNNet TopList