UFO:AI dedicated server for Debian
=====================================

Running the server with systemd
--------------------------------------

The ufoai-server service runs a dedicated server as the user
"Debian-ufoai". This is a simple setup suitable for running one server
on a machine.

The user's home directory is /var/games/ufoai-server, so you can find UFO:AI
files in the /var/games/ufoai-server/.ufoai directory.

By default the server will use

/usr/lib/ufoai-server/base/debian_server.cfg,

for configuration which is a symlink to

/etc/ufoai-server/server.cfg.

Disabling the server
-------------------------

To disable the service, use the facilities provided by systemd.

    systemd disable ufoai-server.service

Running the server with cron and screen
---------------------------------------

One alternative way to run the server is to run it in a screen(1) session
from a cron @reboot action. This can be used to run multiple instances
of the server; you'll need to set a different net_port on each server after
the first, and it's safest to give each server a unique fs_homepath so they
don't overwrite each other's configuration files.

To do this, you could put something like this in the Debian-ufoai user's
crontab (don't break the long lines!):

    @reboot screen -d -m -S ffa /usr/games/ufoai-server +set fs_homepath /var/games/ufoai-server/ffa +exec ffa.cfg
    @reboot screen -d -m -S ctf /usr/games/ufoai-server +set fs_homepath /var/games/ufoai-server/ctf +set net_port 54321 +exec ctf.cfg

or in /etc/crontab or a file in /etc/cron.d:

    @reboot Debian-ufoai screen -d -m -S ffa /usr/games/ufoai-server +set fs_homepath /var/games/ufoai-server/ffa +exec ffa.cfg
    @reboot Debian-ufoai screen -d -m -S ctf /usr/games/ufoai-server +set fs_homepath /var/games/ufoai-server/ctf +set net_port 54321 +exec ctf.cfg

If you do that, you can access the servers' consoles by attaching a screen
session to them:

    sudo -u Debian-ufoai screen -r ffa
    sudo -u Debian-ufoai screen -r ctf
