View previous topic :: View next topic |
Author |
Message |
Arvirago
Joined: 17 Nov 2006 Posts: 15
|
Posted: Thu May 08, 2008 12:58 Post subject: Starting and stopping nwnx2 & nwnx4 |
|
|
Sorry if this has been explained already. I have a server (Win2k) running nwnx2 (for my nwn PW) and nwnx4 (for my nwn2 PW).
I need to shutdown both servers at a given time (say 6 am) and start them at another time (say 4 pm), so I'm making a cmd file for stopping everything (Apache, MySQL, etc) and another cmd file for starting everything.
How can I tell NWNX2 & NWNX4 to shutdown the server and then shutdown themselves in a clean way? |
|
Back to top |
|
|
Skywing
Joined: 03 Jan 2008 Posts: 321
|
Posted: Thu May 08, 2008 18:45 Post subject: |
|
|
Run it as a service and use "net stop nwnx4-1" (or whatever service name you use). Likewise, for "net start nwnx4-1" (using appropriate service name) to start the server.
Last edited by Skywing on Fri May 09, 2008 7:07; edited 1 time in total |
|
Back to top |
|
|
Tempest
Joined: 26 Feb 2008 Posts: 32
|
Posted: Fri May 09, 2008 5:42 Post subject: |
|
|
does that acutally shutdown the server clean and save all data prior? |
|
Back to top |
|
|
Arvirago
Joined: 17 Nov 2006 Posts: 15
|
Posted: Fri May 09, 2008 15:41 Post subject: |
|
|
Hopefully nwnx, upon receiving a kill signal, would first stop the nwn server and then close itself.
Maybe Papillon can clear this point. |
|
Back to top |
|
|
Skywing
Joined: 03 Jan 2008 Posts: 321
|
Posted: Fri May 09, 2008 17:35 Post subject: |
|
|
No, this kills the process. I could add something to my fork that does a clean shutdown if it's really all that in demand, I suppose. (Driving the server gui to hit the "Shutdown" button). |
|
Back to top |
|
|
Tempest
Joined: 26 Feb 2008 Posts: 32
|
Posted: Fri May 09, 2008 20:15 Post subject: |
|
|
I know I have been waiting for a long time for a script that would do a clean shutdown of all my instances before just killing the process. Think you can help us?
Thanks! |
|
Back to top |
|
|
Arvirago
Joined: 17 Nov 2006 Posts: 15
|
Posted: Sat May 10, 2008 21:36 Post subject: |
|
|
I guess all admins who have to shut down their servers at a certain time like me (because the host is used for a different thing, or they have to run certain processes, or any other reason) would find it useful.
The other solution would be to close nwnx4 and then find a way to close nwn2 inmediately (as all BD access would fail I guess) but it seems more complicated.
And if someone knows how to send a shout to the nwn2 server from a command line before shutting it down that would be too perfect! |
|
Back to top |
|
|
Skywing
Joined: 03 Jan 2008 Posts: 321
|
Posted: Sun May 11, 2008 7:23 Post subject: |
|
|
Hrm, well, there's a lil utility I wrote a few weeks ago to drive the nwn2server GUI to do things like ban/boot players and broadcast server messages.
I was planning on holding off on releasing it, as you need to run it from the same TS session as the service for various technical reasons (which also excludes Srv08/Vista for a couple of reasons, though there's another workaround which can be applied there). I.e. if you're running in service mode, you need to RDP in with /console (or /admin for the RDP 6.1 client), and you're a bit out of luck on Windows 2000 without some hackery (such as at.exe), if NWN2 even works on Windows 2000.
You can also use the program if you are running NWNX4 using the GUI instead of the service controller, but this was primarily written to address the service mode case (specifically for Srv03 when you RDP in with /admin or /console).
Readme for the program (describes how to use it, so you'll actually need to read it) : http://www.nynaeve.net/Skywing/nwn2/nwn2srvutil.txt
Binaries: http://http://www.nynaeve.net/Skywing/nwn2/nwn2srvutil.zip
Source: http://www.nynaeve.net/Skywing/nwn2/nwn2srvutil_dist.zip
As far as shutting down the server cleanly, stopping the NWNX4 controller process will not sever the DB connection. I've been having other things taking up time, but I'll see if I can spare some cycles to putting some code in the controller to do the moral equivalent of trying to bonk the "Shutdown" button in the server GUI and waiting a bit before hard killing the process, instead of always killing it without recourse as it does right now. |
|
Back to top |
|
|
Arvirago
Joined: 17 Nov 2006 Posts: 15
|
Posted: Mon May 12, 2008 20:17 Post subject: |
|
|
Thanks a lot. I will read the whole thing and tell you if I could do something with it.
I'm running Windows 2000 because of an issue with terminal server client licenses, and 32bits version because of the madCHook.dll issue.
NWNServer and NWN2Server seem to run just fine, I just needed to put the dbghelp.dll in the nwn2 folder. |
|
Back to top |
|
|
Tempest
Joined: 26 Feb 2008 Posts: 32
|
Posted: Wed May 14, 2008 5:08 Post subject: |
|
|
my host is dedicated I just want to be able to shutdown my three instances at set times during the day to clear any memory issues. Im shocked that no one else out there has the same needs?
Last edited by Tempest on Thu May 22, 2008 21:46; edited 1 time in total |
|
Back to top |
|
|
Zunath
Joined: 06 Jul 2006 Posts: 183
|
Posted: Wed May 14, 2008 19:09 Post subject: |
|
|
I only have one server going but this would help me a lot too. Shutting down the server at times when no one is one would be a godsend. |
|
Back to top |
|
|
|