Page 1 of 1

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

Posted: 14 Nov 2019, 21:03
by BestNoob
python manage.py start
python manage.py stop doesnt work

also ingame /stop /shutdown /admin shutdown etc. not working .....

Re: How to stop and shutdown pyplaneet and server ?

Posted: 15 Nov 2019, 10:28
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).

Re: How to stop and shutdown pyplaneet and server ?

Posted: 15 Nov 2019, 15:15
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?

Re: How to stop and shutdown pyplaneet and server ?

Posted: 15 Nov 2019, 15:22
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.

Re: How to stop and shutdown pyplaneet and server ?

Posted: 15 Nov 2019, 15:35
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 ;).

Re: How to stop and shutdown pyplaneet and server ?

Posted: 15 Nov 2019, 16:52
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.