XASECO2 init.d Scripts

On Unix/Linux starting and stopping applications is commonly done via init.d scripts (on System V-derived distributions) and less commonly via rc* scripts (on BSD-derivatives). Variants such as the custom init system on Gentoo and new developments like initng and upstart also exist. See Wikipedia for more information on init.

This page aims to collect proven and tested init.d scripts for XASECO2 on a variety of distros. You are encouraged to submit scripts for distros not listed here, as well as other useful start/stop scripts. XASECO2 requires the dedicated server, and scripts for that can also be found on this site.

For more discussion of Linux start-up scripts, see for example this thread and this one. For a web interface to starting/stopping TM-related processes, try the Nouse Web Tool Bundle.

Principles

The entire TrackMania² server system is assumed to be installed in /home/tm2/, with the dedicated in /home/tm2/TM2/ and XASECO2 in /home/tm2/xaseco2/. The user is named tm2 and the group is tm, allowing for multiple TM users within this same group. You are of course free to deviate from this but will then have to adapt the scripts yourself.

Processes are started under the aforementioned user, and can be accessed (e.g. to check their status) by process name or ID. It is therefore recommended (and for some scripts mandatory) that the process name is unique when running multiple dedicated servers and XASECO2s.

Process IDs can be stored in /var/run/*.pid files, and process locks in /var/lock/ or /var/lock/subsys/ can help prevent running the same process more than once, but not all distros deploy both mechanisms.

When scripts invoke the standard XAseco2.sh script that launches the main PHP program xaseco2.php, it is expected to look similar to this:
/home/tm2/xaseco2/XAseco2.sh :
#!/bin/sh
cd /home/tm2/xaseco2
/usr/bin/php xaseco2.php TM2 </dev/null >xaseco2.log 2>&1 &
echo $!
The 'TM2' parameter aims to distinguish this xaseco2.php process from others when running multiple scripts. The init.d script itself is expected to be named /etc/init.d/xaseco2.

Scripts Index

Last updated: 2013-03-02