[Archive] Automatic Server Shutdown - Any Suggestions?
[Archive] Automatic Server Shutdown - Any Suggestions?
Archived author: Rose • Posted: 2025-11-04T18:12:54.335421
Original source
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?
Archived author: Rose • Posted: 2025-11-04T18:12:54.335421
Original source
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.
Quote:ExO said: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!
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.
Click to expand...
Archived author: Rose • Posted: 2025-11-04T18:12:54.335421
Original source
Quote:ExO said: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!
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.
Click to expand...
Archived author: Rose • Posted: 2025-11-04T18:12:54.335421
Original source
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?
Quote:bertzeigler said: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?
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?
Click to expand...
Archived author: Rose • Posted: 2025-11-04T18:12:54.335421
Original source
Quote:bertzeigler said: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?
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?
Click to expand...
Archived author: Rose • Posted: 2025-11-04T18:12:54.335421
Original source
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.