On Fri, Mar 28, 2008 at 7:44 PM, Jonathan Wallace
<[EMAIL PROTECTED]> wrote:
> On Fri, Mar 28, 2008 at 2:13 PM, Emil Marceta <[EMAIL PROTECTED]> wrote:
> [snip]
>
> > 5) ./script/background start | stop are unreliable. Stop throws if the
> > pid file is not found. Invoking start multiple times start multiple
> > processes - not sure what that means. Invoking stop afterwards stops
> > only the one process obviously.
>
> I'm unable to reproduce the your issue of multiple processes when
> invoking start multiple times. Did you delete your
> script/backgroundrb file and run rake backgroundrb:setup?
Yes. Here is on vanilla Rails project created from scratch with plugin
installed at the same time.
wahoo:bdrb_test emil$ ./script/backgroundrb start
wahoo:bdrb_test emil$ ps ax | grep ruby
3075 s003 S 0:00.08 ruby ./script/backgroundrb start
3076 s003 S 0:00.05 ruby log_worker
TERM_PROGRAM=iTerm.app
3078 s003 R+ 0:00.00 grep ruby
wahoo:bdrb_test emil$ ./script/backgroundrb start
wahoo:bdrb_test emil$ ps ax | grep ruby
3075 s003 S 0:00.21 ruby ./script/backgroundrb start
3076 s003 S 0:00.14 ruby log_worker
TERM_PROGRAM=iTerm.app
3083 s003 R+ 0:00.00 grep ruby
wahoo:bdrb_test emil$ ./script/backgroundrb stop
Deleting pid file
wahoo:bdrb_test emil$ ps ax | grep ruby
3075 s003 S 0:00.37 ruby ./script/backgroundrb start
3076 s003 S 0:00.25 ruby log_worker
TERM_PROGRAM=iTerm.app
3086 s003 R+ 0:00.00 grep ruby
wahoo:bdrb_test emil$ ./script/backgroundrb stop
./script/backgroundrb:46:in `initialize': No such file or directory -
/Users/emil/tmp/bdrb_test/tmp/pids/backgroundrb_11006.pid
(Errno::ENOENT)
from ./script/backgroundrb:46:in `open'
from ./script/backgroundrb:46
wahoo:bdrb_test emil$ ps ax | grep ruby
3075 s003 S 0:00.95 ruby ./script/backgroundrb start
3076 s003 S 0:00.61 ruby log_worker
TERM_PROGRAM=iTerm.app
3089 s003 R+ 0:00.00 grep ruby
wahoo:bdrb_test emil$
Maybe is OS X specific. I added a guard in script/backgroundrb that
tests for the pid file existence and that fixes double stop but he
double start is still there. Could it be that the 2nd start is
rewriting the pid file?
The start/stop issue is a less important one though. Migration process
/ tasks from old version to this version is our major issue. We were
unsuccessful to convert workers and framework to this version.
emil
_______________________________________________
Backgroundrb-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/backgroundrb-devel