Running Hlds.exe As A Service
BakaBaka
Members Join Date: 2003-08-13 Member: 19668Posts: 11

newbie server admin
This is my first time trying to run a dedicated server. Everything installed correctly. My question is, how do you guys run the server? If I log off, the server closes. I'm connecting to the server using remot desktop. If I close my session but stay logged in, the server runs fine. But I don't like leaving my account open like that. Is there a way to run the server as a service or daemon? I'm running it on Windows 2003 with NS 2.0 and hlds.exe v4.1.1.1d. Thanks. A Metal Slime draws near...
Comments
I suggest getting serverdoc. You can start the program in tsclient/tsweb (thats what I assume your using), then just disconnect (dont log off). This will keep it running even if it crashes (it will restart).
http://www.serverdoc.com/
If you need any specific help, let me know.
Chris0132: "Dunno I kinda want my own titanium pneumaytic stabilised doom cubicle. Kinda wish you could upgrade it though so it can stomp around on the hydraulics and shout anti-communist propaganda at the aliens."
Now - caveats: I have no idea if this will actually work with HLDS. It *will* create a service and you will be able to set startup type to auto and load the service. Depending on how HLDS is written and its exit code though, it may refuse to load properly, may hang, or may not want to run non-interactively. Only testing will tell.
Some extra notes - the service name is best entered as 8 characters long (and must not be reserved characters like *\&% and so on). The display name can be 256 characters and is what shows up in the service control manager. To uninstall a service, open regedit and delete:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\(your servicename here)
then reboot.
Let me know if you have questions or how this works for you guys. I may not be home tonight as we stamp out te remainder of Blaster.worm in 500 remote bank branches, but I'll try to pop my head back in here...
Chris0132: "Dunno I kinda want my own titanium pneumaytic stabilised doom cubicle. Kinda wish you could upgrade it though so it can stomp around on the hydraulics and shout anti-communist propaganda at the aliens."
Chris0132: "Dunno I kinda want my own titanium pneumaytic stabilised doom cubicle. Kinda wish you could upgrade it though so it can stomp around on the hydraulics and shout anti-communist propaganda at the aliens."
Halls Of Armageddon 3.0 B4
69.93.219.206:27015 Central Server
Oh well. I have no idea why they wouldn't make that work properly as a service, as all it does is operate basically like a crappy service. Thanks for giving it a try.
Hmmm... I wonder. Maybe I could write a wrapper for the hlds.exe that had proper service architecture. I'll take a look at this when I get home and have some time to look deeper.
Chris0132: "Dunno I kinda want my own titanium pneumaytic stabilised doom cubicle. Kinda wish you could upgrade it though so it can stomp around on the hydraulics and shout anti-communist propaganda at the aliens."
Halls Of Armageddon 3.0 B4
69.93.219.206:27015 Central Server
This means I can run a HLDS NS server on my mate's computer at college without him knowing about it. Hehe.
--Scythe--
"Show me an operation that is running smoothly and I'll show you someone who's covering up mistakes. Real boats rock." - Frank Herbert
I promise to look into this in the next day or two. Still in the office right now.
Chris0132: "Dunno I kinda want my own titanium pneumaytic stabilised doom cubicle. Kinda wish you could upgrade it though so it can stomp around on the hydraulics and shout anti-communist propaganda at the aliens."
just playin Mons
Halls Of Armageddon 3.0 B4
69.93.219.206:27015 Central Server
Chris0132: "Dunno I kinda want my own titanium pneumaytic stabilised doom cubicle. Kinda wish you could upgrade it though so it can stomp around on the hydraulics and shout anti-communist propaganda at the aliens."
/me wonders why theres no free apps like Firedaemon Pro...
Save this file to it's own directory. Then run the service installer to install it. Then open regedit, navigate to your new service:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\(your servicename here)
And on the key where it says 'Imagepath='(the executable path you had specified when you installed the service), add the following:
The path to your hlds.exe AND the parameters you want to include with your hlds.exe IN QUOTES (this is miportant, in the proof of concept version).
So an example would be: c:\sierra\half-life\hlds.exe "-game ns map ns_veil -maxplayers 16"
Close regedit, and try and start your new service. Tell me how it goes (I have no access to hlds here and can;t test this at all, but if you tell me about your errors I can probably figure it out. Or I may give you a debug version).
Chris0132: "Dunno I kinda want my own titanium pneumaytic stabilised doom cubicle. Kinda wish you could upgrade it though so it can stomp around on the hydraulics and shout anti-communist propaganda at the aliens."
Chris0132: "Dunno I kinda want my own titanium pneumaytic stabilised doom cubicle. Kinda wish you could upgrade it though so it can stomp around on the hydraulics and shout anti-communist propaganda at the aliens."
Halls Of Armageddon 3.0 B4
69.93.219.206:27015 Central Server
New service installer please.
Halls Of Armageddon 3.0 B4
69.93.219.206:27015 Central Server
Chris0132: "Dunno I kinda want my own titanium pneumaytic stabilised doom cubicle. Kinda wish you could upgrade it though so it can stomp around on the hydraulics and shout anti-communist propaganda at the aliens."
Halls Of Armageddon 3.0 B4
69.93.219.206:27015 Central Server
Chris0132: "Dunno I kinda want my own titanium pneumaytic stabilised doom cubicle. Kinda wish you could upgrade it though so it can stomp around on the hydraulics and shout anti-communist propaganda at the aliens."
C:\Sierra\Counter-Strike\hlds.exe "-game ns -map ns_caged -maxplayers 8"
and with the interact with desktop set the HLDS window opens up and I get a Fatal HLDS error
Fatal Error (shutting down) W_LoadWadFile: Couldn't Load gfx.wad
Its the same HLDS.exe that I use when I manually start the server. So I dont know why all of the sudden it can't find the gfx.wad. (I can still start it manually)
Don't let this drive you madd. It would be cool to have but I can live without it. I just offered to help since no one else was testing it.
Halls Of Armageddon 3.0 B4
69.93.219.206:27015 Central Server
Chris0132: "Dunno I kinda want my own titanium pneumaytic stabilised doom cubicle. Kinda wish you could upgrade it though so it can stomp around on the hydraulics and shout anti-communist propaganda at the aliens."
Chris0132: "Dunno I kinda want my own titanium pneumaytic stabilised doom cubicle. Kinda wish you could upgrade it though so it can stomp around on the hydraulics and shout anti-communist propaganda at the aliens."
Halls Of Armageddon 3.0 B4
69.93.219.206:27015 Central Server
Ok, let me think on this a bit. Has to be something we can do...
Chris0132: "Dunno I kinda want my own titanium pneumaytic stabilised doom cubicle. Kinda wish you could upgrade it though so it can stomp around on the hydraulics and shout anti-communist propaganda at the aliens."
Any luck?
--Scythe--
"Show me an operation that is running smoothly and I'll show you someone who's covering up mistakes. Real boats rock." - Frank Herbert
http://www3.telus.net/mean/mean/04_serverloader.html
* Automatically loads up your services on server start up and after unexpected restarts.
Gives your server unattended 24/7 uptime by automatically restarting your services after failure.
* Low profile installation, requires very little space and no registry settings.
* Consumes negligible amounts of memory and CPU time.
Simple command-line interface designed for server operators.
Now if only he had posted source I could see why HLDS seems to hate the wrapper environment of my little EXE. Oh well, someone try this out and tell us how it went.
Chris0132: "Dunno I kinda want my own titanium pneumaytic stabilised doom cubicle. Kinda wish you could upgrade it though so it can stomp around on the hydraulics and shout anti-communist propaganda at the aliens."