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

Ipmiview: 2.11.0 -> 2.12.0 #26337

Merged
merged 3 commits into from Jun 5, 2017
Merged

Ipmiview: 2.11.0 -> 2.12.0 #26337

merged 3 commits into from Jun 5, 2017

Conversation

johnramsden
Copy link
Member

Motivation for this change

Update version to latest. Old version no longer exists.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

The package does build now after bumping the version, however when using the program and attempting to launch a console with ipmi I get the error

Cannot run program “java” error=2, No such file or directory

I attempted to fix it and looked around but was unable to find the cause of the error. It seems that it's trying to launch the wrong "java". I don't know if this error existed before because I was never able to use the previous version.

@mention-bot
Copy link

@johnramsden, thanks for your PR! By analyzing the history of the files in this pull request, we identified @domenkozar and @dezgeg to be potential reviewers.

@Mic92
Copy link
Member

Mic92 commented Jun 3, 2017

You can use strace -f -e execve <yourprogram> in order to find out, which java it is looking for.

@johnramsden
Copy link
Member Author

@Mic92 I Just get it failing to run at all with strace.

strace -f -e execve IPMIView
execve("/run/current-system/sw/bin/IPMIView", ["IPMIView"], [/* 89 vars */]) = -1 ENOEXEC (Exec format error)
strace: exec: Exec format error
+++ exited with 1 +++

url = "ftp://ftp.supermicro.com/utility/IPMIView/Linux/IPMIView_V2.11.0_bundleJRE_Linux_x64_${version}.tar.gz";
sha256 = "1rv9j0id7i2ipm25n60bpfdm1gj44xg2aj8rnx4s6id3ln90q121";
};
src = pkgs.fetchurl {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pkgs is wrong here.

@Mic92
Copy link
Member

Mic92 commented Jun 3, 2017

The wrapper was bogus. Please try again.

@johnramsden
Copy link
Member Author

OK, wrapper let me run strace. Thanks @Mic92 I'm looking through the output now.

@johnramsden
Copy link
Member Author

johnramsden commented Jun 3, 2017

So it's looking for iKVM.jar, where should I put it? I tried wrapping it but it didn't work.

I tried this:

      makeWrapper $out/jre/bin/java $out/bin/iKVM.jar \
        --add-flags "-jar $out/iKVM.jar"

and this:

      makeWrapper $out/jre/bin/java $out/share/java/iKVM.jar \
        --add-flags "-jar $out/iKVM.jar"
[pid 32358] execve("/home/john/.local/bin/java", ["java", "-Djava.library.path=.", "-jar", "iKVM.jar", "172.20.30.3", "ADMIN", "REDACTED", "null", "5900", "623", "0", "0"], [/* 91 vars */]) = -1 ENOENT (No such file or directory)
[pid 32358] execve("/home/john/.node_modules/bin/java", ["java", "-Djava.library.path=.", "-jar", "iKVM.jar", "172.20.30.3", "ADMIN", "REDACTED", "null", "5900", "623", "0", "0"], [/* 91 vars */]) = -1 ENOENT (No such file or directory)
[pid 32358] execve("/home/john/bin/java", ["java", "-Djava.library.path=.", "-jar", "iKVM.jar", "172.20.30.3", "ADMIN", "REDACTED", "null", "5900", "623", "0", "0"], [/* 91 vars */]) = -1 ENOENT (No such file or directory)
[pid 32358] execve("/run/wrappers/bin/java", ["java", "-Djava.library.path=.", "-jar", "iKVM.jar", "172.20.30.3", "ADMIN", "REDACTED", "null", "5900", "623", "0", "0"], [/* 91 vars */]) = -1 ENOENT (No such file or directory)
[pid 32358] execve("/run/wrappers/bin/java", ["java", "-Djava.library.path=.", "-jar", "iKVM.jar", "172.20.30.3", "ADMIN", "REDACTED", "null", "5900", "623", "0", "0"], [/* 91 vars */]) = -1 ENOENT (No such file or directory)
[pid 32358] execve("/home/john/.nix-profile/bin/java", ["java", "-Djava.library.path=.", "-jar", "iKVM.jar", "172.20.30.3", "ADMIN", "REDACTED", "null", "5900", "623", "0", "0"], [/* 91 vars */]) = -1 ENOENT (No such file or directory)
[pid 32358] execve("/home/john/.nix-profile/sbin/java", ["java", "-Djava.library.path=.", "-jar", "iKVM.jar", "172.20.30.3", "ADMIN", "REDACTED", "null", "5900", "623", "0", "0"], [/* 91 vars */]) = -1 ENOENT (No such file or directory)
[pid 32358] execve("/home/john/.nix-profile/lib/kde4/libexec/java", ["java", "-Djava.library.path=.", "-jar", "iKVM.jar", "172.20.30.3", "ADMIN", "REDACTED", "null", "5900", "623", "0", "0"], [/* 91 vars */]) = -1 ENOENT (No such file or directory)
[pid 32358] execve("/nix/var/nix/profiles/default/bin/java", ["java", "-Djava.library.path=.", "-jar", "iKVM.jar", "172.20.30.3", "ADMIN", "REDACTED", "null", "5900", "623", "0", "0"], [/* 91 vars */]) = -1 ENOENT (No such file or directory)
[pid 32358] execve("/nix/var/nix/profiles/default/sbin/java", ["java", "-Djava.library.path=.", "-jar", "iKVM.jar", "172.20.30.3", "ADMIN", "REDACTED", "null", "5900", "623", "0", "0"], [/* 91 vars */]) = -1 ENOENT (No such file or directory)
[pid 32358] execve("/nix/var/nix/profiles/default/lib/kde4/libexec/java", ["java", "-Djava.library.path=.", "-jar", "iKVM.jar", "172.20.30.3", "ADMIN", "REDACTED", "null", "5900", "623", "0", "0"], [/* 91 vars */]) = -1 ENOENT (No such file or directory)
[pid 32358] execve("/run/current-system/sw/bin/java", ["java", "-Djava.library.path=.", "-jar", "iKVM.jar", "172.20.30.3", "ADMIN", "REDACTED", "null", "5900", "623", "0", "0"], [/* 91 vars */]) = -1 ENOENT (No such file or directory)
[pid 32358] execve("/run/current-system/sw/sbin/java", ["java", "-Djava.library.path=.", "-jar", "iKVM.jar", "172.20.30.3", "ADMIN", "REDACTED", "null", "5900", "623", "0", "0"], [/* 91 vars */]) = -1 ENOENT (No such file or directory)
[pid 32358] execve("/run/current-system/sw/lib/kde4/libexec/java", ["java", "-Djava.library.path=.", "-jar", "iKVM.jar", "172.20.30.3", "ADMIN", "REDACTED", "null", "5900", "623", "0", "0"], [/* 91 vars */]) = -1 ENOENT (No such file or directory)
[pid 32358] +++ exited with 255 +++
[pid 32296] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=32358, si_uid=1000, si_status=255, si_utime=0, si_stime=0} ---

