Setting up Mystic Under Linux (mainly Slackware)
Gossamer Axe (gossamer_axe@hotmail.com)
v0.01 31, October 2001

This HOWTO is for aspiring Linux Sysops looking at installing and
utilizing Mystic BBS Software (http://www.mysticbbs.com) to run
their bbs via telnet.

Please note:  I am not a Linux guru, nor am I an expert at running
a bbs...but there's a serious lack of Linux docs on setting up BBS's
and doors and such...So what I'm doing is pretty much telling you how
I setup Metal Edge and the things I've figured out while running it.

The first thing I recommend is to setup a computer that's dedicated
for a bbs.  I realize not everyone has the luxury of doing this, but
if you can, it will speed up the BBS because no one will be playing
Quake II while the bbs is going =] =]

Depending on the type of system you want to run, hard drive space might
be a necessity...I'm working with a 20gig, 27 gig and 6 gig that has 
Linux installed on it, so I have roughly 45 gigs of hd space for the
bbs.  It's really not that much considering a 20 gig hd is 80 bucks =]
I have a 20 gig drive mounted under /mystic/files for bbs files.

RAM:  The more the better, Metal Edge runs 256M and a K62-500 for the
processor.  It's a pretty lively machine, I can run 10 nodes for the
bbs and few complain about speed except if someone is downloading 
(bandwidth problem).

Connection:  Now, bbs's run well on dialup, but I'd only recommend
one public node for this...I've been on dialup telnet boards and...
well...they're slow, but what do you want for a 56k modem =]  If you
have broadband, your set, but if you have a 28.8-56k connect, please
don't run more than one node, people will bail when they have to watch
your ansis scroll line by line.

OS:  Well, if your reading this, you obviously are either thinking of
Installing Linux or already have.  If you're thinking about it, please
refer http://www.linux.org for more information than you'll ever need =]
I will eventually do a Linux setup HOWTO for Slackware and RedHat, but
this is mainly for people who can get around a little on linux already.


OK, Lets get started:


Uncompress the archive:  unzip filename.zip

As of this document, you need the full version of Mystic before you
install one of the upgrades (1.07.3 is the latest as of this doc).

run the install program, specify the directory where you want mystic
to reside...I recommend /mystic  you can setup a partition just for
mystic and mount it at /mystic...This way it'll keep your root
directory sane and not use up all your space =]

go to the mystic directory   cd /mystic
./mcfg  to load up the mystic configurator

System Directories:

Most of these should be stat...Except for the Archive path which should be
"/" (without the quotes) or the archivers won't work =]

System Path is where your mystic binaries reside, probably the bash scripts
that you write for your door games will be here also....

Data Path

This is where all your data for files, users, messages and that will go

Local QWK Path

I believe this defaults to /mystic which you should change to /mystic/qwk 
or something like that...


GENERAL SETTINGS

BBS Name and Sysop name should be self explanatory =]

Default Start Menu leave at prelogin 

fallback menu at main

For Now leave the default language Default

BBS List Editor: 
	If you want you users to modify (delete edit) your bbs list
	you can change this to s10 or s20,  if you want to be the only one to
	control it, leave it at s255

Invisible Logon:  
	Do you want your users logging in as invisible?  So no
	one can see them?  Set this to s20 if you do, otherwise the 
	Sysop(s) will be the only ones that can be invisible.

See Invisible ACS:  
	If you allow people to logon as invisible, who do you
	want to see them?  s255 would be sysops only can see invisible.

User Multiple Logon:  
	Do you want a user to be able to logon more than
	once at one time?  Best to keep this at no especially if you 
	have few nodes.

Terminal Mode:  
	Force Ansi:  Only people that have ansi telnet clients can access
	the bbs.
	Ask:  Will ask if they want ansi or not.
	Detect:  Mystic will detect if their client supports ANSI
	Detect/Ask:  Will try to detect, will fallback to ask if it can't.

F* Macro:
	You can set these if you use certain commands frequently.

System PW:
	If you want a private system, this will prompt the user for a 
	password everytime he/she logs onto the bbs.

Sysop PW:  
	Set this so when you need to modify something in the Sysop menu
	you'll need to enter a password...Change it, or someone will
	figure out you have the default pw =]

Chat Hours:
	Don't worry about this, they don't work in Linux Mystic =]

Max # of Nodes:
	If you have broadband, you can run 5-10 nodes under Cable modem
	or DSL.  I run 10 nodes, I've noticed that BBSs under Windows 
	really lag, but w/Linux they run smooth, even if there's other
	users logged on.  Test this and see what your pipe can handle.


The rest of the Mystic setup you should be able to get from the 
/mystic/mystic.doc	


Now you want to setup an account for bbs

first setup the group bbs
groupadd -g 200 bbs

the -g is the group id number set it to whatever you want to.

setup the user now

At the prompt type 
adduser
you'll be prompted with a series of questions, the name should be
bbs 
the group should be bbs
and the password hit enter

go back to /etc and edit passwd

bbs::1000:200:,,,:/mystic:/mystic/mystic

edit the bbs line to reflect the above with your setup

go to /etc and fire up your favorite edtior and edit inetd.conf
find the service telnet and go to the end of the line it should read:

telnet  stream  tcp     nowait  root    /usr/sbin/tcpd  in.telnetd

add -L /mystic/runbbs to the end so it looks like this

telnet  stream  tcp     nowait  root    /usr/sbin/tcpd  in.telnetd -L /mystic/runbbs

I have never gotten in.telnetsnoop to work properly so I just do this...It
will toss the user directly to the bbs without them having to type bbs
to load up the bbs.  If you want to add in.telnetsnoop refer to the 
/mystic/linux.install.doc  It will also tell you how to make a "backdoor"
telnet entry so you can telnet to your computer.  Handy if the bbs
gets a node locked up =]

Next load up services which is also in /etc you should find a line

telnet          23/tcp
telnet          23/udp

It's probably a good idea to keep your bbs at port 23 as non experienced
telnet users might get confused....But it's your choice as to what port
you want to put it on...

Next you'll need to restart inetd to activate the changes, you can either
issue the famous
killall -HUP inetd
which will restart your services or you can reboot (the ms way) =]
killing inetd is easier =]

go back to your mystic directory
fire up your editor and create runbbs

joe runbbs

#!/bin/sh
echo -e "\033(U"
login bbs TERM=linux
chown -R bbs.bbs /mystic

I always add the chown to the runbbs scripts so whenever someone logs
onto the bbs, it will auto set the directories to be owned by the bbs
save the runbbs script

type chmod o+x runbbs
to make it executable then type
chown -R bbs.bbs /mystic
to set your permissions...

Type ./runbbs and load up your bbs, logon as a new user then logoff, 
fire up mcfg and go to the user editor and edit yourself, you should be
the first user on the bbs...change your security level to 255 (full
sysop)


Log back on to your bbs, remember the Sysop password that you changed
from Sysop?  We're gonna use that now =]

goto the main menu and select /*   which takes you to the sysop menu.
select [A] for the archive menu, enter your sysop password...
Hit [E] for edit then 1 for zip

A. Name      : PkWare's ZIP
B. Extension : ZIP
C. Pack Cmd  : /usr/bin/zip -j9 %1 %2
D. Unpack Cmd: /usr/bin/unzip -CLojq %1 %2 -d %3
E. View Cmd  :

This is what mine looks like, I never had much luck with the scripts, but
this works like a charm...Remember when we changed the path of the 
archivers to /   this is so this works properly...And you don't need
to write a bash script for it either =]
Make sure you have both zip and unzip in /usr/bin it might be in /bin
if it is, just change it to /bin/zip and /bin/unzip
If you don't have it, just do a search on google for linux zip unzip
but if your running slackware, it should be in /usr/bin

I don't use lha, rar or arj compression on my bbs, so I haven't set them
up...but when I do get them setup, I'll add it to this file.

The next things you want to setup are the files and message bases.  This
is pretty easy to do, make sure you have enough space for your files tho..
I have 2 drives that I mount under /mystic/files which is 20 gigs to hold
my bbs files...When you go into the file base editor, ctrl+i will insert
a base before the base where the lightbar is on...ctrl+d will delete it
ctrl+e will edit is and ctrl+s will sort.  message areas are the same.


Door Games:

Ok, here's the fun part =]  You have the option of running just Linux
door games, of which there aren't but two of them =]  Or setting up
and installing DOSEMU.  Dosemu is a DOS emulator program that allows you
to run a emulated DOS, it looks like DOS, mostly acts like DOS, you can
run most door games under it...

Download the latest copy from ftp.dosemu.org
I'm running 1.0.1 it has the virtual modem already in there so you don't
need to patch it..

Grab a copy of LORD (Legend of the Red Dragon) and hang onto it...
uncompress the dosemu archive and READ THE DOCS...you'll have to setup
a dos filesystem somewhere =]

This is the way I did it for Metal Edge, it's a pain in the ass, but it
works great for me:

I had a 20 gig drive, I took out my first hd, and plugged the empty 20 gig
into the first drive slot, set it up in the BIOS and booted to a DOS 6.22
floppy and partitioned the first partion to a 2 gig partition and formatted
the "C" drive.  I rebooted and installed DOS 6.22 on to the 2 gig partition.
DOS takes about 20 megs so you'll have lots of room for doors =]
When it was done, I rehooked up the original primary master and plugged in
the drive with DOS in it to a free drive slot.  I then proceeded to boot
to Linux and format the rest of the drive in Linux for BBS files =]

When I installed DOSEMU I pointed the drive to my DOS partition....
/dev/hdb1	

in fstab, I mounted it to /dos

You can just use the freedos that's included with DOSEMU but the problem
is that you can't see your linux partitions as if they were DOS directories.
I wanted to have this functionality for the door games.

Ok, so you've gotten DOSEMU installed and it's working...Type 
dos
from the prompt to see if you can get into it.  You should eventually see:
C:>
your all set to go....
Your DOS partition that you made should come up as D:> switch to the d drive
and see if it works.  Now type exitemu to get out of emulated DOS...if it
works ok, your all set to go =]

This all can get really tricky, if a door game won't work at first, don't 
give up, there's many steps you have to take in Linux to get a door working.

If your in Linux copy your LORD zip file to /dos set it up however you want
to...I have a directory for LORD, so when I'm in dosemu it looks like
d:\lord
unzip the archive into a directory...fire up DOSemu and run the lordcfg.exe
program.

NOTE

If you're running older door games you'll need a program called tppatch.exe
which you can find by searching on the web or on Metal Edge or other BBSs.

end NOTE

In your /mystic directory you'll need a bash script to modify the 
DORINFO1.DEF or DOOR.SYS drop file to make it a DOS text rather than a 
Unix text...This is taken from Xabbu's BBS Door Games howto which is
the best resource for getting your Door games running in Linux...
Check out his bbs at clockworkorange.org 

#!/bin/bash

NODE=$1

todos < /mystic/temp$NODE/DORINFO1.DEF > /mystic/temp$NODE/DORINFO.DE1
mv /mystic/temp$NODE/DORINFO.DE1 /mystic/temp$NODE/DORINFO1.DEF
rm /mystic/doors/ld.bat

NODE=$1

echo -e "\r@echo off \r" >> /mystic/doors/ld.bat
echo -e "call d:\dos\lord\start.bat $NODE \r" >> /mystic/doors/ld.bat

dos -f /etc/dosemu.lrd


NODE=$1  <-- makes the NODE $1 when you add the command to the door menu
you'll pass the node number as %3

the todos just makes the drop file a DOS text rather than Unix.
echo -e lines add lines to a batch file which calls the door from
autoexec.lrd (we'll get to that in a sec).

dos -f calls dosemu using the proper dosemu config file for LORD.

save this file as lord.sh in /mystic
make it executable chmod o+x lord.sh
goto your /etc directory and you'll have a dosemu.conf
cp dosemu.conf dosemu.lrd
to copy the original conf file to the lord conf file.
edit dosemu.lrd and change this:



Now you'll want to make an autoexec.lrd on your c:\ drive
fire up dosemu and you'll be dumped into your c drive.  copy
the autoexec.bat to autoexec.lrd and it should look like this:





Now back into /mystic and run ./mcfg
goto the menu editor and edit doors menu
set the hot key and long key to whatever key you want to call lord.sh
all of my doors run dorinfo1.def so the Menu Command is DD
and this is the  Command Data:
/bin/sh /mystic/lord.sh %3
You can leave the access string blank.

One thing that I've found that everyone fails to mention =]  Is that when
you first run DOSEMU you have to agree to the licence by typing YES..
So I had to disable mystic, logon to the system as bbs and run dosemu
and type YES =]  then change inetd.conf back to -L /mystic/runbbs to have
the bbs back up.  The door ran fine after that... =]

since you can't change ownership of a dos drive, I set the permissions to
775    chmod -R 775 /dos    so the door games run...
Figure out what works best for you, it took me a few days of fiddling before
I got the hang of it =]  But w/out Xabbu's helpful text, I would have never
figured it out myself.

Here are a couple of my other door scripts.
For the Clans

#!/bin/bash

NODE=$1

todos < /mystic/temp$NODE/DORINFO1.DEF > /mystic/temp$NODE/DORINFO.DE1
mv /mystic/temp$NODE/DORINFO.DE1 /mystic/temp$NODE/DORINFO1.DEF
rm /mystic/doors/clans.bat

NODE=$1

echo -e "\r@echo off \r" >> /mystic/doors/clans.bat
echo -e "call d:\dos\\\\clans\\\\runclans.bat $NODE \r" >>
/mystic/doors/clans.

dos -f /etc/dosemu.clans

Note:  The reason for the \\\\clans and \\\\runclans is that for some
reason bash interprets \t as a tab =]  and \c and \r as something else..
so you need to add more \\'s to make bash understand that you're talking
about text, not tabs and carriage returns =]

Here's the script for weinerboy door game

#!/bin/bash

NODE=$1

todos < /mystic/temp$NODE/DORINFO1.DEF > /mystic/temp$NODE/DORINFO.DE1
mv /mystic/temp$NODE/DORINFO.DE1 /mystic/temp$NODE/DORINFO1.DEF
rm /mystic/doors/weiner.bat

NODE=$1

echo -e "\r@echo off \r" >> /mystic/doors/weiner.bat
echo -e "d:\ \r" >> /mystic/doors/weiner.bat
echo -e "cd \dos\weiner \r" >> /mystic/doors/weiner.bat
echo -e "weiner /d=d:\mystic\\\\temp$NODE\DORINFO1.DEF" >> /mystic/doors/weiner
dos -f /etc/dosemu.wei


Follow the above instructions for your dosemu.cla and wei and don't
forget the autoexec.cla and all that fun stuff =]


Locked Nodes:

Mystic under linux sometimes a user will get stuck and will
panic and drop carrier =]  Mystic for some reason leaves the node hang.
It's refered to as a "Ghost User".  You can kill the ghost user from the
node configuration in mcfg but if your at work (like i am) you cant get
to it until you either get home from work or wake up in the morning =]
I wrote this little script, it's not pretty but it works.

#!/bin/bash
/bin/ps -A | grep 'runbbs' > /mystic/runbbsps.txt
/bin/grep '?' /mystic/runbbsps.txt | /usr/bin/awk '{ print "kill" , $1 }' > /mystic/kill.sh
/bin/chmod o+x /mystic/kill.sh
/mystic/kill.sh
/bin/rm /mystic/kill.sh
/bin/rm /mystic/runbbsps.txt

save it as whatever.sh  name it whatever you want, put it in the /mystic
directory and chmod o+x whatever.sh

You will want to add this to your crontab, I have it run every 5 mins just
in case someone gets stuck =] (Refer to your Linux book or man page on
running cron)


One of the reasons you'll need this is there's a little daemon called
ksyslogd that likes to hog your cpu when it's running, it used to kill
my system =]  People thought the bbs died when it was just this thing
making logs of incoming and outgoing connections =]

do a 
ps -A
find the process that is running ksyslogd and kill it.
type 
nice -n -20 ksyslogd
it should bring ksyslogd back up but at the lowest priority...You may
or may not have this problem like I do, but if you do, this is the fix =]
If you want more info about nice type man nice


SYSTEM MAINTENANCE

All of your maintenance should be run from crontab...You might want to
do things like pack your user database, pack messages, sort files etc.,

There's a utility called mbbsutil which can be used like this

MBBSUTIL: Mystic BBS Utilities Version 1.07.3 (Linux)
Copyright (C) 1997-2001 By James Coyle.  All Rights Reserved.

Usage: MBBSUTIL.EXE  <Options>

The following command line options are available:

-BKILL  <ID> <Days> Delete BBSes which haven't been verified in <DAYS>
-BPACK              Pack all BBS lists
-BSORT  <ID> <Type> Sorts and packs BBS list by <type>
-FCHECK             Checks file entries for correct size and status
-FPACK              Pack file bases
-FSORT              Sort file base entries by filename
-UKILL  <Days>      Delete users who have not called in <DAYS>
-UPACK              Pack user database

As of 07/31/2001 it might screw up your file_id.diz descriptions on your
bbs =]  so be careful when running -FSORT

mystpack may not work...On Metaledge there's an updated one that Grymmjack
from Sector 7 sent me, it'll be in the next release of Mystic...

NETS:

I have not setup a message net under Linux, it can be done, but in this day
and age of the internet, I've always felt that message nets are overkill.
Back when most BBSs were dialup nets were a great way for users to talk to
people outside of their area code.  But anymore, we're on the internet 
already =]  There are a few good nets left like ZeroNet but Sector7 and
DreamLand both carry ZeroNet, if I put it on MetalEdge, I'd be reading it
3 times =]  You get my point =]

FidoNet has worn out it's welcome years ago, with archaic rules, the
same old message bases and unflexable moderators with attitudes that date
back into the 80s.  Fidonet is not recommended, especially if you want
to run a progressive type BBS.

Most of the more popular nets like CCI (Cybercrime International),
NirvanaNet, etc., have long died, If you get ambitious, my suggestion
would be to start a MysticNet or maybe a good underground net, something
that caters to the BBS Users of today.  Good luck with it. =] 

There are also some fine utilities that people have written, 
mbbshtml will make an html list of your files to put up on your web page,
and there's a linux binary too =]  download mystic stuff from either
http://www.mysticbbs.com/mystic
or
http://members.darktech.org/mystic  <--liquids mystic site

Warlock is a bbs modding/coding/art group that caters to Mystic BBS, you
can find our packs at http://www.sector7bbs.com/warlock
We gladly accept requests for art, modding and coding...Keep us busy ppl! =]
Actually, the Author of Mystic BBS g00r00, is a member of Warlock =]
Request a mod directly from him =]

This concludes my HOWTO, It's not the best written HOWTO, nor is it the end
to an end of all BBS HOWTOs =]  I sincerely hope this helps you out on your
quest for Linux and Mystic bbs peacefully running together =]

Thanks for reading! 

Gossamer Axe
Warlock/Metal Edge Sysop
metaledge.darktech.org