What is this document about?

This is the Halflife deicated server HOWTO and FAQ for linux it is prepared by Tim Fletcher cos someone else got round to writing the quake howto before I did :). I spend a lot of time running games servers on linux mostly at LAN parties, and so I thought I would try writting some documentation for halflife on linux, as I have got it running with few problems and other people apper to have some problems.

This howto can be found at:
Main site:WiredSoc
Mirrors: Demon, PlanetHalflife

Last update: Sat Aug 28 12:05:32 BST 1999

For much more general halflife server information take a look at The Command Centre this site is run by Geronimo the man that first asked me write this document as a feature for his site, it has since grown a little :).

Coming real soon now (honest):

Where to get the server from:

The latest version of the server is 3014 (which is used with client versions 1013) and it can be got from:

http://www.won.net

Direct urls:
ftp://ftp.won.net/pub/half-life/server/linux/hlds_l3014.tar.gz

The Update from 1010 to 3014 is at:
ftp://ftp.won.net/pub/half-life/server/linux/hlds_l10103014.tar.gz

    Installing:

  1. Make a directory for it:
    mkdir /usr/games/halflife

  2. Change into the firectory:
    cd /usr/games/halflife

  3. Untar it:
    tar xfzv /path/to/hlds_l3014.tar.gz or hlds_l10103014.tar.gz

  4. Getting the server to access the shared library (libhlwon.so)

    There are 2 ways to do this, the first way (LD_LIBRARY_PATH varible) is a little more complex but more unix compilent, the second way (symlinking the libhlwon.so into /usr/lib/) is easier to understand and use for linux newbies.

    The first way is to set the LD_LIBRARY_PATH enviroment varible to contain the location of the library by running (before the server is started):
    The enviroment varible LD_LIBRARY_PATH tells linux were to look for libraries (linux version of dlls) if they aren't in the directories defined in /etc/ld.so.conf
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/games/halflife

    This also helps if you don't have root access on the server box that you are using to run the Halflife server off (though I hope you has asked the admin first as hlds_l in a fairly hungry process)

    A simple script can be made to do this eg:

    #!/bin/sh
    export LD_LIBRARY_PATH=/path/to/halflife:$LD_LIBRARY_PATH
    cd /path/to/halflife
    ./hlds_l $*
    

    The second way is to link the halflife shared library into a system wide shared library directory:
    ln -s libhlwon.so /usr/lib/

    Then rerun ldconfig:
    /sbin/ldconfig

    NB. You will have to remove the old lib if you have already copied it into the directory (as per the linuxreadme.txt from valve) and are trying to link on top of it.

    Linking libhlwon.so into a lib directory (/usr/lib) is much better than coping around a large lib and makes upgrades easier as you only need to rerun ldconfig not recopy the lib.

    This is alot neater than Valve's suggested way (of copying the lib) but it does require root access to the machine. It is also better for those people who want the server up and running fast and don't really care to setup a script to set the enviroment up first.

Running the server:

Start the server by running from the halflife directory:
./hlds_l +map undertow +maxplayers 16

or for a LAN server:
./hlds_l +map undertow +maxplayers 16 +sv_lan 1 -nomaster

FAQ's

  1. Why does my server take forever (180 secs) to start?

    If you are not on a internet connected LAN and have a problems starting the server (ie it takes forever to start) then add to your /etc/hosts the lines:
    some.ip.or.other half-life.west.won.net
    some.ip.or.other half-life.east.won.net

    Were the ip's are the same as your halflife server.

  2. My server complains that it can't find readline.so, what do i do?

    This was a mistake on the part of valve (now corrected) that ment a standard programing lib (used to parse command line options given to programs) that is normally statically linked into the binary (and hence unneeded when the binary was run) was dynamically linked instead.

    The missing file error arises from the fact that only RedHat appers to install the readline.so lib and so any Slackware, SuSE or other distro users have problems unless they compile the library themselves.

    The fix is to upgrade as the latest (3014 at the time of writing) server where this problem has been fixed.

  3. My server complains that it can't find a file, now what?

    This arises from the fact that valve have linked agaist the latest glibc C libs (as found on all modern distros). The problem here comes from the fact that most older distros (Redhat older than 4.2, Slackware older than 4.0, SuSE older than 6.0 and debian older than 2.0) don't have the glibc libs installed by default. And so the server can't run.

    You can check that all the libs are found by the server by running ldd ./hld_l from the server directory

    There are 2 different fixes here:

    You can upograde your distro to the latest one, I would recimend this in the case of Redhat 4.2 or older as that is very old the others need to have compaterblity librarys installed as they are relitivly modern.

    You can install the glibc compaterblity libs, the only one I know much about this for is slackware (my personal choice of distro) info for any others would be nice.

    To install the libs for slackware download:
    ftp://ftp.cdrom.com/pub/linux/slackware-4.0/contrib/glibc-2.0.7pre6.tgz

    and run as root: /sbin/installpkg /path/to/glibc-2.0.7pre6.tgz

  4. I have an SMP machine but hlds_l only uses one processer?

    This is correct, hlds_l in at the present time single threaded and so can only run on one cpu at a time. However mike is talking about getting smp support put into the server but the timescale isn't clear on this project.

    You can still benifit from 2 (or more :) cpus in a deicated halflife server, firstly because all none halflife tasks (networking, disk i/o, etc) can be done by the 2nd cpu. Or you can just run multiple servers so long as you have enough memory in the machine.

  5. I've heard of this Team Fortress addon halflife, howdo I get that going?

    Team Fortess Classic (tfc) is a publicly avalible version of the payware mod (which looks awesome BTW) that valve are working on. It is a classes based teamplay mod that encourges (and rewards) players for working as a team to capture the enemy flag and kill the opposition.

    To run a teamfortress game add the -game tfc switch to the command line eg:
    ./hlds_l -game tfc +map undertow +maxplayers 16

    or for a LAN server:
    ./hlds_l -game tfc +map undertow +maxplayers 16 +sv_lan 1 -nomaster

    From comments on the hlds-linux mailing list a tfc server takes up a good deal more cpu time than a normal server, partictually demo men amd heavy weapon guys are bad for servers (and every thing around them as well :) due to the large amount of explosives involed

  6. I've got FreeBSD 3.0 or later does hlds_l work in emulation mode?

    Yes, I have recived a mail from Patrick Tullmann telling me that the latest version of hlds_l (1012) works fine on his FreeBSD 3.0.0 machine under emulation. I am told (by him) that "it just works" when asked how to get it to work, but he says that he is happy to answer and FreeBSD+Halflife questions that you want to send him.

  7. I'm running server veriosn 1010d/1012 and I get errors from clients about maps "Hunted" and "The Rock"

    It appers that there are some slight problems with the pak0.pak from the 1010d/1012 server with these 2 maps being different from the pak0.pak with the client (1010). You can get an updated / fixed .pak from ftp://ftp.valvesoftware.com/uplink/pak0.PAK or if you are on a modem you can apperently just copy over the latest client .pak

  8. Can I use linux's IP aliasing functions with hlds_l

    Yes you can as of 1010b just add +ip to the command line to bind the server to a particular ip address including an alias such as eth0:0

  9. I get errors about and unresolved symbol __bzero

    This error comes from the fact that the 3013 server was compiled on RedHat 6.0 and the libc-2.1 that redhat uses is not backwards compatable. The quick fix is to download the update to from 3013 to 3014 (only about 300k) from http://stahl.stuco.uni-oldenburg.de/clanjjw/files/hlds_l30133014.tar.gz

  10. I don't want to run a server I want to play halflife

    Sorry no can do, they may be a client port in progress (enough people have asked for it) but there isn't one at the moument. You could try running halflife under wine or VMware but you aren't going to get any help from me on those, as there are masses of docs on them already.