Rails System Commad

Hi All,

I'm having the following scenario:

In my code i run the rails system command

system "say xyz"

Suppose this "say xyz" command runs a process for a very long period of time then I want to:

1) stop/kill that process through rails code on click of button. 2) can I determine whether the system command is running properly and not had hanged the system?

Please guide me.

Thanks in advance,

Saurabh

Saurabh Peshkar wrote:

Hi All,

I'm having the following scenario:

In my code i run the rails system command

system "say xyz"

Suppose this "say xyz" command runs a process for a very long period of time then I want to:

1) stop/kill that process through rails code on click of button. 2) can I determine whether the system command is running properly and not had hanged the system

Am I missing something here, or are you trying to solve the halting problem?

Please guide me.

Thanks in advance,

Saurabh

Best,

Hi Marnen,

I am trying to determine whether the system command which I had run is running properly on the console or not, through ruby code.

Thanks, Saurabh

If you need to run commands in the background, a message queue is the way to go. Resque and resque-status offer you some ability to check in on the progress of background jobs, though if you’re shelling out you’d still need to have some way for your background worker to monitor the (forked) process, which depends on what exactly it is you’re doing.