<div dir="ltr">Jan, suspend/resume, termine - yes, that seems to be it, nice example<div><br></div><div>J</div></div><br><div class="gmail_quote"><div dir="ltr">po 23. 5. 2016 v 23:59 odesílatel Jan Rudolf <<a href="mailto:rudolja1@fit.cvut.cz">rudolja1@fit.cvut.cz</a>> napsal:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks you both for comments. I created a simple example of<br>
pause/suspend, resume, termination here<br>
<a href="https://github.com/jan-rudolf/python-process-control" rel="noreferrer" target="_blank">https://github.com/jan-rudolf/python-process-control</a>. Try to run it.<br>
It's a combination of multiprocessing and psutil library. I hope, the<br>
README me explain it well.<br>
<br>
Dne 2016-05-23 10:14, Jonas Eberle napsal:<br>
> Hi,<br>
><br>
> please be aware the "ctrl-z" is not pausing the process, it puts the<br>
> process in the background (still running). From the terminal you can<br>
> then start another process. So this is not about pausing and resuming.<br>
> I quickly found an example how it could work, first put the process in<br>
> the background, second stop (kill -STOP) the process and third resume<br>
> (kill -CONT) the process:<br>
> <a href="http://vertito.blogspot.de/2007/11/stop-pause-and-continue-linux-process.html" rel="noreferrer" target="_blank">http://vertito.blogspot.de/2007/11/stop-pause-and-continue-linux-process.html</a><br>
><br>
> But be aware, pausing and resuming are always OS dependent tasks. This<br>
> need to be taken into account.<br>
><br>
> Cheers,<br>
> Jonas<br>
><br>
> ----- Am 22. Mai 2016 um 23:20 schrieb Jachym Cepicky<br>
> <<a href="mailto:jachym.cepicky@gmail.com" target="_blank">jachym.cepicky@gmail.com</a>>:<br>
><br>
>> Hi,<br>
>> thanks for the info. About "controlling": we need at least "kill",<br>
>> "pause" and "resume" process. As far as I understand it, kill could<br>
>> be implemented using os.kill (if you know the process ID from the<br>
>> operating system point of view - it should be stored in the sqlite<br>
>> database for now). For pause and resume, I would suggest to find<br>
>> similar way as hitting "ctrl-z" in the command line, which "pauses"<br>
>> running process in the terminal and to get it in frontend again, you<br>
>> run the "fg" command - if you undestand what I'm talking about. I<br>
>> did not study, how this is usually done on system level (in unix<br>
>> systems), this is just my practical observation<br>
>> J<br>
>><br>
>> so 21. 5. 2016 v 23:14 odesílatel Jan Rudolf <<a href="mailto:rudolja1@fit.cvut.cz" target="_blank">rudolja1@fit.cvut.cz</a>><br>
>> napsal:<br>
>><br>
>>> Hello,<br>
>>><br>
>>> I want to inform you about my status: my semester in school ends<br>
Thank you both for comments. I created simple script in repo<br>
<a href="https://github.com/jan-rudolf/python-process-control" rel="noreferrer" target="_blank">https://github.com/jan-rudolf/python-process-control</a><br>
<br>
>>> tomorrow. I've got final exams from Graph algorithms this Thursday<br>
>>> and<br>
>>> from Linear algebra a week after. Hope, I make it without problems<br>
>>> (these two are the hardest), the rest will be ok/not that time<br>
>>> consuming.<br>
>>><br>
>>> Jachym specified top 4 goals for me on IRC meeting:<br>
>>> step 1: you get PyWPS up and running and you will be able to run<br>
>>> several<br>
>>> asynchronous processes on your computer<br>
>>> step 2: find out, what is the python way to control (and if<br>
>>> possible) in<br>
>>> background running processes<br>
>>> step 3: create API (rest) for this controlling<br>
>>> step 4: if there is time, create web UI<br>
>>><br>
>>> I have working PyWPS with Apache on my computer. Don't know if<br>
>>> it's the<br>
>>> case, that I have Mac OS, but I had a little bit trouble to set up<br>
>>> according to Github - so I can check it later on Ubuntu for<br>
>>> example<br>
>>> and/or make a manual for Mac. So step 1 is done.<br>
>>><br>
>>> Next is step 2. I would like to in next week or two create<br>
>>> demonstrative<br>
>>> applications (not interfering PyWPS repo) about possibilities of<br>
>>> the<br>
>>> control of processes in Python (with the focus on our<br>
>>> functionality) as<br>
>>> template cases for an integration into PyWPS source code. Then<br>
>>> integration, REST API, so on...<br>
>>><br>
>>> All the best, Jan Rudolf<br>
>>><br>
>>> _______________________________________________<br>
>>> pywps-dev mailing list<br>
>>> <a href="mailto:pywps-dev@lists.osgeo.org" target="_blank">pywps-dev@lists.osgeo.org</a><br>
>>> <a href="http://lists.osgeo.org/mailman/listinfo/pywps-dev" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/pywps-dev</a><br>
>><br>
>> _______________________________________________<br>
>> pywps-dev mailing list<br>
>> <a href="mailto:pywps-dev@lists.osgeo.org" target="_blank">pywps-dev@lists.osgeo.org</a><br>
>> <a href="http://lists.osgeo.org/mailman/listinfo/pywps-dev" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/pywps-dev</a><br>
_______________________________________________<br>
pywps-dev mailing list<br>
<a href="mailto:pywps-dev@lists.osgeo.org" target="_blank">pywps-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/pywps-dev" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/pywps-dev</a></blockquote></div>