trinidad / trinidad_init_services

Run Trinidad as a service (based on Commons-Daemon and JRuby-JSVC)
Other
28 stars 10 forks source link

Starts two processes each time #35

Open w1150n opened 11 years ago

w1150n commented 11 years ago

I've specified that the max/min runtimes should be 1. Running "/etc/init.d/trinidad start" seems to always start two processes. Here's what "ps -auxww | grep jruby" shows:

vagrant   3041  0.0  0.0  10628   336 ?        Ss   15:11   0:00 jsvc-trinidad -home /usr/lib/jvm/default-java -wait 20 -pidfile /mnt/app/shared/pids/trinidad.pid -procname jsvc-trinidad -jvm server -outfile /mnt/app/shared/log/trinidad.log -errfile &1 -cp /usr/local/share/jruby-1.7.3/lib/ruby/gems/shared/gems/trinidad_init_services-1.2.2/trinidad-libs/jruby-jsvc.jar:/usr/local/share/jruby-1.7.3/lib/ruby/gems/shared/gems/trinidad_init_services-1.2.2/trinidad-libs/commons-daemon.jar:/usr/local/lib/jruby/lib/jruby.jar -Djruby.shell=/bin/sh -Djffi.boot.library.path=/usr/local/lib/jruby/lib/native/arm-Linux:/usr/local/lib/jruby/lib/native/i386-Linux:/usr/local/lib/jruby/lib/native/x86_64-Linux -Djruby.home=/usr/local/lib/jruby -Djruby.lib=/usr/local/lib/jruby/lib -Djruby.script=jruby -Djruby.daemon.module.name=Trinidad -Djruby.compat.version=RUBY1_9 -Xmx500m -Xss2048k -Xbootclasspath/a:/usr/local/lib/jruby/lib/jruby.jar -Dfile.encoding=UTF-8 com.msp.jsvc.JRubyDaemon /usr/local/share/jruby-1.7.3/lib/ruby/gems/shared/gems/trinidad_init_services-1.2.2/lib/trinidad/daemon.rb -d /mnt/app/current -p 8080 -e production
vagrant   3042  4.0 33.9 1861496 345860 ?      Sl   15:11   0:44 jsvc-trinidad -home /usr/lib/jvm/default-java -wait 20 -pidfile /mnt/app/shared/pids/trinidad.pid -procname jsvc-trinidad -jvm server -outfile /mnt/app/shared/log/trinidad.log -errfile &1 -cp /usr/local/share/jruby-1.7.3/lib/ruby/gems/shared/gems/trinidad_init_services-1.2.2/trinidad-libs/jruby-jsvc.jar:/usr/local/share/jruby-1.7.3/lib/ruby/gems/shared/gems/trinidad_init_services-1.2.2/trinidad-libs/commons-daemon.jar:/usr/local/lib/jruby/lib/jruby.jar -Djruby.shell=/bin/sh -Djffi.boot.library.path=/usr/local/lib/jruby/lib/native/arm-Linux:/usr/local/lib/jruby/lib/native/i386-Linux:/usr/local/lib/jruby/lib/native/x86_64-Linux -Djruby.home=/usr/local/lib/jruby -Djruby.lib=/usr/local/lib/jruby/lib -Djruby.script=jruby -Djruby.daemon.module.name=Trinidad -Djruby.compat.version=RUBY1_9 -Xmx500m -Xss2048k -Xbootclasspath/a:/usr/local/lib/jruby/lib/jruby.jar -Dfile.encoding=UTF-8 com.msp.jsvc.JRubyDaemon /usr/local/share/jruby-1.7.3/lib/ruby/gems/shared/gems/trinidad_init_services-1.2.2/lib/trinidad/daemon.rb -d /mnt/app/current -p 8080 -e production

Is this simply the parent/child stuff that jsvc does?

kares commented 11 years ago

yes and no - you clearly have 2 trinidad instances running ... pls kill'em all than do trinidad start and there should be only one + a jsvc parent maybe

w1150n commented 11 years ago

That's what I'm saying, after killing those 2 processes and starting the service, there are always 2 trinidad processes. It's also worth mentioning that this is on Ubuntu 12.04

kares commented 11 years ago

I see - I reproduced this - I remember they (the jsvc parent and it's actual java child process) used to have different names not sure when that changed ... thus it's probably a jsvc launching issue - not sure how to fix it. one process is only a few kb. thus it's exactly as you suspected only it's unfortunate that they're named the same ...

w1150n commented 11 years ago

Fair enough, thanks for taking a look. That's not the worst problem to have, as long as we're not doubling up on memory footprint then it should be fine.