Jump to content

Stopping a server using CTRL+C


Rislem

Recommended Posts

Hi Everyone

 

I currently trying to make setup files for a game (Conan) but it needs you to press CTRL+C on the console it opens to close the game successfully.

 

Does anyone know how I can setup my template so it does that instead of ending the process? Ending the process isnt so good for the current state of the game.

Link to comment
Share on other sites

With Windows you can check the "Interact with Desktop" option in service settings. This will allow the CTRL+C to be sent to the console.

 

This method does not work on Linux.

 

However, please see the following link for pause, wait and sleep commands. This may be needed so the server can shutdown properly. I have NOT tried this method.

http://www.wikihow.com/Delay-a-Batch-File

Edited by ECF
Link to comment
Share on other sites

With Windows you can check the "Interact with Desktop" option in service settings. This will allow the CTRL+C to be sent to the console.

 

This method does not work on Linux.

 

However, please see the following link for pause, wait and sleep commands. This may be needed so the server can shutdown properly. I have NOT tried this method.

http://www.wikihow.com/Delay-a-Batch-File

 

I really appreciate your help, just a quick question I have done and ticked that option, I generally have it on, but now where do I go and tell it to send a ctrl+c command? Do I write a custom script, problem with custom script is it will attempt to type in the console box which you cant unless I am wrong.

 

There is a tab for console text do I just type in CTRL+C in that box ?

 

PS running windows

Console.png.00e214987dceef74f04ccd7cb13fe8cb.png

Edited by Rislem
Link to comment
Share on other sites

Hi ECF

 

thank you very much again for your effort, I am also speaking to Luis about this I am hoping we can find a alternative, its not a train smash if it kills the process but the shutdown procedures removes all un wanted items and stuff so its best if we can find a alternative solution

Link to comment
Share on other sites

Hello!

 

After a lot of testing (and I mean *a lot*), I can confirm that the Script.WriteToConsole("^C") does not work on Windows and Conan Exiles.

 

From the Steam community, I see many server "managers" use AutoHotKey to find a named process and use AHK to send CTRL-C to the server window. I, personally, don't see this as a very viable method when you're hosting multiple servers on the same box.

 

I've also looked at Python's documentation, and in 2.7 there's something called os.kill() which is supported on Windows, where it uses the application PID and a signal called "signal.CTRL_C_EVENT". But I haven't gotten this to quite work either -- I'm only being tossed errors back, but I do believe I'm on the right track to get something to work here.

 

Anyone else looked at this?

Link to comment
Share on other sites

Hello!

 

After a lot of testing (and I mean *a lot*), I can confirm that the Script.WriteToConsole("^C") does not work on Windows and Conan Exiles.

 

From the Steam community, I see many server "managers" use AutoHotKey to find a named process and use AHK to send CTRL-C to the server window. I, personally, don't see this as a very viable method when you're hosting multiple servers on the same box.

 

I've also looked at Python's documentation, and in 2.7 there's something called os.kill() which is supported on Windows, where it uses the application PID and a signal called "signal.CTRL_C_EVENT". But I haven't gotten this to quite work either -- I'm only being tossed errors back, but I do believe I'm on the right track to get something to work here.

 

Anyone else looked at this?

 

Let me know how that works out, right now I am working on using a batch file to try and get it shutdown safely.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Who's Online   0 Members, 0 Anonymous, 147 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use