Author Topic: Loosing my marbles ...  (Read 496 times)

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Loosing my marbles ...
« on: December 15, 2011, 10:47:50 pm »


               1.)  I loaded 2 identical servers with Ubuntu 11.04 server.

2.)  apt-get update
       apt-get upgrade
       apt-get install empty-expect

3.) Installed game files /home/dan

One server using the ./nwservctl.sh start command starts no problem.  The other keeps giving me
           
Fatal open FIFO for reading: ./out.fifo: No such file or directory.

The only difference is one is huge with CEP .One is very small without CEP. 

They both run from command line ./nwserver -module "Your mod here"



#!/bin/bash
#nwservctl.sh

cd  /home/dan

#control command for nwn server, requires empty-expect

# **** BASIC CONFIGURATION ****

# Num of log directory to keep
LOG_HIST_NUM=9

# Seconds to wait for server loading
SECONDS_TO_WAIT=60

#Default Countdown in seconds
COUNTDOWN=60

# nwserver command: nwserver or nwnstartup.sh for NWNX2
#NWSERVER_COMMAND="nwnstartup.sh" #NWNX2
NWSERVER_COMMAND="nwserver -module Your mod here" #Basic nwserver
FIRST_EXIT_PHRASE="Stopping server in"
SECOND_EXIT_PHRASE="seconds please logout..."

# output passfrase to wait for module loaded
#PASS_PHRASE="0x08203e79" # NWNX2 init if you use nwnstartup.sh
PASS_PHRASE="Module loaded" # Basic nwserver

# **** END BASIC CONFIGURATION ****

# **** ADVANCED CONFIGURATION ******
# ONLY FOR EXPERTS 

# start server command
NWSERVER_START="empty -f -i ./in.fifo -o ./out.fifo ./$NWSERVER_COMMAND"

# wait for loaded command
WAIT_LOADED="empty -w -t $SECONDS_TO_WAIT -i ./out.fifo -o ./in.fifo $PASS_PHRASE" # FOR nwnstartup.sh

# return output from server command
# use a timeout until all commands are debugged
CATCH_OUTPUT="empty -r -t 30 -b 8192 -i ./out.fifo"

# first line argument
ARG1="$1"

# exit code
EXCODE=0

# *** CODE ***

#check if arguments exist
if [ "x$ARG1" = "x" ] || [ "x$ARG1" = "xusage" ] || [ "x$ARG1" = "x--help" ]; then
echo "Usage: `basename $0` start | restart [countdown [n]]" >&2
echo " `basename $0` stop [countdown [n]] | kill | status" >&2
echo " `basename $0` info [pid | pcpu | etime | pmem | vsz ] | --help" >&2
echo " `basename $0` <nwsever commands> if server is running" >&2
exit 1
fi

# check if nwserver is running exit if command is not 
if [ "$(pidof nwserver)" ] ; then
if [ "x$ARG1" = "xstart" ] ; then
echo "`basename $0` - nwserver already running..."
exit 1
else
: # do nothing continue
fi
else
if [ "x$ARG1" = "xstart" ] ; then
: # do nothing continue
else
echo "`basename $0` - nwserver is not running..."
exit 1
fi
fi

case $ARG1 in
start)
# rotate logs
[ -d ./logs ] || mkdir -p ./logs
if [ -d "./logs/logs.$LOG_HIST_NUM" ]; then
rm -f -r "./logs/logs.$LOG_HIST_NUM"
fi
for ((ddest=$LOG_HIST_NUM; ddest >= 2 ; ddest--)); do
let "dsourc = $ddest - 1"
if [ -d "./logs/logs.$dsourc" ]; then
mv -f "./logs/logs.$dsourc" "./logs/logs.$ddest"
fi
done

#move log.0 in log.1
mv -f ./logs.0 ./logs/logs.1
mkdir ./logs.0
#end rotate logs

shift
NWSERVER_START="$NWSERVER_START $*"
$NWSERVER_START
echo "Starting nwserver please wait.."
sleep 5
$WAIT_LOADED

if [ "$(pidof nwserver)" ]
then
echo "nwserver is running now"
else
echo "nwserver loading failed.."
EXCODE=1
fi
;;
stop|restart)
if [ "x$2" = "xcountdown" ]; then
if [ "$3" -gt 0 ]; then
COUNTDOWN="$3"
fi
while [ "$COUNTDOWN" -gt 0 ]; do
$0 "say $FIRST_EXIT_PHRASE $COUNTDOWN $SECOND_EXIT_PHRASE"
let "COUNTDOWN -= 10"
sleep 10
done
fi
echo "exit" | empty -s -o ./in.fifo
$CATCH_OUTPUT
if [ "x$1" = "xrestart" ]; then
echo "restarting in 10 seconds please wait..."
sleep 10
$0 "start"
fi
;;
info)
case "$2" in
pcpu|etime|pmem|vsz)
ps -p "$(pidof nwserver)" -o "$2="
;;
pid)
echo "$(pidof nwserver)"
;;
*)
ps -p "$(pidof nwserver)" -o pid,comm,etime,pmem,vsz,pcpu
;;
esac
;;
kill)
empty -k "$(pidof nwserver)"
;;
# with return output
status|help|listbans)
echo "$ARG1" | empty -s -o ./in.fifo
$CATCH_OUTPUT
;;
# no return output
playerpassword|dmpassword|adminpassword|oneparty|ilr|elc|difficulty|servername|autosaveinterval|pauseandplay|minlevel|maxlevel|maxclients|export|kick)
echo "$*" | empty -s -o ./in.fifo
#no output to catch
;;
#all other commands default send to nwserver
*)
echo "$*" | empty -s -o ./in.fifo
$CATCH_OUTPUT
;;
esac

exit $EXCODE


Any ideas on what to check for? 
               
               

               
            

Legacy_Lord Sullivan

  • Hero Member
  • *****
  • Posts: 671
  • Karma: +0/-0
Loosing my marbles ...
« Reply #1 on: December 15, 2011, 11:00:51 pm »


               So basically, 1 Ubuntu machine with 1 /home/dan/nwn/ directory and you're starting the NWServer twice?
               
               

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Loosing my marbles ...
« Reply #2 on: December 16, 2011, 02:42:27 am »


               Oh sorry let me clarify.I have 2 seperate servers both with Ubuntu installed.They are on different machines.They are I identical,thats why I cant figure out what is causing the problem.I have been looking at it to long ,I thought if anyone had some suggestions for me to trouble shoot it.
               
               

               


                     Modifié par Knight_Shield, 16 décembre 2011 - 02:42 .
                     
                  


            

Legacy_Skildron

  • Sr. Member
  • ****
  • Posts: 421
  • Karma: +0/-0
Loosing my marbles ...
« Reply #3 on: December 16, 2011, 08:30:20 am »


               Missing rights for file creation (i.e. write access to the directory) or mounted the partition read-only so that empty cannot create the fifo file?

Greetings
Skildron