Difference between revisions of "User:Paxed/HowTo setup dgamelaunch"
Jump to navigation
Jump to search
(first info, from when i last set up a server...) |
m (link to compile) |
||
Line 1: | Line 1: | ||
− | Note: This | + | '''Note''': This applies to NetHack 3.4.3 and the svn-version of [[dgamelaunch]], on linux. These instructions should be complete, but I haven't tested it lately. |
---- | ---- | ||
Line 7: | Line 7: | ||
===Compile NetHack=== | ===Compile NetHack=== | ||
− | *Make sure you can compile NetHack (the Linux TTY version). | + | *Make sure you can [[compile]] NetHack (the Linux TTY version). |
*Edit include/config.h and change HACKDIR to "/nh343" (Note that there are more than one definition of HACKDIR in there!) | *Edit include/config.h and change HACKDIR to "/nh343" (Note that there are more than one definition of HACKDIR in there!) |
Revision as of 13:20, 28 November 2010
Note: This applies to NetHack 3.4.3 and the svn-version of dgamelaunch, on linux. These instructions should be complete, but I haven't tested it lately.
Setup
To set up a public NetHack server using dgamelaunch svn version:
Compile NetHack
- Make sure you can compile NetHack (the Linux TTY version).
- Edit include/config.h and change HACKDIR to "/nh343" (Note that there are more than one definition of HACKDIR in there!)
- Edit include/unixconf.h and change VAR_PLAYGROUND to "/nh343/var"
- Edit top Makefile by commenting all lines that reference $SHELLDIR (We don't need to install the shellscript that is usually used to launch NetHack)
- Edit top Makefile by changing PREFIX to the directory which will be the chroot environment and contain all the files the server needs. We'll be using "/opt/nethack/nethack.alt.org" here as an example.
- Edit top Makefile by changing GAMEDIR to $(PREFIX)/nh343 (This must match HACKDIR in include/config.h)
- Edit top Makefile by changing VARDIR to $(GAMEDIR)/var (This must match VAR_PLAYGROUND in include/unixconf.h)
- Edit top Makefile by changing GAMEUID and GAMEGRP to the user and group you will run nethack as; by default these are games and games in dgl settings.
- Create the binaries with "make all". If things went smoothly, do "make install" (or "make update" if you've already installed NetHack once to the chroot dir)
- Continue on to dgamelaunch compiling.
Compile dgamelaunch
- You need subversion and autoconf -packages, plus SQLite development libraries.
- get the newest version of dgamelaunch:
- Prepare for compilation:
cd trunk ./autogen.sh --enable-sqlite --enable-shmem --with-config-file=/opt/nethack/nethack.alt.org/etc/dgamelaunch.conf
- Make dgamelaunch with 'make'
- Edit dgl-create-chroot and change the default settings to match your chroot location and so on, then execute dgl-create-chroot. It should copy all the necessary files and put them into the chroot environment.
- Test that you can run dgamelaunch (as root):
cd /opt/nethack/nethack.alt.org ./dgamelaunch
- Edit /opt/nethack/nethack.alt.org/etc/dgamelaunch.conf to suit your needs:
- 'max_nick_len' should be kept at 10, unless you change NAMSZ in src/topten.c and recompile NetHack.
- 'chroot_path' should be "/opt/nethack/nethack.alt.org/"
Testing the setup
- Test that you can run the nethack inside the chroot environment, by doing the following as root:
cd /opt/nethack/nethack.alt.org chroot ./ nh343/nethack
- If NetHack doesn't start but you get a complaint about missing file or directory:
chroot: cannot run command `nh343/nethack': No such file or directory
That usually means some dynamic library isn't present in the chroot. Use "ldd nethack" to see what dynamic link libraries are needed.
- If you get a complaint about unknown terminal type, that means there's some problem with the terminfo files. Check that there is a terminfo file in the chroot that corresponds to your $TERM setting.
- Set up the telnetd to accept incoming connections, for example if you're using xinetd:
service telnet { socket_type = stream protocol = tcp user = root wait = no server = /usr/sbin/in.telnetd server_args = -L /opt/nethack/nethack.alt.org/dgamelaunch rlimit_cpu = 120 }