Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated init.d script doesn't work for me #6

Closed
sauliusgrigaitis opened this issue Jan 10, 2012 · 12 comments
Closed

Generated init.d script doesn't work for me #6

sauliusgrigaitis opened this issue Jan 10, 2012 · 12 comments

Comments

@sauliusgrigaitis
Copy link

I wanted to try your trinidad_init_scripts, it generated pretty nice init.d script http://pastiebin.com/?page=p&id=4f0c613b84f7e , but it throws error:

sudo /etc/init.d/trinidad start

Starting daemon...
Cannot find any VM in Java Home /usr/lib/jvm/java-6-sun-1.6.0.26/jre
Unable to redirect to /vol/apps/tsung_city/shared/logs/trinidad.log
Cannot find any VM in Java Home /usr/lib/jvm/java-6-sun-1.6.0.26/jre
Cannot locate JVM library file
Service exit with a return value of 1
Daemon exited with status: 1. Check pidfile and log

Thought my Java really lives at /usr/lib/jvm/java-6-sun-1.6.0.26

Thanks,
Saulius

@jkutner
Copy link
Member

jkutner commented Jan 10, 2012

How did you install your JVM? What OS are you running?

Also, does the user you are running the service as have permission to the /usr/lib/jvm/java-6-sun-1.6.0.26 directory?

Can you run 'which java' and 'java -version'?

thanks.

@sauliusgrigaitis
Copy link
Author

Hi jkutner,

I installed JVM using ubuntu packages. I'ts Ubuntu 10.04.

$ uname -a
Linux box2 2.6.32-37-generic #81-Ubuntu SMP Fri Dec 2 20:32:42 UTC 2011 x86_64 GNU/Linux

I tried to run it with sudo and without sudo. That unprivileged user also have read acess to /usr/lib/jvm/java-6-sun-1.6.0.26

$ which java
/usr/bin/java

$ java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)

BTW, init script generates such START_COMMAND:

/home/box2/.rvm/gems/jruby-1.6.6.dev-head/gems/trinidad_init_services-1.1.0/trinidad-libs/jsvc_linux -home /usr/lib/jvm/java-6-sun-1.6.0.26/jre -wait 20 -pidfile /vol/apps/tsung_city/shared/pids/trinidad.pid -user root -procname jsvc- -jvm server -outfile /vol/apps/tsung_city/shared/logs/trinidad.log -errfile &1 -cp /home/box2/.rvm/gems/jruby-1.6.6.dev-head/gems/trinidad_init_services-1.1.0/trinidad-libs/jruby-jsvc.jar:/home/box2/.rvm/gems/jruby-1.6.6.dev-head/gems/trinidad_init_services-1.1.0/trinidad-libs/commons-daemon.jar:/home/box2/.rvm/rubies/jruby-1.6.6.dev-head/lib/jruby.jar -Djruby.memory.max=500m -Djruby.stack.max=1024k -Djna.boot.library.path=/home/box2/.rvm/rubies/jruby-1.6.6.dev-head/lib/native/linux-i386:/home/box2/.rvm/rubies/jruby-1.6.6.dev-head/lib/native/linux-amd64 -Djffi.boot.library.path=/home/box2/.rvm/rubies/jruby-1.6.6.dev-head/lib/native/i386-Linux:/home/box2/.rvm/rubies/jruby-1.6.6.dev-head/lib/native/s390x-Linux:/home/box2/.rvm/rubies/jruby-1.6.6.dev-head/lib/native/x86_64-Linux -Djruby.shell=/bin/sh -Djruby.home=/home/box2/.rvm/rubies/jruby-1.6.6.dev-head -Djruby.lib=/home/box2/.rvm/rubies/jruby-1.6.6.dev-head/lib -Djruby.script=jruby -Djruby.daemon.module.name=Trinidad -Djruby.compat.version=RUBY1_9 -Xmx500m -Xss1024k -Xbootclasspath/a:/home/box2/.rvm/rubies/jruby-1.6.6.dev-head/lib/jruby.jar com.msp.jsvc.JRubyDaemon /home/box2/.rvm/gems/jruby-1.6.6.dev-head/gems/trinidad_init_services-1.1.0/lib/trinidad_init_services.rb -d /vol/apps/tsung_city/current -t -e production

