[SOLVED] How to stop and shutdown pyplaneet and server ?

Python 3 Server Controller for Trackmania and Shootmania for script-only modes.

Moderators: TheM, toffe, NADEO

Locked
User avatar
BestNoob
Posts: 223
Joined: 08 Mar 2013, 12:04
Contact:

[SOLVED] How to stop and shutdown pyplaneet and server ?

Post by BestNoob »

python manage.py start
python manage.py stop doesnt work

also ingame /stop /shutdown /admin shutdown etc. not working .....
To join my TM Servers, search for: bestnoob :thumbsup:
User avatar
toffe
Posts: 782
Joined: 15 Jun 2013, 10:57
Location: The Netherlands
Contact:

Re: How to stop and shutdown pyplaneet and server ?

Post by toffe »

You have to stop the script by killing or sending the sigint signal. For example you can Ctrl+C the start process, or if you start it in the background kill the main PID (but don't kill the subprocesses).
User avatar
Harest
Posts: 144
Joined: 26 Mar 2018, 04:21
Contact:

Re: How to stop and shutdown pyplaneet and server ?

Post by Harest »

toffe wrote: 15 Nov 2019, 10:28... if you start it in the background kill the main PID (but don't kill the subprocesses).
Any reason why you wouldn't want to do that?
User avatar
toffe
Posts: 782
Joined: 15 Jun 2013, 10:57
Location: The Netherlands
Contact:

Re: How to stop and shutdown pyplaneet and server ?

Post by toffe »

If you kill the subprocess the god might restart the child, and thus won't stop the main god process. If you send a SIGINT to the god process it will carefully try to shut down the child processes.
User avatar
Harest
Posts: 144
Joined: 26 Mar 2018, 04:21
Contact:

Re: How to stop and shutdown pyplaneet and server ?

Post by Harest »

Oh okay. So i could reuse the pyplanet.pid of each server but instead of the -9 signal i should use -2 for the kill command. As of now what's done is for instance:

Code: Select all

for pid in $(ps -fu "$TM_USER" | grep -e "python" -e "rpg${SRV_SUFFIX}_" | awk '{print $2}'); do kill -9 $pid; done > /dev/null
What it would become would be something like:

Code: Select all

kill -2 $(cat $TM_DIR/rpg${SRV_SUFFIX}_server/pyplanet.pid) > /dev/null
Edit @Toffe (Below): Ahah okay. Well if i've some time i'll give it a try and report back, thanks anyway ;).
Last edited by Harest on 15 Nov 2019, 18:59, edited 3 times in total.
User avatar
toffe
Posts: 782
Joined: 15 Jun 2013, 10:57
Location: The Netherlands
Contact:

Re: How to stop and shutdown pyplaneet and server ?

Post by toffe »

Could you try that, it should work, but however, due to some annoying changes it could be that it doesn't work anymore.
Locked

Return to “PyPlanet”

Who is online

Users browsing this forum: No registered users and 1 guest