Xonotic Forums
Running a Xonotic server on FreeBSD 8.2 - Printable Version

+- Xonotic Forums (https://forums.xonotic.org)
+-- Forum: Support (https://forums.xonotic.org/forumdisplay.php?fid=3)
+--- Forum: Xonotic - Server Administration (https://forums.xonotic.org/forumdisplay.php?fid=16)
+--- Thread: Running a Xonotic server on FreeBSD 8.2 (/showthread.php?tid=2777)



Running a Xonotic server on FreeBSD 8.2 - Pricetx - 03-25-2012

EDIT: I have now resolved the issue. I will post a brief summary below.

If you install the Xonotic server from FreeBSD ports it places a binary called "xonotic-dedicated" in /usr/local/bin/. You have to point any startup script you use at this binary.

I wrote a short script to make running the server easier which can be found here

/EDIT

I am trying to run a Xonotic server on FreeBSD 8.2. I have installed the Xonotic port. I have correctly configured server.cfg and moved it to the data folder. There server no .sh script for FreeBSD so I tried the Linux one. It gave me this error.

This script is not properly set up yet.
Please refer to the instructions in readme.txt.
In short:
- copy server.cfg to the data directory and adjust its settings
- move this file to the main directory of your Xonotic installation

I also installed the linux compatibility layer in case it was a requirement. This did not change the result.

Thanks.

Pricetx.


RE: Running a Xonotic server on FreeBSD 8.2 - Mr. Bougo - 03-25-2012

First of all, thank you for reading the readme!

server_linux.sh is fairly simple, in your case it only checks if there's an executable file called xonotic-linux32-dedicated (or linux64 if uname -m returns x86_64) in the script's directory.
I don't know about BSD so I can't tell for sure where the point of failure might be. Perhaps dirname? I have no idea. Try perhaps to add pwd after the cd dirname line and see where the script brings you.

Here's something you can do if you think everything is set up alright: run the server directly using ./xonotic-linux32-dedicated +serverconfig server.cfg
The working directory matters; that's mostly why you normally have to use the .sh to start the server.


RE: Running a Xonotic server on FreeBSD 8.2 - Pricetx - 03-26-2012

(03-25-2012, 11:41 PM)Mr. Bougo Wrote: First of all, thank you for reading the readme!

server_linux.sh is fairly simple, in your case it only checks if there's an executable file called xonotic-linux32-dedicated (or linux64 if uname -m returns x86_64) in the script's directory.
I don't know about BSD so I can't tell for sure where the point of failure might be. Perhaps dirname? I have no idea. Try perhaps to add pwd after the cd dirname line and see where the script brings you.

Here's something you can do if you think everything is set up alright: run the server directly using ./xonotic-linux32-dedicated +serverconfig server.cfg
The working directory matters; that's mostly why you normally have to use the .sh to start the server.

Hi, and thanks for the support!

EDIT: It turns out that I need to use the "xonotic-dedicated" binary in /usr/bin/

I placed a pwd command along with the usual echo error messages. The directory it outputs is "/usr/local/share/xonotic" which is the "root" xonotic folder.

I ran the server and got the following text:

http://pastie.org/pastes/3670774/text?key=vwuqtsosgzqsispa6pdeww

I'm not sure what the FS_OpenVirtualFile errors are but it appears to work okay.

I tried installing the full version of Xonotic from ports but that did not remove these errors.

Thanks.

Pricetx.


RE: Running a Xonotic server on FreeBSD 8.2 - Mr. Bougo - 03-26-2012

Here is what the xonotic server launcher and xonotic itself expect as far as filesystem goes:

- A xonotic-linux32-dedicated binary in the same directory or in the parent directory
- A server.cfg file in the data directory*
- Data files in the data directory* (maps, models, etc.)

The data directory can be two different locations, which each serve a different purpose in some cases: it can be a directory called "data" which is a subdirectory of the working directory, or it can be a directory called "data" found in $HOME/.xonotic/. In a multi-user system, this allows users to each have their own settings in their home directory while the core data files sit in a root-owned directory somewhere in the system hierarchy. In any system, it is always nice to separate default files from personal files, usually you should not touch the "main" data directory, so as to not lose any data with an update for example.

The working directory is set by the launcher to be either its own directory or its parent, depending on where the server binary is found. Your server failed to launch because the launcher set a working directory which did not contain data files. You will have to sort that out, or explicitly tell the engine where it should find its data files. That can be done at runtime or at compile time.

At compile time, you can use the DP_FS_BASEDIR make variable to make the engine look for the data files in a data subdirectory. For example, the Arch Linux packager did it like that:
Code:
    make -C Xonotic/source/darkplaces CPUOPTIMIZATIONS="${CFLAGS}" DP_FS_BASEDIR=/usr/share/xonotic/ DP_LINK_TO_LIBJPEG=1 cl-release
    make -C Xonotic/source/darkplaces CPUOPTIMIZATIONS="${CFLAGS}" DP_FS_BASEDIR=/usr/share/xonotic/ DP_LINK_TO_LIBJPEG=1 sdl-release
    make -C Xonotic/source/darkplaces CPUOPTIMIZATIONS="${CFLAGS}" DP_FS_BASEDIR=/usr/share/xonotic/ DP_LINK_TO_LIBJPEG=1 sv-release
The data files are located in /usr/share/xonotic/data/

At run time, you just need to use the -basedir flag, which takes as argument exactly what you would set DP_FS_BASEDIR as. You can add that to your server_linux.sh file in the exec line.


I'm guessing your server_linux.sh was in /usr/local/share/xonotic/. Where are the binaries? How did you install Xonotic?


RE: Running a Xonotic server on FreeBSD 8.2 - Pricetx - 03-26-2012

(03-26-2012, 01:10 PM)Mr. Bougo Wrote: Here is what the xonotic server launcher and xonotic itself expect as far as filesystem goes:

- A xonotic-linux32-dedicated binary in the same directory or in the parent directory
- A server.cfg file in the data directory*
- Data files in the data directory* (maps, models, etc.)

The data directory can be two different locations, which each serve a different purpose in some cases: it can be a directory called "data" which is a subdirectory of the working directory, or it can be a directory called "data" found in $HOME/.xonotic/. In a multi-user system, this allows users to each have their own settings in their home directory while the core data files sit in a root-owned directory somewhere in the system hierarchy. In any system, it is always nice to separate default files from personal files, usually you should not touch the "main" data directory, so as to not lose any data with an update for example.

The working directory is set by the launcher to be either its own directory or its parent, depending on where the server binary is found. Your server failed to launch because the launcher set a working directory which did not contain data files. You will have to sort that out, or explicitly tell the engine where it should find its data files. That can be done at runtime or at compile time.

At compile time, you can use the DP_FS_BASEDIR make variable to make the engine look for the data files in a data subdirectory. For example, the Arch Linux packager did it like that:
Code:
    make -C Xonotic/source/darkplaces CPUOPTIMIZATIONS="${CFLAGS}" DP_FS_BASEDIR=/usr/share/xonotic/ DP_LINK_TO_LIBJPEG=1 cl-release
    make -C Xonotic/source/darkplaces CPUOPTIMIZATIONS="${CFLAGS}" DP_FS_BASEDIR=/usr/share/xonotic/ DP_LINK_TO_LIBJPEG=1 sdl-release
    make -C Xonotic/source/darkplaces CPUOPTIMIZATIONS="${CFLAGS}" DP_FS_BASEDIR=/usr/share/xonotic/ DP_LINK_TO_LIBJPEG=1 sv-release
The data files are located in /usr/share/xonotic/data/

At run time, you just need to use the -basedir flag, which takes as argument exactly what you would set DP_FS_BASEDIR as. You can add that to your server_linux.sh file in the exec line.


I'm guessing your server_linux.sh was in /usr/local/share/xonotic/. Where are the binaries? How did you install Xonotic?

Hi. Fortunately I did manage to resolve the issue in the end, it's explained in my original post.

Thanks.

Pricetx.