Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I shutdown/interact a rubyw.exe started task
    text
    copied!<p>It looks like my google search skills are to bad, I couldn't find answers for some questions:</p> <p>I call ruby tasks from a C# Service. Beside some several stuff in the service to get infos form registry, prepare tasks etc. I do finally:</p> <pre><code> m_mProcess.StartInfo = new ProcessStartInfo { FileName = Command, Arguments = Argument, WorkingDirectory = WorkDir, CreateNoWindow = true }; m_mProcess.Start(); Pid = m_mProcess.Id; </code></pre> <p>Filename is "ruby.exe". I tried a lot of stuff to make it possible to send a CTRL-SIGNAL-BREAK to the started task when I stop the service (see more details here which results in a fail: <a href="https://stackoverflow.com/questions/7741820/start-a-exe-file-from-a-service-and-stop-it-by-sending-sigbreak">Start a EXE file from a service and stop it by sending SIGBREAK</a>).</p> <p>So for now I just stop the process with <code>Process.GetProcessById(Pid).Kill();</code>.</p> <p>This brings just one problem. I start a thin server with the ruby task which opens and listen on a tcp port. When I kill the process the port is blocked by windows by design for 2-3minutes (not sure how long exactly - and didn't find out to disable this feature).</p> <p>So far for the prequel. Now to my actual issue :).</p> <p>I was thinking of using <code>rubyw.exe</code> instead of <code>ruby.exe</code> and by that find any way to interact with the task. My hope is that it is possible to shutdown/stop a rubyw.exe task correctly without blocking any ports. I already changed the service to start with rubyw.exe to test any side effects or problems instead of using ruby.exe (can't find any so far, yet). But I still have to kill the process until I find a way to shutdown the process correct.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload