Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Linux Servers

Support::Linux Servers Support forum for Linux EQEMu users.

Reply
 
Thread Tools Display Modes
  #1  
Old 10-05-2006, 05:44 AM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default Minilogin, Ports, Shorewall Info

In order to figure all this out, I've had to return to my old school of "Hard knocks and Falls"
And here's a summary of stuff i did/learned so you can skip this "course" ;
How to run Minilogin with no Xwindows and the emu - this was simple; first run your start-up, then while you're starting up the emu (have minilogin executable in the same directory your startup files are), in the same shell, type "wine minilogin". don't matter if the other is starting and you see text rolling, just keep typing and press "enter" when you're done. it will all settle down, and Minilogin will eventually take over the shell, and that's why you run it last.
I think I'll try a script, with a delay in it, and finally ends with the minilogin startup.
Shorewall (Firewall) will keep you from accessing your Miniloging via Lan, as it keeps the ports shut down to any type of access. I've come up with these ports;

3306/udp 5999/udp 9000/udp 7000:7010/udp 3306/tcp 5999/tcp 7000:7010/tcp

All works fine now - hope this helps someone else.
Reply With Quote
  #2  
Old 10-05-2006, 07:31 AM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

In your startup script, you can add the lines;

sleep 40
wine minilogin

at the end of the script;
Code:
#!/bin/sh

P=`pwd` 
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$P"
#make sure we have a place to log
mkdir -p logs 2>&1 > /dev/null 

#boot up world
if [ ! -e .lock-world ] ; then 
	    touch .lock-world 
	    ./world & 
	    # wait for shared memory to load
	    sleep 15 
fi 

#start up the official launcher
if [ ! -e .lock-launcher ]; then
	    touch .lock-launcher
	    ./eqlaunch zones &
	    sleep 40
	    wine MiniLogin.exe
fi
This will run anywhere - at least on my Mandriva distro, anyways
Reply With Quote
  #3  
Old 10-05-2006, 10:59 AM
eq4me
Hill Giant
 
Join Date: Jul 2006
Posts: 166
Default

You can detach it from the shell.

try

Code:
wine MiniLogin.exe > /tmp/Minilogin.log &
Minilogin is now working in the background and its output will be written into /tmp/Minilogin.log. I'll write an propper init script as soon as I have time.

You could also use the command nohup

Code:
nohup wine MiniLogin.exe
downside is that the output is always going to nohup.out.

You can find more about shell programming here:
http://www.freeos.com/guides/lsst/index.html

Last edited by eq4me; 10-05-2006 at 07:17 PM..
Reply With Quote
  #4  
Old 10-05-2006, 02:12 PM
John Adams
Demi-God
 
Join Date: Jul 2006
Posts: 1,552
Default

First, a disclaimer... I have no idea about Linux, this is my first attempt to write a bash script in 10 years... so forgive me if it's a) not formatted properly, b) fails on your system, or c) can be improved.

My goal was to make one script for start, stop, status, and restarting Emu. I think I have everything working except that last MiniLogin.exe thing. I've tried eq4me's last suggestion, but I am getting a "Failed to open port 5999". If I run wine MiniLogin.exe by itself, I usually get it to work (though, connecting a client *still* isn't quite working hehe...)

Ok, this post is just about the script. So, take this, tweak,and hope it comes in handy. It's a little "heavy", but adds some checks and balances.

Code:
#! /bin/bash
# Original Script Author: ???
# Editor: John Adams - 10/2006
#
case "$1" in
  start)

    if [ -e .lock-world ] || [ -e .lock-launcher ] || [ -e .lock-minilogin ]
    then
      echo "The emulator appears to already be running ?";
      echo "If you are sure the server is not running, delete .lock-world and .lock-launcher."
      exit 1
    else
      if [ "$UID" = "0" ]
      then
        echo WARNING ! For security reasons we advise: DO NOT RUN THE SERVER AS ROOT
        exit 1
      fi
      echo "Attempting to start the World..."
      if [ -e world ]
      then
        if [ ! -x world ]
        then
          echo "world is not executable, trying to set it"
          chmod u+x world
        fi
        if [ -x world ]
        then
          ulimit -c 99999999
          rm -f .world_shutdown
          set -x
          LNAME="peq" #launcher name
          if [ "$1" = "test" ]
          then
            LNAME="test"
          fi
          P=`pwd`
          export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$P"
          mkdir -p logs 2>&1 > /dev/null
          if [ ! -e .lock-zones -a ! -e .lock-world ]
          then
            for f in logs/eqemu_*.log
              do
                if [ "$f" = "logs/eqemu_commands_zone.log" ]
                then
                  continue;
                fi
              rm -f $f
            done
          fi
          if [ ! -e .lock-world ]
          then
            touch .lock-world
            ./persist_world 2>&1 > logs/world &
            sleep 15
          fi
        else
          echo "World is still not executable. Fix this!"
          exit 4
        fi
      else
        echo "Couldnt find world"
	exit 5
      fi

      # Launcher
      echo "Attempting to start Launcher/Zones..."
      if [ -e eqlaunch ]
      then
        if [ ! -x eqlaunch ]
        then
          echo "Launcher is not executable, trying to set it..."
          chmod u+x eqlaunch
        fi
        if [ -x eqlaunch ]
        then
          rm -f .zone_shutdown
          LNAME="zones"                   #launcher name
          if [ ! -e .lock-launcher ]
          then
            touch .lock-launcher
            ./eqlaunch $LNAME 2>&1 > logs/launcher &
            sleep 40                      #wait on launchers to start minilogin
          fi
        else
          echo "World is still not executable. Fix this!"
          exit 4
        fi
      else
        echo "Couldnt find eqlaunch"
	exit 5
      fi

      # If MiniLogin.exe exists, launch it last (Angelox)
      echo "Attempting to start MiniLogin.exe . . ."
      if [ -e MiniLogin.exe ]
      then
        if [ ! -x MiniLogin.exe ]
        then
          echo "MiniLogin.exe is not executable, trying to set it..."
          chmod u+x MiniLogin.exe
        fi
        if [ -x MiniLogin.exe ]
        then
          rm -f .minilogin_shutdown
          if [ ! -e .lock-minilogin ]
          then
            touch .lock-minilogin
            wine MiniLogin.exe > /tmp/Minilogin.log &
          fi
        else
          echo "World is still not executable. Fix this!"
          exit 4
        fi
      else
        echo "Couldnt find eqlaunch"
	exit 5
      fi

    fi
  ;;
  
  stop)

    echo "Attempting to stop the World..."
    touch .minilogin_shutdown
    touch .zone_shutdown
    touch .world_shutdown
    killall world eqlaunch zone wineserver MiniLogin.exe
    sleep 3

    if ps ax|grep -e 'w[o]rld' -e 'z[o]ne' -e 'eq[l]aunch' >/dev/null
    then
      killall -9 world eqlaunch zone wineserver MiniLogin.exe
      sleep 2
    fi

    ./cleanipc
    rm -f .lock-zones .lock-world .lock-login .lock-launcher .lock-minilogin

  ;;

  status)

    if [ -e world.pid ]; then
      echo "the server seems to be running"
      exit 0
    else
      echo "the server seems to be stopped"
	exit 3
    fi
  ;;
  
  restart)

    echo "restart all eqemulator services - not implemented yet"
  ;;

  *)
    echo "Usage: $0 {start|stop|restart|status}"
    exit 2
esac
exit 0
Drop this in your server dir, and run it as ./emu start|stop|status (one of those three options)

Not sure how to do the restart option. Anyone?
Reply With Quote
  #5  
Old 10-06-2006, 03:49 AM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

Some of my zones are not loading fast enough, which results in client crash when booting up the dynamic zones.
An error example;
Code:
Zone bootup timer expired, bootup failed or too slow.
When zoning, usually what happens is, the new zone auto-boots and thinks it has the player in the zone. But in reality, the client is crashed for the server taking too long to boot up.
I'm thinking the reason for this is because my machine is too slow on loading all the new data I have added to the given zone (i'm runing a PIII with 1.5gig ram).
This started when I did some changes to loots, and have just about every mob in the game droping something: on big zones like the LoY zones, changes like this are massive and I imagine require extra loading time.

anyways here's a new start up I devised which adds static boot up too the slow loaders;

Code:
#!/bin/sh

wine MiniLogin.exe > logs/MiniLogin.log &
P=`pwd` 
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$P"
#make sure we have a place to log
mkdir -p logs 2>&1 > /dev/null 

#boot up world
if [ ! -e .lock-world ] ; then 
	    touch .lock-world 
	    ./world & 
	    # wait for shared memory to load
	    sleep 20 
fi 
#start up the official launcher
if [ ! -e .lock-launcher ]; then
	    touch .lock-launcher
	    ./eqlaunch zones &
	    sleep 80
fi
	    ./zone gunthak 7006 &
	    sleep 5
	    ./zone dulak 7007 &
	    sleep 5
	    ./zone torgiran 7008 &
	    sleep 5
	    ./zone nadox 7009 &
	    sleep 5
	    ./zone nurga 7010 &
I know it's crude compared to what you guys posted - so you "pretty" it up

And here's a working stop (I kept having port problems with mini-login and the wine-server);

Code:
#!/bin/sh 

killall wine MiniLogin.exe world eqlaunch zone wineserver wine-preloader
sleep 3

if ps ax|grep -e 'w[o]rld' -e 'z[o]ne' -e 'eq[l]aunch' >/dev/null; then
	            killall -9 world eqlaunch zone
	            sleep 2
fi

./cleanipc 
rm -f .lock-zones .lock-world .lock-login .lock-launcher

Last edited by Angelox; 10-06-2006 at 11:54 AM..
Reply With Quote
  #6  
Old 10-06-2006, 08:20 AM
John Adams
Demi-God
 
Join Date: Jul 2006
Posts: 1,552
Default

FYI Angelox, my Core 4 machine is currently P4 1.5GHz, 512m RAM, and a 40GB Quantum Fireball (I think that's 7200 rpm). I haven't had a zone load problem yet, but I am also not running any x-windows at all. Not sure how this stacks up against your machine.

But of course, now I have a new excuse to visit newegg.com, don't I?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 05:30 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3