1fx. Mod Free server mod for Soldier of Fortune II

Installation on Linux

This page describes basic installation on Linux. It will help you install the Mod on a home server. This guide is not helpful when you host your server with a game server provider (GSP). If that's the case, we suggest you read the Config.cfg file carefully on your FTP or ask your GSP to configure it.


Prerequisites

Before you start fiddling with 1fx. Mod, you should first check the integrity of the SoF2 installation directory you're going to install the Mod in. We often see lots of oddities and bugs arise due to all sorts of client-side Mods already installed, that due to sharing files with the server-side of SoF2MP interfere with the proper working of 1fx. Mod.

As a general rule of thumb, always install 1fx. Mod in a clean SoF2 installation directory that you only use to host the server. It will save you lots of trouble later on.

Requirements

The requirements of running 1fx. Mod on Linux are a little higher than SoF2. Take note of the extra requirements:

Installing the correct executable

It is imperative to use the executable inside the 1fx. Mod download to ensure 1fx. Mod works as expected. You will find the executable file in the "Server files" directory.

This sof2ded file is the original executable file, with no patches applied at all, since 1fx. Mod patches your executable dynamically during startup. Using a patched executable will likely lead to crashes. If you are sure you don't use any kind of patched executable, you can go ahead and skip this step.

You may use the following checkums to ensure the integrity of your executable (md5sum):

Installing 1fx. Mod

Head over to the 1fx. Mod download page and head down to the download section. Take note of the SoF2 version and download the appropriate Linux version of 1fx. Mod. The package downloaded is a .tar.gz archive.

After downloading the package, extract the contents. It's best to do this in an empty directory so you'll easily find the files after extracting. You can do this either from with your preferred archive manager or directly from the terminal. In the examples below, we'll do it from within the terminal.

After extracting you'll find two new directories:


Extracting the Mod, showing the generic contents and the contents of the Server files directory.

Open the "Server files" directory and copy all directories found to the SoF2 installation directory you're going to use to host 1fx. Mod. In our example, this is only the "1fx" directory.

Please note: There may be more directories in the "Server files" directory, next to the "1fx" directory. Be sure to copy all directories found in the "Server files" directory to the SoF2 installation, even if they don't appear on the screenshot above.

After you finished copying, it will look a little like this (your mileage may vary):



Example contents of a SoF2 directory with 1fx. Mod freshly installed.

Congratulations! You just installed 1fx. Mod! Yes, it's really this easy.


Configuring 1fx. Mod

Next on, you probably want to configure your server before starting it. Fortunately, it's very easy to configure your server. First on, go into your "1fx" directory and find the Config.cfg file. This file contains 90% of your server configuration.

Open the Config.cfg file with your editor of choice. If you're unsure, using nano is usually a good option.


Editing the Config.cfg file using nano.

Don't forget to also adjust the intial mapcycle found in the "files" directory (mapcycle.txt).


Running 1fx. Mod

Look for the "Start Server.sh" file in the "1fx" directory to start your server. If you downloaded the Universal package, it may also be called "Start Linux Server.sh".

Execute it, and you're done! Your server is now running. You can use the "1fxver" command to check what 1fx. Mod version you're running. By opening the game you should be able to find this new server in your local server list!



SoF2 server running 1fx. Mod.

Tips and tricks

Below are a few tips and tricks that may come in handy, but didn't really fit in the main tutorial. Use them how you see fit.


Running the 1fx. Utility scripts

Included in the downloaded 1fx. Mod download package are the extra utility scripts. Those are scripts written in Python and will run on every major platform without issues.

You will need at least Python 3.3 to run them correctly. If you're compiling Python from source because the Python your distribution has is too old, you'll also need the 'libsqlite3-dev' package installed in order to build Python with SQLite support.


Patches fail to apply

Your game may throw the following error when starting with 1fx. Mod: Patching the executable failed! Aborting the game.

This may occur on newer distributions that have a protection for ptrace attaching to processes. We use ptrace in order to apply the dynamic runtime memory patches, so it is absolutely required for 1fx. Mod that this functionality works.

To fix this issue, edit the /etc/sysctl.d/10-ptrace.conf file (create it if it doesn't exist yet), and add the following to it: kernel.yama.ptrace_scope = 0

The above fix tells the kernel that ptrace may attach to all running process again, like it traditionally did on Linux. A reboot is necessary.


Stack frames don't get logged

This applies only to the debug builds of 1fx. Mod, like the Nightly builds. When 1fx. Mod crashes it tries to write the stack trace to the crashdump file. Using the stack trace, debugging is a lot easier for us as we're usually able to pinpoint the exact location of the problem.

If this doesn't work, the game may write the following to the log file: ERROR: No stack frames present to log. You're also able to detect this problem because there will be no stack trace written to the crashdump file. This usually only happens on 64 bit systems.

The fix is to install the 32 bit GNU C shared libraries. On Debian, the required packages to install are 'lib32gcc1' and 'libc6-i386'. The package names may vary for other Linux distributions.


Problems with running on a VPS

If for some other reason the patches fail to apply, sometimes due to a "Unknown signal 32" error, the problem is usually your VPS. 1fx. Mod is known to have problems with VPSes that use OpenVZ virtualization. This is because you have absolutely no control over the kernel on a VPS using OpenVZ virtualization: the kernel is shared with the host. Other hypervisors, such as KVM, Xen or ESXi don't share the same problems because the guest OS has its own kernel.

OpenVZ may be fine for running websites and such, for 1fx. Mod it is simply a no-go. We usually recommend people to take a KVM VPS, where you're certain 1fx. Mod will work properly.


Running on a Raspberry Pi

Wait, what? SoF2 server on a Raspberry Pi? Even though it's ARM?

Yes! That's totally possible with the use of extra software like ExaGear. We tested it ourselves on a Raspberry Pi 2B and found out it worked flawlessly. Map switches are a bit slow due to the limited I/O (especially if you're used to using a SSD), but even the time it takes to switch maps is acceptable.

Unfortunately, the Linux binary of SoF2MP only works for v1.03 servers. The extra libraries v1.00 servers use won't run on ExaGear. For v1.00 you can still emulate the Windows version, albeit a little bit slower, but works perfectly nevertheless.

If you want a cheap dedicated SoF2 server, that draws little power and want to get more into the world of Linux, this may be something for you.