diff --git a/html/doors.html b/html/doors.html index 9074b06a..454670ca 100644 --- a/html/doors.html +++ b/html/doors.html @@ -17,7 +17,77 @@
+Running DOS doors is possible on systems that can run +dosemu. The latest versions of dosemu don't +need to be started suid root or started using sudo, it can run as the user that +is logged in the bbs. Since that is possible, a new location for the virtual C: +drive is now being used withing the $MBSE_ROOT file structure. This virtual C: +drive is owned by the group bbs. The basic ideas how doors should be run written +by Redy Rodriguez are still valid, but some scripts are changed and some dosemu +files must be copied into the mbse directory tree. +
+
+Some distributions have good dosemu packages, others don't. You need a dosemu
+that can be used in a systemwide multiuser setup. The bad packages want to have
+the dos drive in each users home directory, this is not what we want for doors.
+If you don't have a good dosemu you have to compile your own. This is not too
+complicated. First download the source from dosemu. You don't need the freedos-bin source
+if you are going to use ms-dos or pc-dos.
+Unpack the source in some directory of your choice and compile the sources:
+
+mbse@seaport$ tar xfvz dosemu-1.2.2.tgz +mbse@seaport$ cd dosemu-1.2.2 +mbse@seaport:~/dosemu-1.2.2$ ./configure --prefix=/usr --sysconfdir=/etc/dosemu --with-x +mbse@seaport:~/dosemu-1.2.2$ make ++Note that the
--with-x
is not needed for running doors, but it
+might be handy that you can use dosemu as user mbse in X to do maintenance on
+your doors.+root@seaport:~/dosemu-1.2.2# make install ++
+ +
+First copy /etc/dosemu/dosemu.conf
into ~/etc/dosmeu
.
+Then edit ~/etc/dosemu/dosemu.conf
so that we have a version for
+mbse users. Set the following settings in that file:
+
+$_hdimage = "/opt/mbse/var/dosemu/c" +$_floppy_a = "" +$_xms = (1024) +$_ems = (2048) +$_dpmi = (0x1000) +$_layout = "us" ++Next we need to setup the C: drive. Do this as user mbse. First type
umask
+007
, this sets the create mode for directories to 0770 and files to 0660
+so that we create all files and directories read/write for all bbs users. This
+is very important! Type the following commands:
++mbse@seaport:~$ umask 007 +mbse@seaport:~$ cd var/dosemu/c +mbse@seaport:~/var/dosemu/c$ mkdir dos dosemu temp util ++To be continued.... +
+ +
+That's your choice, but for a while the old method starting dosemu via sudo is
+still supported. The file ~/bin/bbsdoor.sh
is still there, but the
+file ~/bin/rundoor.sh
is renamed to
+~/bin/runvirtual.sh
. So you should change all symlinks of your door
+names in ~/bin
(or copies) to ~/bin/runvirtual.sh
. You
+should not need to change anything else.
+
Go Back
diff --git a/script/rundoor.sh b/script/rundoor.sh
index cd0deadf..b8ed9663 100644
--- a/script/rundoor.sh
+++ b/script/rundoor.sh
@@ -2,23 +2,55 @@
#
# $Id$
#
-# rundoor.sh - Never call this script directly, create a symlink
-# to this file with the name of the door. For example
-# to run the door ilord do:
-# cd /opt/mbse/bin
-# ln -s rundoor.sh ilord
-# In the menu use the following line for Optional Data:
-# /opt/mbse/bin/ilord /N
+# Never call this script directly, create a symlink to this file with the
+# name of the door. For example to run the door ilord do:
+# cd /opt/mbse/bin
+# ln -s rundoor.sh ilord
#
-# This version DOES NOT have virtual COMport support, see runvirtual.sh
+# In the bbs menu use the following line for Opt. Data:
+# /opt/mbse/bin/ilord /N [novirtual]
+#
+# The optional "novirtual" second paramter disables the use of the virtual
+# comport in dosemu, this is for dos programs that are not doors.
+#
+# This is for dosemu 1.2.0 and later and runs the door as user.
#
# by Redy Rodriguez and Michiel Broek.
-#
+
DOOR=`basename $0`
COMMANDO="\"doors $DOOR $*\r\""
+DOSDRIVE=${MBSE_ROOT}/var/dosemu/c
-/opt/mbse/bin/bbsdoor.sh $DOOR $1
-/usr/bin/sudo /usr/bin/dosemu.bin -f /opt/mbse/etc/dosemu/dosemu.conf -I "`echo -e keystroke $COMMANDO`"
+# Prepare users home directory and node directory
+if [ "$1" != "" ]; then
+ mkdir -p $DOSDRIVE/doors/node$1 >/dev/null 2>&1
+ # Copy door*.sys to dos partition
+ cat ~/door.sys >$DOSDRIVE/doors/node$1/door.sys
+ cat ~/door32.sys >$DOSDRIVE/doors/node$1/door32.sys
+ # Create .dosemu directory for the user.
+ if [ ! -d $HOME/.dosemu ]; then
+ mkdir $HOME/.dosemu
+ fi
+ # Looks cheap, see above, but this does an upgrade too
+ if [ ! -d $HOME/.dosemu/drives ]; then
+ mkdir $HOME/.dosemu/drives
+ fi
+ # Create .dosemu/disclaimer in user home to avoid warning
+ if [ ! -f $HOME/.dosemu/disclaimer ]; then
+ touch $HOME/.dosemu/disclaimer
+ fi
+else
+ exit 1
+fi
+
+# run the dos emulator with the door.
+if [ "$2" == "novirtual" ]; then
+ /usr/bin/dosemu.bin -f ${MBSE_ROOT}/etc/dosemu/dosemu.conf -I "`echo -e keystroke $COMMANDO`"
+else
+ /usr/bin/dosemu.bin -f ${MBSE_ROOT}/etc/dosemu/dosemu.conf -I "`echo -e serial { com 1 virtual }"\n" keystroke $COMMANDO`"
+fi
+
+# reset the users terminal, just in case.
reset
tput reset
stty sane