@Mic92
Copy link
Member

Mic92 commented Jun 4, 2017

The problem is not iKVM.jar, but you need to extend the PATH of IPMIView in the wrapper to include $out/jre/bin/

echo "$out/jre/bin/java -jar $out/IPMIView20.jar" > $out/bin/IPMIView
chmod +x $out/bin/IPMIView
makeWrapper $out/jre/bin/java $out/bin/IPMIView \
--prefix PATH : "$out/jre/bin" \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try again, with this in place.

@johnramsden
Copy link
Member Author

Well, that helped, Now at least the error is gone but when I click the button to launch the KVM console nothing happens.

strace shows the following when I launch the KVM console:

[pid 16934] execve("/nix/store/fypifsmnf4yxqjs328dzd12h6j2v8sgq-IPMIView-20151223/jre/bin/java", ["java", "-Djava.library.path=.", "-jar", "iKVM.jar", "172.20.30.3", "ADMIN", "REDACTED", "null", "5900", "623", "0", "0"], [/* 90 vars */]) = 0
[pid 16934] +++ exited with 1 +++
[pid 16909] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=16934, si_uid=1000, si_status=1, si_utime=0, si_stime=0} ---

@Mic92
Copy link
Member

Mic92 commented Jun 5, 2017

I have no motherboard to debug this further. You could check the network traffic.

@johnramsden
Copy link
Member Author

@Mic92 I was wondering if I might need to set the classpath as was done here, but I wasn't sure what to set it to. Do you think that might be it? I don't know much about java, but it seems to be having trouble launching iKVM.jar.

@Mic92
Copy link
Member

Mic92 commented Jun 5, 2017

I suspect that the strace output of:

"java", "-Djava.library.path=.", "-jar", "iKVM.jar", "172.20.30.3", "ADMIN", "REDACTED", "null", "5900", "623", "0", "0"

is already correct. A jar file usually already contains all classes needed.

@johnramsden
Copy link
Member Author

OK, thanks for your help.

@johnramsden
Copy link
Member Author

I guess if you're happy with it this could be committed, could it not? With the commit it at least works other than the KVM console.

@Mic92 Mic92 merged commit 3a40dbc into NixOS:master Jun 5, 2017
@domenkozar
Copy link
Member

For the record: I never got the KVM console to work inside the Nix package.

It has to do with library loading, something among set LD_LIBRARY_PATH to $out

@domenkozar
Copy link
Member

domenkozar commented Nov 26, 2017

Fixed in 41740ec thanks

$ ldd /nix/store/bb7q2g6bvmvw1bj60cd2nq6yysbzh87f-IPMIView-2.13.0/libiKVM64.so
        linux-vdso.so.1 (0x00007ffd267e1000)
        libstdc++.so.6 => /nix/store/ni3s4gas1c95aqkkr67pla6k66chkmb8-gcc-6.4.0-lib/lib/libstdc++.so.6 (0x00007f025b6d8000)
        libm.so.6 => /nix/store/h1a1ncbkkhapzm0509plqjlfrgxw22f3-glibc-2.25-49/lib/libm.so.6 (0x00007f025b3c5000)
        libgcc_s.so.1 => /nix/store/ni3s4gas1c95aqkkr67pla6k66chkmb8-gcc-6.4.0-lib/lib/libgcc_s.so.1 (0x00007f025b1ae000)
        libc.so.6 => /nix/store/h1a1ncbkkhapzm0509plqjlfrgxw22f3-glibc-2.25-49/lib/libc.so.6 (0x00007f025ae0f000)
        /nix/store/h1a1ncbkkhapzm0509plqjlfrgxw22f3-glibc-2.25-49/lib64/ld-linux-x86-64.so.2 (0x00007f026037f000)

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

Successfully merging this pull request may close these issues.

None yet

4 participants