Thanks,
Saulius

@jkutner
Copy link
Member

jkutner commented Jan 11, 2012

I'm not that familiar with the sun-java6 distribution. Can you try using the openjdk-6-jdk package? That is:

sudo apt-get openjdk-6-jdk

Which would give you a java_home of /usr/lib/jvm/java-6-openjdk/jre

@ghost
Copy link

ghost commented Jan 11, 2012

I'm seeing a similar problem on a CentOS 6.2 system using openjdk.

[root@myhost ~]# uname -a
Linux myhost 2.6.32-220.2.1.el6.x86_64 1 SMP Fri Dec 23 02:21:33 CST 2011 x86_64 x86_64 x86_64 GNU/Linux
[root@myhost ~]# cat /etc/redhat-release
CentOS release 6.2 (Final)

[root@myhost ~]# rpm -qa | grep java
java-1.6.0-openjdk-1.6.0.0-1.42.1.10.4.el6_2.x86_64
java-1.5.0-gcj-1.5.0.0-29.1.el6.x86_64
java-1.6.0-openjdk-devel-1.6.0.0-1.42.1.10.4.el6_2.x86_64
tzdata-java-2011l-4.el6.noarch
java_cup-0.10k-5.el6.x86_64

[root@myhost ~]# which java
/usr/bin/java

[root@myhost ~]# java -version
java version "1.6.0_22"
OpenJDK Runtime Environment (IcedTea6 1.10.4) (rhel-1.42.1.10.4.el6_2-x86_64)OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)

[root@myhost ~]# jruby -S gem list trinidad_init_services
*** LOCAL GEMS ***
trinidad_init_services (1.1.0)

[root@myhost ~]# service trinidad restart
Cannot find any VM in Java Home /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre
Daemon exited with status: 1. Check pidfile and log

[root@myhost ~]# cat /var/log/trinidad/trinidad.log
Cannot find any VM in Java Home /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre
Cannot locate JVM library file
Service exit with a return value of 1

@kares
Copy link
Member

kares commented Jan 17, 2012

sun-java6-jdk is just fine - I'm using it with JAVA_HOME=/usr/lib/jvm/java-6-sun/jre on Debian

the error is really weird, but since I have seen jsvc doing some weirdness already I would suggest compiling/installing jsvc yourself http://commons.apache.org/daemon/download_daemon.cgi (not relying on the one provided) then change the path in your init.d script e.g. JSVC=/usr/local/bin/jsvc

download the commons-daemon-1.0.8-native-src package and compile the binary
or sudo apt-get install jsvc hopefully there's a recent version for Ubuntu 10.04 ...

@kares
Copy link
Member

kares commented Jan 17, 2012

@calavera could we have a wiki here for information such as self compiling/installing jsvc/commons-daemon ?
or is it just fine to put these on trinidad's wiki anyway ?

@ghost
Copy link

ghost commented Jan 17, 2012

If it would help whoever is working on this issue, I have a CentOS VirtualBox VM that is having this problem that I could upload somewhere so the problem can be easily reproduced.

@calavera
Copy link
Contributor

@kares, yes, I've enabled the wiki, so we can add that information. It would be good to have it referenced on trinidad's wiki anyways.

@mhuffnagle that would be perfect, any help is always really appreciated.

@kares
Copy link
Member

kares commented Jan 17, 2012

@mhuffnagle so installing JSVC did not help https://github.com/trinidad/trinidad_init_services/wiki/Installing-JSVC ?

@ghost
Copy link

ghost commented Jan 17, 2012

@calavera I'll try to get that pulled together for you tonight and I'll PM instructions on where to download it.

@kares I haven't had a chance to install JSVC to see if that works around the problem, I probably won't get a chance to do that for a day or two.

@kares
Copy link
Member

kares commented Feb 29, 2012

confirming that self installing JSVC as I posted previously would solve this issue !

the bundled jsvc_linux binary is a 32-bit one, both reported systems are x64 and use a 64-bit java.
thus the binary fails with that it can not find any (compatible 32-bit) VM in the given Java Home ...

@kares
Copy link
Member

kares commented Mar 1, 2012

1.1.4 is out - we no longer bundle the linux binary instead we package JSVC's sources and try to compile the binary for you (unless installed)

@kares kares closed this as completed Mar 1, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants