Automatic Server Shutdown - Any Suggestions?

Rose

Silver Supporter
Veteran Member
34
2020
10
I'm hoping to find a way to automatically shutdown the worldserver process in a 'graceful' way that's equivalent to using CTRL-C in the worldserver's terminal window.

From what I know of Unix-like systems, having established the worldserver's process id, I could issue a shell command something like: 'kill -SIGINT <process-id>', but on a Windows machine, I'm struggling to find an equivalent.

Windows has a 'taskkill' command that I could use in a batch file, but from my experimentation, it seems more 'harsh' than using CTRL-C. In other words, 'taskkill' terminates the worldserver without giving it the chance to shutdown properly. (I've tested this by logging a character in, running a short distance away from my starting position, then using 'taskkill'. Then, after starting the worldserver back up again, my character is back where it was before I moved it, and this is different than trying the same experiment but using CTRL-C to close the worldserver.)

So, that's where I am. I want to be able to shut the worldserver down 'properly' without manually issuing a CTRL-C to its terminal window.

Does anyone have any suggestions?
 

ExO

Admin
5,088
2014
1,452
Have you tried .server restart instead of the .server shutdown command?

As long as you don't have an auto-restart tool, then .server restart will actually close the Worldserver too, even though the name may sound mis-leading.
 

Rose

Silver Supporter
Veteran Member
34
2020
10
Have you tried .server restart instead of the .server shutdown command?

As long as you don't have an auto-restart tool, then .server restart will actually close the Worldserver too, even though the name may sound mis-leading.

Thanks for the tip. I've just tried it and the 'server restart' command does indeed work the way I expected 'server shutdown' to, so that's handy to know!

Back to my original post, it would still be useful if anyone could suggest a mechanism to 'gracefully' shutdown the worldserver that could be included in a batch file or similar. Ultimately, I'd like to be able to shutdown the whole of the server (MySQL, authserver and worldserver) at a given time using a script of some kind (unless there's another way I haven't thought of).
 

bertzeigler

Verified Member
11
2020
0
You could try taskkill /f /im and the PID or .exe, save it in a .bat and tie it to windows scheduler

EDIT: Sorry I didn't read your post propely, upon ispection you know about taskkill. My bad. There is a command in the worldserver called 'saveall', perhaps it could be used in conunction with taskkill?
 

Rose

Silver Supporter
Veteran Member
34
2020
10
You could try taskkill /f /im and the PID or .exe, save it in a .bat and tie it to windows scheduler

EDIT: Sorry I didn't read your post propely, upon ispection you know about taskkill. My bad. There is a command in the worldserver called 'saveall', perhaps it could be used in conunction with taskkill?

Thanks for the tip on 'saveall'. However, if it were possible to issue worldserver commands in an automated/scheduled manner, then I could just issue a worldserver shutdown directly (and side-step the need for 'taskkill' and, therefore, 'saveall' as well). So... it's back to my original question: Is there any way to automate/schedule a worldserver command?
 

Aescleal

Gold Supporter
Veteran Member
126
2017
15
Is there no way to pass a command from script, into a window? What if the servers are running in console screens?
I’ll test drive this.
 
Top