Hi all. I'm having problems with OSProcess. When I run "OSProcess command: 'my command'" on Linux, the Moose playground says that "an ExternalUnixOSProcess with pid 20887 on /bin/sh (running)", but the external process never ends. What I'm missing? Cheers, Offray
On Sun, Nov 02, 2014 at 05:54:32PM -0500, Offray Vladimir Luna C??rdenas wrote:
Hi all.
I'm having problems with OSProcess. When I run "OSProcess command: 'my command'" on Linux, the Moose playground says that "an ExternalUnixOSProcess with pid 20887 on /bin/sh (running)", but the external process never ends. What I'm missing?
Hi Offray, The most likely explanation is that the process is actually still running. Can you say what kind of program this is? Dave
Hi Offray I had some issues controlling the process's life cycle and I fixed using the "exec" linux program. I'm using something like: OSProcess command: 'exec programToExecute'. Then I'm able to kill the process correctly and query the status. Hope it helps. Regards, Juan. On Sun, Nov 2, 2014 at 7:54 PM, Offray Vladimir Luna Cárdenas < offray@riseup.net> wrote:
Hi all.
I'm having problems with OSProcess. When I run "OSProcess command: 'my command'" on Linux, the Moose playground says that "an ExternalUnixOSProcess with pid 20887 on /bin/sh (running)", but the external process never ends. What I'm missing?
Cheers,
Offray
Thanks David and Juan, I was trying to run a pandoc conversion from markdown to html and I had an error inside my command. Once corrected it works without any problem and generates the desired file. One note on adding "exec" is that I get this message on the playground: "an ExternalUnixOSProcess with pid 21552 on /bin/sh (complete, normal termination with status 0)" which seems better. Despite of both working I will use the exec suggestion to have a better message from external process. Cheers, Offray On 11/02/2014 06:40 PM, Juan Ignacio Vaccarezza wrote:
Hi Offray I had some issues controlling the process's life cycle and I fixed using the "exec" linux program. I'm using something like: OSProcess command: 'exec programToExecute'. Then I'm able to kill the process correctly and query the status.
Hope it helps.
Regards, Juan.
On Sun, Nov 2, 2014 at 7:54 PM, Offray Vladimir Luna Cárdenas <offray@riseup.net <mailto:offray@riseup.net>> wrote:
Hi all.
I'm having problems with OSProcess. When I run "OSProcess command: 'my command'" on Linux, the Moose playground says that "an ExternalUnixOSProcess with pid 20887 on /bin/sh (running)", but the external process never ends. What I'm missing?
Cheers,
Offray
On Sun, Nov 02, 2014 at 07:28:44PM -0500, Offray Vladimir Luna C??rdenas wrote:
Thanks David and Juan,
I was trying to run a pandoc conversion from markdown to html and I had an error inside my command. Once corrected it works without any problem and generates the desired file. One note on adding "exec" is that I get this message on the playground:
"an ExternalUnixOSProcess with pid 21552 on /bin/sh (complete, normal termination with status 0)"
which seems better. Despite of both working I will use the exec suggestion to have a better message from external process.
Using the exec shell command is a good idea. Just for information, the ExternalUnixOSProcess object is a proxy for the real external OS process, which started by running the /bin/sh program. When you use exec to run your pandoc program, the pandoc program will begin running in the same external OS process that was originally running the /bin/sh program. The ExternalUnixOSProcess object does not know that you did this, so it still displays itself as "an ExternalUnixOSProcess ... on /bin/sh" even though the OS process is now actually running your pandoc program instead. But the exit status 0 came from your pandoc program, which is exactly what you wanted. Dave
Hi, Thanks Dave. Your detailed explanation helped me to understand what was going in. The problem was that I don't use /bin/sh as my default shell, so there was no process associated to it (/bin/zsh was the parent of all shell process including launching Pharo). Now I have changed the way I use to launch pharo from my zsh shell. It goes something like this: /bin/sh ~/Programas/Pharo/pharo-ui ~/Programas/Moose/5.0/moose-5.0.image Now is working well. The only thing is that the last process is always running, so I put an 'echo "something"' as the last argument of the OSProcess command: to get all previous commands working instead of making all but the last one (which waits forever and exec doesn't work). Cheers, Offray On 11/02/2014 08:17 PM, David T. Lewis wrote:
On Sun, Nov 02, 2014 at 07:28:44PM -0500, Offray Vladimir Luna C??rdenas wrote:
Thanks David and Juan,
I was trying to run a pandoc conversion from markdown to html and I had an error inside my command. Once corrected it works without any problem and generates the desired file. One note on adding "exec" is that I get this message on the playground:
"an ExternalUnixOSProcess with pid 21552 on /bin/sh (complete, normal termination with status 0)"
which seems better. Despite of both working I will use the exec suggestion to have a better message from external process.
Using the exec shell command is a good idea. Just for information, the ExternalUnixOSProcess object is a proxy for the real external OS process, which started by running the /bin/sh program. When you use exec to run your pandoc program, the pandoc program will begin running in the same external OS process that was originally running the /bin/sh program. The ExternalUnixOSProcess object does not know that you did this, so it still displays itself as "an ExternalUnixOSProcess ... on /bin/sh" even though the OS process is now actually running your pandoc program instead. But the exit status 0 came from your pandoc program, which is exactly what you wanted.
Dave
participants (3)
-
David T. Lewis -
Juan Ignacio Vaccarezza -
Offray Vladimir Luna Cárdenas