Today I released version 1.1 of the Daikatana Linux Server Scripts.
———————————————
- Daikatana Server-Launch Script 1.2 Readme -
———————————————
Script written and developed by Martin “DI-MeisterM” Mueller
http://www.DaikatanaNews.net
———————-
CHANGE LOG VERSION 1.2
———————-
FIXES:
- /dkserver/bin/daikatana_vnc.sh -> added 16 depth parameter for Xvnc launch, to prevent a wine launch bug
NEW FEATURES:
- /dkserver/bin/daikatana_control.sh
This script can enable & disable the cronjob of the server. You can also enable Mplayer or Lanpatch physics for Daikatana DM Demo.
—————–
Table Of Contents
—————–
1.) Introduction
2.) How Does It Work?
3.) Installation
4.) Configuration
5.) Crontab Example
6.) Contact
—————-
1.) Introduction
—————-
The main task of this collection of cronjobs and scripts is to create a Daikatana Unix/Linux Server solution which runs within a terminal console without X-Window System.
This aim was reached with an effective combination of the packages “wine” and “vncserver”, which are available for the majority of Unix and Linux distributions.
———————
2.) How Does It Work?
———————
This script collection uses follow process flow:
1.) Creates 1 to n X-Window Instance(s) with xauth password protection
2.) Creates for each X-Window instance an dedicated Daikatana Server process, which uses “wine” for launching
The script also checks the following:
- Is the X-Window instance running? If not, it creates it and launches the dedicated Daikatana Server process within it
- Is the Daikatana Server instance running? If not, it launches a new dedicated Daikatana Server process using a pre-defined cfg file
Furthermore this script packages includes two example cronjobs which can be set for user “root” in “/etc/crontab”.
The “daikatana_check.sh” script is the main program which was explained with the process flow description.
The “daikatana_kill.sh” script kills ALL Xvnc-Window processes. This also means it kills every single dedicated Daikatana Server process. It’s an optional script.
—————-
3.) Installation
—————-
Copy the archive “daikatana_linux_server_script_1.2.tgz” to the destination of your choice (on your Unix/Linux server) and un-tar it.
The example destination here is “/home/martin”.
$ cp daikatana_linux_server_script_1.2.tgz /home/martin
$ cd /home/martin
$ tar xvzf daikatana_linux_server_script_1.2.tgz
Now following directory structure is created:
/home/martin/dkserver/
bin/
daikatana_vnc.sh
daikatana_kill.sh
daikatana_server.sh
vncdisplays.lst
daikatana_check.sh
daikatana_control.sh
cron/
dk_check_each_minute.cron
dk_kill_every_23_hours.cron
log/
daikatana_server.log
—————–
4.) Configuration
—————–
To be able to successfully launch the scripts you have to adjust some parameters of the script files.
File: daikatana_check.sh
The parameter and variables under # GLOBAL SETTINGS must be set.
NUMBER_VNC_DISPLAYS = How many X-Windows should be created? Each Daikatana Server instance / cfg-file needs one X-Window
DKPATH = Path to your Daikatana directory
DK_CFG_FILENAME_PREFIX = The prefix of the cfg-name in your Daikatana/Data directory. An example cfg-file for Daikatana is included in this package
DK_CFG_FILENAME_SUFFIX = The suffix of the cfg-name in your Daikatana/Data directory. An example cfg-file for Daikatana is included in this package
SCRIPTPATH = The path where “dkserver” is located
LOGFILE = The path where “daikatana_server.log” is located
File: daikatana_vnc.sh
The parameter and variables under # VNC SETTINGS must be set.
VNC = Path where Xvnc is located. If you don’t have this package you can install it with “sudo apt-get install vncserver” or “sudo apt-get install tightvncserver” (Debian)
VNCPASS = Path to the XAuthority password file. It should be set before with the command “vncpasswd”
VNCPARA = Shouldn’t be modified. It can be filled with nothing if no XAuthority password protection is needed
File: daikatana_server.sh
The parameter and variables under # SERVER SETTINGS must be set.
LAUNCHDK = Path where Wine is located. If you don’t have this package you can install it with “sudo apt-get install wine” (Debian)
PORT = Shouldn’t be modified. It reads out the Daikatana Server Port of the cfg-file.
MAP = Shouldn’t be modified. It reads out the Daikatana Server Startup Map of the cfg-file.
IP = Shouldn’t be modified. It reads out the local-ip address of the machine.
File: daikatana_kill.sh
The parameter and variables under # Constants must be set.
SCRIPTPATH = The path where “dkserver” is located
LOGFILE = The path where “daikatana_server.log” is located
——————-
5.) Crontab Example
——————-
This is an example of the configuration for “/etc/crontab”:
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don’t have to run the `crontab’
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
SHELL=/bin/sh
XAUTHORITY=/home/root/.Xauthority
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root:/home/martin
* * * * * root /home/martin/dkserver/bin/daikatana_check.sh
* */23 * * * root /home/martin/dkserver/bin/daikatana_kill.sh
The parameters XAUTHORITY and PATH vary from system to system. XAUTHORITY points to the path for the xauth environment.
PATH needs to be extended with path to the dkserver scripts. In this example it’s: “/home/martin”.
The last two lines are the cronjobs. The main program of this package “daikatana_check.sh” is set to check each day, minute, month, hour.
The second one “daikatana_kill.sh” kills the server each 24 hours.
* * * * * Path/Script
- – – – -
| | | | |
| | | | +—– Day of the week (0 – 7) (Sunday 0 or 7)
| | | +——- Month (1 – 12)
| | +——— Day (1 – 31)
| +———– Hour (0 – 23)
+————- Minute (0 – 59)
———–
6.) Contact
———–
If you have additional questions feel free to email me at:
mail daikatananews net
Or post into this forum thread at PlanetRomero:
http://planetromero.com/gametalk/?wpforumaction=viewtopic&t=49.0