BZFlag Server 2.4.0 on Debian

I did a bit of work to get a BZFlag 2.4.0 game server running on one of my virtual Debian servers. I’m sure there must be a better/smarter way to do the same thing, but this is what I did.

First of all, I just downloaded the sourcecode for BZFlag 2.4.0 from their homepage. Then it was just a matter of making sure I’d installed what my Debian server needed to compile the code.


$> su -
$> apt-get install build-essential

After unpacking the code, and going into the unpacked directory, it was just a matter of doing…


$> cd ~magvar/bzfs2.4.0
$> ./configure
$> make

To make sure I could run more than one version of the game server, I placed the 2.4.0 version of the scripts needed in their own directory.


$> su -
$> mkdir -p /usr/games/bzflag
$> cp ~magvar/bzfs2.4.0/misc/bzfs ~magvar/bzfs2.4.0/misc/bzfsd /usr/games/bzflag/

I had to update the bzfs script, the server startup script, a little. The following were the changes I had to make.


# Set this path to the place where you keep the bzfsd script
bzfsd_path=/usr/games/bzflag/bzfsd
...
# Set this to your bzfs options
bzfsopts="-conf /etc/bzfs/bzfs.conf"

I also think I had to change the location of the lockfile.


/var/lock/$prog

I updated the bzfsd file to contain the following line to do the execution.


nohup /usr/games/bzflag/server/bzfs $* > $BZLOGFILE &

I edited the bzfs.conf file (controlling the configuration of what’s possible to do in the BZFlag game), and put it under /etc/bzfs.conf.


-a 50 38
-j
+r
-t
-s
-f B
+f GM
+f L
+f SB

Note that I made sure to remove the “Blindness” (B) flag. SmartBullets and Lasers are fun, though.

Missing were, among other things, /etc/init.d/functions. Found that, by luck, and just copied the code to a file, i.e /etc/init.d/functions

I got the whole file from this site.

I had to edit a few things out, among other things I hardcoded consoletype to one (1), as it’s a virtual terminal (no user behind the keys). Adding this after the export of PATH did the trick.


export CONSOLETYPE=1

Then it was just a matter of copying the binary and setting up the server to start automatically.


$> su -
$> mkdir /usr/games/bzflag/server
$> cp ~magvar/bzfs2.4.0/bzfs/bzfs /usr/games/bzflag/server
$> ln -s /usr/games/bzflag/bzfs /etc/init.d/bzfs.sh
$> cd /etc/init.d
$> update-rc.d bzfs.sh defaults

And hopefully that’s all that’s needed to get it running. Looking at my rebooted server, I’ve got a process running, at least. The init-file I linked to is located here.

 


root 1067 1 0 19:33 ? 00:00:00 /usr/games/bzflag/server/bzfs -conf /etc/bzfs/bzfs.conf

Advertisements

About magvar

Technical guy, worked with computers since I was twelve, complete nerd, but managed to get married and am now the happy father of three kids.
This entry was posted in Uncategorized. Bookmark the permalink.

2 Responses to BZFlag Server 2.4.0 on Debian

  1. pcace says:

    Hey, thanks for the tut, but could you please post the whole init.d script u used to start the bzfs server?

    Thanks,

    Pcace

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s