Starting Up JNOS


What you need to know...

At some point, after you have configured and successfully compiled the JNOS source code into a binary, you are probably quite anxious or excited, or both, to see if this is all really going to work! Recall that you probably compiled this in a directory named jnos111f, or something close to that, and now you need to copy it over to the the runtime directory which I am assuming you called "jnos", located at the top of the directory tree. ( cp jnos /jnos/ )

The runtime binary will then be in the "right" location in order for it to find all the files and subdirectories, you had created earlier. The bare minimum files are the autoexec.nos and the domain.txt . You might also want an ftpusers, net.rc, and alias files. You must have sub-directories: finger, dump, logs, pub, spool, help. and maybe a tmp to complete the "set."

So all the "parts" have been assembled and you are ready to fire it up. You may use this command:

  • /jnos/jnos -C -d/jnos -g2
Or, you may alternatively use a shell script which I have included below. And, don't forget, you need to have configured the autoexec.nos file to suit your operating needs and populated the domain.txt file if you have decided to use that as part of your DNS (Domain Name Server).




My startnos shell script

Here is a sample start up script that is modeled after the startnos script for a DOS system. I added a few "tests" that I felt might be useful on Linux/UNIX system. You should check over this code carefully and edit out the parts that are not needed, or include functions that you feel are important. This code needs to be modified by you to ensure a good fit with your system and setup!

NOTE: I used an exec to start jnos since jnos will then inherit the pid from this script and will not "consume" any extra pids. Also, I store the pid just before I jump into the exec, so that pid will be the current jnos pid, as this script file vanishes into the "ether" ...

#! /bin/sh
# Startnos
# 06-24-00
# 08-03-00
# KA1FSB/kbn
# ------------------------------------------------------------------
# Script to start up Jnos
# NOTE: This may need to be in /jnos directory...
# ------------------------------------------------------------------
#

#----- Colors...
off="\033[m"
bld="\033[1m"

#----- Path...
THISPATH=`/bin/pwd`

#----- Data inits...
user=""
pid=""
rest=""
TEST=""

#----- User modifiable space...
SLEEPTIME=2
JNOS="/jnos/jnos"

PROGNM="startnos"

# --------------------------------------------------------------------------
# Functions calls
# --------------------------------------------------------------------------

do_pid_search () {

echo -e "<$PROGNM>: Searching for previous processes...\r"

/bin/ps aux | grep "$JNOS" | fgrep -v grep |  while read user pid rest
do
	if [ "$pid" != "" ] && [ "$pid" -gt "0" ]
	then
		echo -e "<$PROGNM>: Stopping JNOS process on pid "$bld$pid$off
		kill -STOP $pid 2>/dev/null
		echo -e "<$PROGNM>: Allow process to halt gracefully..."
		sleep $SLEEPTIME 
		kill -KILL $pid 2>/dev/null
		echo -e "<$PROGNM>: Terminating PID= "$bld$pid$off
		echo -e "<$PROGNM> : "$bld"Re-starting"$off" from a previous process..."
		break
	fi
done
return
}

# --------------------------------------------------------------------------
# Begin process...
# --------------------------------------------------------------------------

do_pid_search 

echo -e "<$PROGNM>: Removing stale locks if any...\r"

TEST=`ls -l /jnos/spool/mqueue | grep -i .lck | wc -l | tr -d " "`
if [ "$TEST" -gt "0" ]
then
	/bin/rm /jnos/spool/mqueue/*.lck 2>/dev/null
fi

echo -e "<$PROGNM>: $TEST lock files found, $TEST lock files removed...\r"

TEST=`/bin/pwd`
if [ "$TEST" != "/jnos" ]
then
	echo -e "<$PROGNM>: Moving to jnos "$bld"directory"$off"...\r"
	cd /jnos
fi

export MSGUSER=ka1fsb
echo -e "<$PROGNM>: Starting up "$bld"JNOS"$off" now...\r"
sleep 5

#----- Store current pid...
echo "$$" >$THISPATH/jnos.pid

#----- OK, launch Jnos... User could modify this line as needed...
exec $JNOS -C -d/jnos -g2

#----- End of startnos

      Mail Document Request for:   startnos
  A Few Caveats:

  • Be sure your local mailer is properly "hooked" into your browser.
  • Allow up to 24 hours for delivery, although 3-6 is typical...
  • Mailed copy, being the latest "on-line" version, may differ slightly from above.
  • Click on "Mail it to me" below to activate your mailer, then send from there.
  • Please don't change the subject field. (Additional text body comments OK.)
  • Sometimes server is down for extended periods of time... (1-10+ days)
  • (You obtain, modify and run all data/code at your own risk.)


Enough "excuses," just Mail it to me!

  What if ...

  • If your browser-linked mailer doesn't seem to respond, you may send a null-bodied email to ka1fsb@att.net with a subject of "Code Request - startnos" not including the quotes... (Some browsers and their mail agents do not like excessive string data in the mailto format.)



(Courtesy KBNorton Computer Services)