OSProcess or OSSubprocess?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

OSProcess or OSSubprocess?

hernanmd
Hi guys,

I need to monitor Unix command execution inside the image. The commands use heavy computation so they usually report progress in the terminal.

Are OSProcess or OSSubprocess ready to do in-image monitoring so I can watch the same terminal output in the Transcript updating for example every 10 seconds?

Particularly for OSProcess I couldn't find any method to fetch partial output.

Cheers,

Hernán

Reply | Threaded
Open this post in threaded view
|

Re: OSProcess or OSSubprocess?

Thierry Goubier


2017-03-20 10:00 GMT+01:00 Hernán Morales Durand <[hidden email]>:
Hi guys,

I need to monitor Unix command execution inside the image. The commands use heavy computation so they usually report progress in the terminal.

Are OSProcess or OSSubprocess ready to do in-image monitoring so I can watch the same terminal output in the Transcript updating for example every 10 seconds?

Particularly for OSProcess I couldn't find any method to fetch partial output.

GitFileTree does fetch partial output over OSProcess, but this is quite a low-level use of OSProcess.

What is missing is true pseudo-tty support.

Regards,

Thierry
 

Cheers,

Hernán


Reply | Threaded
Open this post in threaded view
|

Re: OSProcess or OSSubprocess?

Mariano Martinez Peck
In reply to this post by hernanmd

On Mon, Mar 20, 2017 at 6:00 AM, Hernán Morales Durand <[hidden email]> wrote:
Hi guys,

I need to monitor Unix command execution inside the image. The commands use heavy computation so they usually report progress in the terminal.

Are OSProcess or OSSubprocess ready to do in-image monitoring so I can watch the same terminal output in the Transcript updating for example every 10 seconds?


Hi Hernan,

There is a tail -f example in OSSubprocess documentation that prints the result on an inpsector and updates it [1]. However, OSSubprocess has problems on Linux with the default VM... you must use the threaded heartbeat (not the itimer).. see recent threads discussions for this. 

Let me know if that works.



 
Particularly for OSProcess I couldn't find any method to fetch partial output.

Cheers,

Hernán




--
Reply | Threaded
Open this post in threaded view
|

Re: OSProcess or OSSubprocess?

alistairgrant
Hi Mariano,

On 20 March 2017 at 12:24, Mariano Martinez Peck <[hidden email]> wrote:

>
> ....
>
> Hi Hernan,
>
> There is a tail -f example in OSSubprocess documentation that prints the
> result on an inpsector and updates it [1]. However, OSSubprocess has
> problems on Linux with the default VM... you must use the threaded heartbeat
> (not the itimer).. see recent threads discussions for this.
>
> Let me know if that works.
>
>
> [1]
> https://github.com/marianopeck/OSSubprocess#processing-streams-while-running

Cool!  Thanks for pointing this out.  I've just hit the same
requirement, and this will also prompt me to move to the threaded VM.

Cheers!
Alistair

Reply | Threaded
Open this post in threaded view
|

Re: OSProcess or OSSubprocess?

hernanmd
In reply to this post by Mariano Martinez Peck
I just tested and it works nice!! Thank you Mariano.

Just a quick note, to read from /var/log requires root privilege which many users cannot acquire. I tested using a bash script and then tailf the output file:

#!/bin/sh

while true; do
  echo $(date)
  sleep 2
done > output.txt


Cheers,

Hernán

2017-03-20 8:24 GMT-03:00 Mariano Martinez Peck <[hidden email]>:

On Mon, Mar 20, 2017 at 6:00 AM, Hernán Morales Durand <[hidden email]> wrote:
Hi guys,

I need to monitor Unix command execution inside the image. The commands use heavy computation so they usually report progress in the terminal.

Are OSProcess or OSSubprocess ready to do in-image monitoring so I can watch the same terminal output in the Transcript updating for example every 10 seconds?


Hi Hernan,

There is a tail -f example in OSSubprocess documentation that prints the result on an inpsector and updates it [1]. However, OSSubprocess has problems on Linux with the default VM... you must use the threaded heartbeat (not the itimer).. see recent threads discussions for this. 

Let me know if that works.



 
Particularly for OSProcess I couldn't find any method to fetch partial output.

Cheers,

Hernán




--