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 P. 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,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

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.

On Feb 10, 2010 12:48 AM, “Saurabh P.” [email protected]
wrote:

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


Posted via http://www.ruby-forum.com/.


You received this message because you are subscribed…

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs