1
How to kill a running process ?
gotcha1 (0)

I have started a Plone server via the repl.it shell.
I have closed the repl.it page with the server still running: http://ploneinrepl--gotcha1.repl.co
If I open the repl again and open the shell, how can I kill the running process ?

You are viewing a single comment. View All
1
TheDrone7 (517)

You won't be able to kill the process from the shell. The two easiest ways to do it are:-
1. Wait for 1 hour for it to kill itself.
2. Write 1 or 2 words deliberately to make the code buggy, then restart.

1
gotcha1 (0)

@TheDrone7 Thanks for your answer.
Trying 2, I have saved broken code for main.py and clicked the green start button.
This nicely fails in the python interpreter but does not kill the server started via the shell.

1
TheDrone7 (517)

@gotcha1 if you've started it via shell Ctrl + C to kill it.

1
gotcha1 (0)

@TheDrone7 which I could do if I did not have quit the repl opened in browser.
When I get back to my repl, I get a new shell without access to the running process... or at least, I do not know how to get access to it.
Which is why I ask how to kill it.

2
TheDrone7 (517)

@gotcha1 the only way I can think of now is to fork the repl and use the new one after deleting the old one.

1
PythinPython (6)

@gotcha1 If I am understanding you correctly then I believe there is no efficient way to kill it. But if you wait for a while the program will stop responding and in a way kill itself (like what TheDrone7 said).

1
Vandesm14 (486)

@PythinPython Can't you do top in the shell, get the pid of the process, and type kill [pid]?

1
gotcha1 (0)

@Vandesm14 I had not thought of top. However, neither top, neither ps commands are available in the shell.

1
TheDrone7 (517)

@Vandesm14 that would require superuser permissions and repl.it doesn't give you that.

1
TheDrone7 (517)

@PythinPython the repl won't go down on it's own either if started using the shell, unlike the normal repls, it stays up for a little longer than normally started ones. So the quicker way would be to fork it and continue working in the new one.

1
gotcha1 (0)

@TheDrone7 I have forked the repl as suggested.
For the record, if I run Plone in daemon mode and I write down its pid, I am able/allowed to kill it.

1
TheDrone7 (517)

@gotcha1 well that's good news. Last time I tried kill didn't go well for me.