Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Tools

Development::Tools 3rd Party Tools for EQEMu (DB management tools, front ends, etc...)

Reply
 
Thread Tools Display Modes
  #1  
Old 12-31-2012, 05:31 PM
blindaviator
Sarnak
 
Join Date: Jul 2010
Posts: 61
Default Auto Restarts of Server

Don't know if this program is known here but I have this setup on my system and it works great.

FireDaemon Pro can setup any program (including command line starts) as a system service for automatic restarts. I have this setup on my server machine to restart any of the 5 services required for the server to run (so far my login server has crashed once and it restarted it within 1 minute and was back online). Program cost is $50 US but IMHO that is cheap for automatic restarts and no minimized command windows to accidentally close. You can download a 30 day trial of it and see if it is to your liking.

Also you can download their program FireDaemon Fusion which gives you a web based interface for access to running services. I give access to this for a trusted friend to restart the server remotely when updating the database. Best parts about this program is it is FREE and it does not require FireDaemon Pro to run.

Don't know if external links are allowed here but the programs are easy enough to find in a google search.
Reply With Quote
  #2  
Old 12-31-2012, 10:08 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

you could also put this in your EQEmu server directory and run it for free

runserver.vbs
Code:
set Shell = CreateObject("WScript.Shell")

' list of executables
procList = array("EQEmuLoginServer", "World", "EQLaunch", "UCS")

sub RunServer
    for each process in procList
        if not Running(process) then
            runStr = process & ".exe"
            if StrComp("EQLaunch", process, 1)=0 then
                runStr = runStr & " zone"
            end if
            'WScript.Echo "running " & runStr
            Shell.Run runStr, 0, false
        end if
    next
end sub

' is process running?
function Running(procName)
    found = false
    'WScript.Echo "checking " & procName
    for each proc in GetObject("Winmgmts:").ExecQuery("SELECT * FROM Win32_Process WHERE name='" & procName & ".exe'")
        if StrComp(proc.name, procName, 1) then
            found = true
            exit for
        end if
    next
    Running = found
end function

do until 0
    RunServer
    ' 30 second delay
    Wscript.Sleep 30000
loop
remove EQEmuLoginServer from the procList if you're not running your own login server and change value of sleep to change how long it takes between checks (in milliseconds).

you'll need to end the process named wscript.exe to stop the script as it won't have a command prompt.

i'd probably add some sort of logging method for restarts, but i got bored with it.
Reply With Quote
  #3  
Old 12-31-2012, 11:17 PM
wolfwalkereci
Discordant
 
Join Date: Dec 2005
Posts: 435
Default

Yeah I run a batch script and use winblows task scheduler to back that script up with another in case it fails.
Reply With Quote
  #4  
Old 01-01-2013, 12:15 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

i just can't help myself...

added functionality that makes certain you don't end up running multiple instances of the same script accidentally (very bad things would have happened).

runemu.vbs
Code:
set Shell = CreateObject("WScript.Shell")

' return process object collection where process name starts with procName
function ProcessObjectList(procName)
    queryStr = "SELECT * FROM Win32_Process WHERE name LIKE '" & procName & "%'"
    set ProcessObjectList = GetObject("Winmgmts:").ExecQuery(queryStr)
end function

' is process running?
function Running(procName)
    if ProcessObjectList(procName).Count < 1 then
        Running = false
    else
        Running = true
    end if
end function

' start processes if not already running 
sub RunServer
    for each procName in array("EQEmuLoginServer", "World", "EQLaunch", "UCS")
        if not Running(procName) then
            runStr = procName & ".exe"
            if StrComp("EQLaunch", procName, 1)=0 then
                runStr = runStr & " zone"
            end if
            Shell.Run runStr, 0, false
        end if
    next
end sub

' exit if this script is already running
set processList = ProcessObjectList("wscript")
if processList.Count > 1 then
    foundScript = 0
    for each process in processList
        if StrComp(process.name, "wscript.exe", 1)=0 then
            if InStr(process.CommandLine, WScript.ScriptName) then
                foundScript = foundScript+1
            end if
        end if
        if foundScript > 1 then
            WScript.Echo WScript.ScriptName & " is already running!"
            WScript.Quit
        end if
    next
end if
set processList = Nothing

' loop forever (30000 millisecond delay)
do while true
    RunServer
    Wscript.Sleep 30000
loop
this one terminates both the monitoring script and all running emulator executables

stopemu.vbs
Code:
set Shell = CreateObject("WScript.Shell")

' return process object collection where process name starts with procName
function ProcessObjectList(procName)
    queryStr = "SELECT * FROM Win32_Process WHERE name LIKE '" & procName & "%'"
    set ProcessObjectList = GetObject("Winmgmts:").ExecQuery(queryStr)
end function

' exit if this script is already running
set processList = ProcessObjectList("wscript")
if processList.Count > 1 then
    foundScript = 0
    for each proc in processList
        if StrComp(proc.name, "wscript.exe", 1)=0 then
            if InStr(proc.CommandLine, WScript.ScriptName) then
                foundScript = foundScript+1
            end if
        end if
        if foundScript > 1 then
            WScript.Echo WScript.ScriptName & " is already running!"
            WScript.Quit
        end if
    next
end if
set processList = Nothing

' terminate all instances of emulator monitoring script server processes
for each procName in array("WScript", "EQEmuLoginServer", "World", "EQLaunch", "UCS", "Zone")
    for each process in ProcessObjectList(procName)
        terminate = true
        if StrComp(process.name, "wscript.exe", 1)=0 then
            if InStr(process.CommandLine, "runemu.vbs") < 1 then
                terminate = false
            end if
        end if
        if terminate then
            process.Terminate
        end if
    next
next
Reply With Quote
  #5  
Old 01-01-2013, 12:20 AM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default

Quote:
Originally Posted by blindaviator View Post
Don't know if this program is known here but I have this setup on my system and it works great.

FireDaemon Pro can setup any program (including command line starts) as a system service for automatic restarts. I have this setup on my server machine to restart any of the 5 services required for the server to run (so far my login server has crashed once and it restarted it within 1 minute and was back online). Program cost is $50 US but IMHO that is cheap for automatic restarts and no minimized command windows to accidentally close. You can download a 30 day trial of it and see if it is to your liking.

Also you can download their program FireDaemon Fusion which gives you a web based interface for access to running services. I give access to this for a trusted friend to restart the server remotely when updating the database. Best parts about this program is it is FREE and it does not require FireDaemon Pro to run.

Don't know if external links are allowed here but the programs are easy enough to find in a google search.
Thanks for the informational post, Rogean was actually looking for something like this before he found one.
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 09:32 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