Welcome, Guest. Please login or register.
Did you miss your activation email?
September 26, 2017, 12:18:06 pm

Login with username, password and session length
Search:     Advanced search
Savage: XR is a new patch for Savage, created by the Newerth.com staff. The XR1.1 Client is out now! Download it now!
188539 Posts in 10878 Topics by 17916 Members
Latest Member: Defwish
* Home Forum Wiki Help Search Login Register
+  Newerth Forums
|-+  Archive
| |-+  Server Forum
| | |-+  INFO: How to set up Server in windows as a Service.
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: INFO: How to set up Server in windows as a Service.  (Read 6533 times)
Lothar
Newbie
*
Posts: 2


View Profile WWW
« on: October 16, 2008, 01:25:37 am »

First you need your server files runing properly... I cant help on this because my files just turned up and worked Tongue thanks to Jag.

First tools you need are

You can find more info on them at this ms KB http://support.microsoft.com/kb/137890

Download the tools at http://www.microsoft.com/downloads/details.aspx?FamilyID=9D467A69-57FF-4AE7-96EE-B18C4790CFFD&displaylang=en
For my purposes i installed it to the C:\Program Files\Resource Kit\ Directory. Now all these files i leave here and dont move around because if they get deleted your service(s) wont work.

To Create your service called whatever you like myne for instance is Savage. Run this in command prompt
Code:
C:\Program Files\Resource Kit\Instsrv.exe Savage C:\Program Files\Resource Kit\Srvany.exe

Now you have to open up regedit and go to the key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Savage

This is the files and configs we just created with the resource kit.

1.   From the Edit menu, click Add Key. Type the following and click OK:

Key Name: Parameters
Class : <leave blank>
2.   Select the Parameters key.
3.   From the Edit menu, click Add Value. Type the following and click OK:

Value Name: Application
Data Type : REG_SZ
String : <path to savage install>\run.bat


My run batch file is fancy because im about to log the file and whatnot for my purposes and ill post up how I do it later.
Run.bat

This is the batch file located in my savage server install. Make sure you change the directorys.

Code:
::This will make the window clear, remove all paths etc, just to keep the important stuff
@echo off
::Give a name to the window, nothing really important.
title Sav Guardain               AUS TEST XR
::Clear the window
cls
::Report to console what we are doing
echo ****To close this script, close this windows and then the Savage window****
echo.
echo.
echo Watching the GAME SAVAGE for crashes
::Insert a return point if it crashes
:savage
::This will make the window clear, remove all paths etc, just to keep the important stuff
@echo off
echo (%time%) Change dir so we can run the game server properly!
cd "C:\Documents and Settings\Jag\Desktop\ftp\Savage XR"
echo (%time%) Changed DIR with no problems, now run the update tool
echo (%date%)(%time%)        GAME Server is now online.
::Start the actual server
start /wait "C:\Documents and Settings\Jag\Desktop\ftp\Savage XR\" silverback.exe
echo (%date%)(%time%) GAME Server restarted. Now restarting...
goto savage

Now here is the fun part. Resrating the servers daily.
Go into Controll panel and open up sceduled tasks. Add one. I called it savage. Now the program to run is StopStart.bat
net stop Savage stops the run.bat file.
taskkill kills the silverback.exe
net start Savage runs it again.

StopStart.bat
Code:
net stop Savage
taskkill /F /IM silverback.exe
net start Savage

And there you have a savage server that works as a service that restarts itself daily.
« Last Edit: October 28, 2008, 11:11:28 pm by Django » Logged
darkbread
Newerth Council
Super Hero Member
*
Posts: 1276


a lump of bread, that is of a dark color...


View Profile
« Reply #1 on: October 16, 2008, 12:19:34 pm »

stickied it  Smiley
« Last Edit: October 16, 2008, 12:31:12 pm by darkbread » Logged

Django
Administrator
Legendary Member
*****
Posts: 2557



View Profile
« Reply #2 on: October 20, 2008, 01:00:41 pm »

Any chance we can use this in xr? Smiley
Logged
Trigardon
Forum Administrator
Legendary Member
****
Posts: 4785


Demonic Monster


View Profile WWW
« Reply #3 on: October 20, 2008, 01:14:32 pm »

I like this one. gj and keep up the good work!!!
Logged

Lothar
Newbie
*
Posts: 2


View Profile WWW
« Reply #4 on: October 24, 2008, 03:57:59 am »

Any chance we can use this in xr? Smiley

I have it working currently on the Aus XR server. And kept the server upto date for last two weeks. I am going to rewrite my bat files and change a few references when I fix some of my broken links on my server back end.
Logged
Django
Administrator
Legendary Member
*****
Posts: 2557



View Profile
« Reply #5 on: December 25, 2009, 04:32:07 am »

Don't use the autoupdater (savage.exe) if you plan to run as a service it won't work and will open endless servers. Use silverback.exe instead.
Logged
moonlighthp91
Newbie
*
Posts: 5


View Profile
« Reply #6 on: February 23, 2010, 04:22:04 pm »

I have it working currently on the Aus XR server. And kept the server upto date for last two weeks
Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.038 seconds with 19 queries.