In short, there isn't an easy 'make install' option for this, as it
runs in a chroot environment and is somewhat specific to a server.
It should compile on most modern Linux distros, although there are
a couple things which do hinder total portability.
That said, it shouldn't be too hard to figure out most of the defines
in dgamelaunch.(c|h), and I'm more than happy to help out with any
questions.
Me: M. Drew Streib <dtype@dtype.org>
Mailing list: http://alt.org/mailman/listinfo/nethack/
BASIC SETUP INSTRUCTIONS
===========================
1) Setup a chroot area, with a bin directory, a var directory, and a
'dgldir' directory. You'll also need 'etc' and 'etc/terminfo' for
curses.
2) If using the #define's as an example, setup 'rcfiles', 'ttyrec',
and 'inprogress' directories, in the dgldir. Also touch the files
'dgl-login' and 'dgl-lock' in the main chroot directory.
Your directories/files should now look like this:
/chrootdir/bin/
/chrootdir/var/
/chrootdir/etc/
/chrootdir/etc/terminfo/
/chrootdir/dgldir/
/chrootdir/dgldir/ttyrec/
/chrootdir/dgldir/inprogress/
/chrootdir/dgldir/rcfiles/
/chrootdir/dgl-login (empty)
/chrootdir/dgl-lock (empty)
They should all be owned by the user you intend to run this as.
2) In the #define's in dgamelaunch.c and dgamelaunch.h, change the
values for those directories, sort of using my own directory setup
as an example.
3) Compile nethack, and basically tell it that /var is its playground,
since it will be in the chroot environment. There should be no need
for special nethack compilation instructions, but it will need to be
installed to the chroot environment. A static compile will ensure that
it can run without any libraries, or you can of course place libraries
in the environment.
For security reasons, I'd avoid putting any shells, etc, in this environment
though, of course. Just whatever needs to be exec'd, which is namely,
nethack.
4) Be sure to set the user id's in the #define's of dgamelaunch to
the owner of the chroot directory, so nethack and dgamelaunch have
access to their files. This user needs a lot of write access, but
you can leave the executables owned by someone else.
5) Either setup dgamelaunch as the shell for a single login, in which
case it must be suid root (don't worry. It sheds privs right after the
immediate chroot), or set it up as an inetd service. I use the following
lines for my xinetd.conf.
service telnet
{
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/sbin/in.telnetd
server_args = -L /opt/nethack/nethack.dtype.org/dgamelaunch
rlimit_cpu = 3600
bind = 64.71.163.206
}
6) Populate /chrootdir/etc/terminfo with terminfo files. I think that most
modern ncurses will default to terminfo when it is available. Mine seemed
to. This also makes it easy to add term types on the fly.
7) You can test your compilation of dgamelaunch by simply running
it as root, just as a shell (with suid) or inetd might do.