Comments (8)
That's really weird... especially since BackgroundProcess is specifically using 'exec' to execute the command... I don't know how much more 'exec-y' you can get.
I've tried it on an ubuntu karmic machine, and it appears to work fine:
irb(main):004:0> bp = BackgroundProcess.run("sleep 100")
=> #<BackgroundProcess:0x7ff34e8ba828 @stderr=#<IO:0x7ff34e8bada0>, @stdout=#<IO:0x7ff34e8bb1b0>, @stdin=#<IO:0x7ff34e8bb430>, @pid=22329>
irb(main):005:0>
[1]+ Stopped irb
root@utility:~ $ ps aux -H | grep 'sleep 100' -A5 -B5
root 1678 0.0 0.0 18652 532 ? Ss Mar31 0:00 cron
root 1703 0.0 0.0 49004 356 ? Ss Mar31 0:03 /usr/sbin/sshd
root 22204 0.0 0.0 80920 3528 ? Ss 05:34 0:00 sshd: root@pts/4
root 22261 0.0 0.0 18408 2612 pts/4 Ss 05:35 0:00 -bash
root 22306 0.1 0.2 46524 11564 pts/4 T 05:36 0:00 irb
root 22329 0.0 0.0 8096 592 pts/4 T 05:37 0:00 sleep 100
root 22335 0.0 0.0 14952 1056 pts/4 R+ 05:38 0:00 ps aux -H
root 22336 0.0 0.0 5992 644 pts/4 S+ 05:38 0:00 grep sleep 100 -A5 -B5
root 1708 0.0 0.0 5916 64 tty1 Ss+ Mar31 0:00 /sbin/getty -8 38400 tty1
root 9451 0.0 0.0 36944 636 ? Ss Apr01 0:00 /usr/lib/postfix/master
postfix 9455 0.0 0.0 39164 912 ? S Apr01 0:00 qmgr -l -t fifo -u
postfix 22194 0.0 0.0 39004 2116 ? S 05:28 0:00 pickup -l -t fifo -u
104 10408 0.0 0.0 23280 776 ? Ss Apr01 0:00 dbus-daemon --system --fork
root@utility:~ $ fg
irb
bp.pid
=> 22329
irb(main):006:0>
[1]+ Stopped irb
root@utility:~ $ cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu/ karmic main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ karmic main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ karmic-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ karmic-updates main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu karmic-security main restricted universe multiverse
deb-src http://security.ubuntu.com/ubuntu karmic-security main restricted universe multiverse
from background_process.
which ruby version are you using? Is it the same between OS X and your Ubuntu machine?
from background_process.
We're using ruby 1.8.7 (patchlevel 174) on both.
We'll see if we can reproduce it with a simpler script and upload it (at the moment we're using BackgroundProcess from within a Cucumber script, but I don't think that this is causing the issue).
from background_process.
are you using output redirectors?
irb(main):007:0* bp = BackgroundProcess.run("sleep 100 > 1")
=> #<BackgroundProcess:0x7ff34e88fd08 @stderr=#<IO:0x7ff34e88fdf8>, @stdout=#<IO:0x7ff34e88fee8>, @stdin=#<IO:0x7ff34e88ff60>, @pid=22411>
irb(main):008:0>
[1]+ Stopped irb
root@utility:~ $ ps aux -H | grep 'sleep 100' -A5 -B5
root 22204 0.0 0.0 80920 3528 ? Ss 05:34 0:00 sshd: root@pts/4
root 22261 0.0 0.0 18408 2624 pts/4 Ss 05:35 0:00 -bash
root 22306 0.0 0.2 46536 11568 pts/4 T 05:36 0:00 irb
root 22411 0.0 0.0 3928 564 pts/4 T 06:04 0:00 sh -c sleep 100 > 1
root 22412 0.0 0.0 8092 588 pts/4 T 06:04 0:00 sleep 100
root 22418 0.0 0.0 14948 1052 pts/4 R+ 06:04 0:00 ps aux -H
root 22419 0.0 0.0 6000 648 pts/4 S+ 06:04 0:00 grep sleep 100 -A5 -B5
root 1708 0.0 0.0 5916 64 tty1 Ss+ Mar31 0:00 /sbin/getty -8 38400 tty1
root 9451 0.0 0.0 36944 636 ? Ss Apr01 0:00 /usr/lib/postfix/master
postfix 9455 0.0 0.0 39164 912 ? S Apr01 0:00 qmgr -l -t fifo -u
postfix 22194 0.0 0.0 39004 2180 ? S 05:28 0:00 pickup -l -t fifo -u
104 10408 0.0 0.0 23280 776 ? Ss Apr01 0:00 dbus-daemon --system --fork
from background_process.
No, but we're explicitly running ruby (maybe with relative paths), which might?
ruby -rubygems bin/my_script args
When you
from background_process.
When it uses the "sh -c ... " version. Does kill work for you?
from background_process.
Just tried running this on OS X. It actually causes an orphan process to be left behind too.
So probably nothing to do with Ubuntu.
require 'rubygems'
require 'background_process'
bp = BackgroundProcess.run("sleep 100 > 1")
sleep(2)
bp.kill
bp.wait
from background_process.
I don't believe it would.
I'm curious to see if that's what's reproducing it. Can you record a screencast with jing or something and share it to demonstrate the problem? Or terminal output?
from background_process.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from background_process.