logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Starting and stopping nwnx2 & nwnx4

 
Post new topic   Reply to topic    nwnx.org Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
Arvirago



Joined: 17 Nov 2006
Posts: 15

PostPosted: Thu May 08, 2008 12:58    Post subject: Starting and stopping nwnx2 & nwnx4 Reply with quote

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
View user's profile Send private message Visit poster's website
Skywing



Joined: 03 Jan 2008
Posts: 321

PostPosted: Thu May 08, 2008 18:45    Post subject: Reply with quote

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
View user's profile Send private message
Tempest



Joined: 26 Feb 2008
Posts: 32

PostPosted: Fri May 09, 2008 5:42    Post subject: Reply with quote

does that acutally shutdown the server clean and save all data prior?
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Arvirago



Joined: 17 Nov 2006
Posts: 15

PostPosted: Fri May 09, 2008 15:41    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Skywing



Joined: 03 Jan 2008
Posts: 321

PostPosted: Fri May 09, 2008 17:35    Post subject: Reply with quote

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
View user's profile Send private message
Tempest



Joined: 26 Feb 2008
Posts: 32

PostPosted: Fri May 09, 2008 20:15    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website Yahoo Messenger
Arvirago



Joined: 17 Nov 2006
Posts: 15

PostPosted: Sat May 10, 2008 21:36    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Skywing



Joined: 03 Jan 2008
Posts: 321

PostPosted: Sun May 11, 2008 7:23    Post subject: Reply with quote

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
View user's profile Send private message
Arvirago



Joined: 17 Nov 2006
Posts: 15

PostPosted: Mon May 12, 2008 20:17    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Tempest



Joined: 26 Feb 2008
Posts: 32

PostPosted: Wed May 14, 2008 5:08    Post subject: Reply with quote

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? Very Happy

Last edited by Tempest on Thu May 22, 2008 21:46; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Zunath



Joined: 06 Jul 2006
Posts: 183

PostPosted: Wed May 14, 2008 19:09    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> General Discussion All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group